forked from coopengo/tryton-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
win-make.sh
executable file
·60 lines (51 loc) · 1.06 KB
/
win-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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
version() {
local t
t=$(git describe --tags --exact-match 2> /dev/null | grep "^coog-" | head -1)
if [ ! -z "$t" ]
then
echo "${t//coog-/}"
else
local b; b=$(git rev-parse --abbrev-ref HEAD)
local c; c=$(git rev-parse --short HEAD)
echo "$b-$c" | sed -e "s/coog-//g"
fi
}
deps() {
pacman -S \
mingw-w64-x86_64-librsvg \
mingw-w64-x86_64-nsis \
mingw-w64-x86_64-python2 \
mingw-w64-x86_64-python2-setuptools \
mingw-w64-x86_64-python2-pip \
mingw-w64-x86_64-python2-pygtk \
mingw-w64-x86_64-gtk-engine-murrine \
mingw-w64-x86_64-python2-cx_Freeze
pip install \
python-dateutil \
chardet \
pyflakes
}
clean() {
rm -rf build dist coog-*
}
patch() {
git apply win-patch.diff
}
unpatch() {
git checkout HEAD -- tryton
}
build() {
clean
patch
local v; v=$(version)
python setup-freeze.py install_exe -d dist
makensis -DVERSION="$v" setup.nsi
makensis -DVERSION="$v" setup-single.nsi
unpatch
}
main() {
[ -z "$1" ] && echo missing command && return 1
"$1" "$@"
}
main "$@"