forked from gramps-project/gramps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
156 lines (144 loc) · 4.31 KB
/
build.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#!/usr/bin/env bash
#
# Assumption: script is executed from the 'aio' directory
#
# install prerequisites
## prerequisites in msys packages
pacman -S --needed --noconfirm \
base-devel \
git \
mingw-w64-x86_64-adwaita-icon-theme \
mingw-w64-x86_64-enchant \
mingw-w64-x86_64-geocode-glib \
mingw-w64-x86_64-gexiv2 \
mingw-w64-x86_64-ghostscript \
mingw-w64-x86_64-goocanvas \
mingw-w64-x86_64-graphviz \
mingw-w64-x86_64-gspell \
mingw-w64-x86_64-hunspell \
mingw-w64-x86_64-iso-codes \
mingw-w64-x86_64-nsis \
mingw-w64-x86_64-osm-gps-map \
mingw-w64-x86_64-python \
mingw-w64-x86_64-python-cairo \
mingw-w64-x86_64-python-cx-freeze \
mingw-w64-x86_64-python-gobject \
mingw-w64-x86_64-python-graphviz \
mingw-w64-x86_64-python-icu \
mingw-w64-x86_64-python-jsonschema \
mingw-w64-x86_64-python-lxml \
mingw-w64-x86_64-python-networkx \
mingw-w64-x86_64-python-nose \
mingw-w64-x86_64-python-packaging \
mingw-w64-x86_64-python-pillow \
mingw-w64-x86_64-python-pip \
mingw-w64-x86_64-python-psycopg2 \
mingw-w64-x86_64-python-pycountry \
mingw-w64-x86_64-python-requests \
mingw-w64-x86_64-python-wheel \
perl-XML-Parser \
unzip \
upx
pacman -S --needed --noconfirm mingw-w64-x86_64-toolchain
wget --no-verbose -N https://repo.msys2.org/mingw/mingw64/mingw-w64-x86_64-python-cx-freeze-6.15.9-1-any.pkg.tar.zst
pacman -U --needed --noconfirm mingw-w64-x86_64-python-cx-freeze-6.15.9-1-any.pkg.tar.zst
wget --no-verbose -N https://github.com/bpisoj/MINGW-packages/releases/download/v5.0/mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
pacman -U --needed --noconfirm mingw-w64-x86_64-db-6.0.30-1-any.pkg.tar.xz
pacman -S --needed --noconfirm mingw-w64-x86_64-python-bsddb3
## prerequisites in pip packages
python -m pip install --upgrade pip
pip install --upgrade pydot pydotplus requests asyncio
SETUPTOOLS_USE_DISTUTILS=stdlib pip install pygraphviz
## download dictionaries
mkdir -p /mingw64/share/enchant/hunspell
pushd /mingw64/share/enchant/hunspell
rootdir=https://raw.githubusercontent.com/wooorm/dictionaries/main/dictionaries/
dicts=(
bg:bg_BG
ca:ca_ES
cs:cs_CZ
da:da_DK
de:de_DE
el:el_GR
en-AU:en_AU
en-GB:en_GB
en:en_US
eo:eo
es:es_ES
fr:fr_FR
he:he_IL
hr:hr_HR
hu:hu_HU
is:is_IS
it:it_IT
lt:lt_LT
nb:nb_NO
nl:nl_NL
nn:nn_NO
pl:pl_PL
pt:pt_BR
pt-PT:pt_PT
ru:ru_RU
sk:sk_SK
sl:sl_SI
sr:sr_RS
sv:sv_SE
tr:tr_TR
uk:uk_UA
vi:vi_VN
)
for dict in "${dicts[@]}"; do
dir=${dict%:*}
lang=${dict#*:}
wget --no-verbose ${rootdir}${dir}/index.aff
mv index.aff ${lang}.aff
wget --no-verbose ${rootdir}${dir}/index.dic
mv index.dic ${lang}.dic
done
popd
mkdir -p /mingw64/share/enchant/voikko
pushd /mingw64/share/enchant/voikko
wget --no-verbose -N https://www.puimula.org/htp/testing/voikko-snapshot-v5/dict.zip
unzip -o dict.zip
rm dict.zip
popd
# Assumption: script is executed from the 'aio' directory!
#cd D:/a/gramps/gramps/aio
## create a directory structure for icons
mkdir /mingw64/share/icons/gnome
mkdir /mingw64/share/icons/gnome/48x48
mkdir /mingw64/share/icons/gnome/48x48/mimetypes
mkdir /mingw64/share/icons/gnome/scalable
mkdir /mingw64/share/icons/gnome/scalable/mimetypes
mkdir /mingw64/share/icons/gnome/scalable/places
# Change to the gramps root directory
cd ..
cp images/gramps.png /mingw64/share/icons
cd images/hicolor/48x48/mimetypes
for f in *.png
do
cp $f /mingw64/share/icons/gnome/48x48/mimetypes/gnome-mime-$f
done
cd ../../scalable/mimetypes
for f in *.svg
do
cp $f /mingw64/share/icons/gnome/scalable/mimetypes/gnome-mime-$f
done
cd ../../../..
cp /mingw64/share/icons/hicolor/scalable/places/*.svg /mingw64/share/icons/gnome/scalable/places
# build gramps
rm -rf dist aio/dist
python setup.py bdist_wheel
appbuild="r$(git rev-list --count HEAD)-$(git rev-parse --short HEAD)"
appversion=$(grep "^VERSION_TUPLE" gramps/version.py|sed 's/.*(//;s/, */\./g;s/).*//')
unzip -d aio/dist dist/*.whl
cd aio
# create nsis script
cat grampsaio64.nsi.template|sed "s/yourVersion/$appversion/;s/yourBuild/$appbuild/">grampsaio64.nsi
# build cx_freeze executables
python setup.py build_exe --no-compress
# build installer
cd mingw64/src
makensis grampsaio64.nsi
# result is in mingw64/src
exit 0