-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.sh
executable file
·38 lines (38 loc) · 2.59 KB
/
make.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
echo "Qt 4 enviroment needed, press any key to start making..."
read -sn 1
cd "$(dirname "$0")"
cd project-lemon
command -v qmake >/dev/null 2>&1 || { (brew tap cartr/qt4 && brew tap-pin cartr/qt4 && brew install qt@4) 2>&1 || { echo >&2 "Requiring brew but it's not installed. Aborting."; exit 1; } }
command -v rpl >/dev/null 2>&1 || { brew install rpl; }
rpl "Q_OS_LINUX" "Q_OS_MAC" ./*
rpl "memoryLimit *= 1024 * 1024;" "memoryLimit *= 1024;" ./watcher_unix.c # macOS memory limit fix
rpl "(usage.ru_maxrss) * 1024" "(usage.ru_maxrss)" ./watcher_unix.c # macOS memory usage fix
rpl "1024 * 1024" "1024" ./judgingthread.cpp # macOS memory limit fix
rm -f watcher_unix
gcc -o watcher_unix watcher_unix.c
echo >> lemon.pro
echo "ICON = lemon.icns" >> lemon.pro
mkdir tmp.iconset
sips -z 16 16 icon.png --out tmp.iconset/icon_16x16.png
sips -z 32 32 icon.png --out tmp.iconset/[email protected]
sips -z 32 32 icon.png --out tmp.iconset/icon_32x32.png
sips -z 64 64 icon.png --out tmp.iconset/[email protected]
sips -z 128 128 icon.png --out tmp.iconset/icon_128x128.png
sips -z 256 256 icon.png --out tmp.iconset/[email protected]
sips -z 256 256 icon.png --out tmp.iconset/icon_256x256.png
sips -z 512 512 icon.png --out tmp.iconset/[email protected]
sips -z 512 512 icon.png --out tmp.iconset/icon_512x512.png
sips -z 512 512 icon.png --out tmp.iconset/[email protected]
iconutil -c icns tmp.iconset -o lemon.icns
qmake
make
macdeployqt lemon.app
echo "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBsaXN0IFBVQkxJQyAiLS8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