-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathmakefile
More file actions
284 lines (243 loc) · 13.1 KB
/
Copy pathmakefile
File metadata and controls
284 lines (243 loc) · 13.1 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
# This builds the files needed to run Diogenes.
# Note that the dictionaries and morphological data are built using
# different makefiles; read README.md for details.
include mk.common
DIOGENESVERSION = $(shell grep "Diogenes::Base::Version" server/Diogenes/Base.pm | sed -n 's/[^"]*"\([^"]*\)"[^"]*/\1/p')
ELECTRONVERSION = 4.0.2
ENTSUM = 84cb3710463ea1bd80e6db3cf31efcb19345429a3bafbefc9ecff71d0a64c21c
UNICODEVERSION = 7.0.0
UNICODESUM = bfa3da58ea982199829e1107ac5a9a544b83100470a2d0cc28fb50ec234cb840
STRAWBERRYPERLVERSION=5.28.0.1
all: server/Diogenes/unicode-equivs.pl server/Diogenes/EntityTable.pm server/fonts/GentiumPlus-I.woff server/fonts/GentiumPlus-R.woff
$(DEPDIR)/UnicodeData-$(UNICODEVERSION).txt:
curl -o $@ http://www.unicode.org/Public/$(UNICODEVERSION)/ucd/UnicodeData.txt
printf '%s %s\n' $(UNICODESUM) $@ | shasum -c -a 256
server/Diogenes/unicode-equivs.pl: utils/make_unicode_compounds.pl $(DEPDIR)/UnicodeData-$(UNICODEVERSION).txt
./utils/make_unicode_compounds.pl < $(DEPDIR)/UnicodeData-$(UNICODEVERSION).txt > $@
build/GentiumPlus-5.000-web.zip:
mkdir -p build
curl -o $@ https://software.sil.org/downloads/r/gentium/GentiumPlus-5.000-web.zip
server/fonts/GentiumPlus-I.woff: build/GentiumPlus-5.000-web.zip
unzip -n build/GentiumPlus-5.000-web.zip -d build
mkdir -p server/fonts
cp build/GentiumPlus-5.000-web/web/GentiumPlus-I.woff $@
server/fonts/GentiumPlus-R.woff: build/GentiumPlus-5.000-web.zip
unzip -n build/GentiumPlus-5.000-web.zip -d build
mkdir -p server/fonts
cp build/GentiumPlus-5.000-web/web/GentiumPlus-R.woff $@
$(DEPDIR)/PersXML.ent:
curl -o $@ http://www.perseus.tufts.edu/DTD/1.0/PersXML.ent
printf '%s %s\n' $(ENTSUM) $@ | shasum -c -a 256
server/Diogenes/EntityTable.pm: utils/ent_to_array.pl $(DEPDIR)/PersXML.ent
printf '# Generated by makefile using utils/ent_to_array.pl\n' > $@
printf 'package Diogenes::EntityTable;\n\n' >> $@
./utils/ent_to_array.pl < $(DEPDIR)/PersXML.ent >> $@
electron/electron-v$(ELECTRONVERSION)-linux-x64:
mkdir -p electron
curl -L https://github.com/electron/electron/releases/download/v$(ELECTRONVERSION)/electron-v$(ELECTRONVERSION)-linux-x64.zip > electron/electron-v$(ELECTRONVERSION)-linux-x64.zip
unzip -d electron/electron-v$(ELECTRONVERSION)-linux-x64 electron/electron-v$(ELECTRONVERSION)-linux-x64.zip
rm electron/electron-v$(ELECTRONVERSION)-linux-x64.zip
linux64: all electron/electron-v$(ELECTRONVERSION)-linux-x64
rm -rf linux64
mkdir linux64
cp -r electron/electron-v$(ELECTRONVERSION)-linux-x64/* linux64
cp -r server linux64
cp -r dependencies linux64
cp -r dist linux64
cp -r client linux64/resources/app
mv linux64/electron linux64/diogenes
cp COPYING README.md linux64
electron/electron-v$(ELECTRONVERSION)-win32-ia32:
mkdir -p electron
curl -L https://github.com/electron/electron/releases/download/v$(ELECTRONVERSION)/electron-v$(ELECTRONVERSION)-win32-ia32.zip > electron/electron-v$(ELECTRONVERSION)-win32-ia32.zip
unzip -d electron/electron-v$(ELECTRONVERSION)-win32-ia32 electron/electron-v$(ELECTRONVERSION)-win32-ia32.zip
rm electron/electron-v$(ELECTRONVERSION)-win32-ia32.zip
electron/electron-v$(ELECTRONVERSION)-win32-x64:
mkdir -p electron
curl -L https://github.com/electron/electron/releases/download/v$(ELECTRONVERSION)/electron-v$(ELECTRONVERSION)-win32-x64.zip > electron/electron-v$(ELECTRONVERSION)-win32-x64.zip
unzip -d electron/electron-v$(ELECTRONVERSION)-win32-x64 electron/electron-v$(ELECTRONVERSION)-win32-x64.zip
rm electron/electron-v$(ELECTRONVERSION)-win32-x64.zip
w32perl:
mkdir -p w32perl/strawberry
curl http://strawberryperl.com/download/$(STRAWBERRYPERLVERSION)/strawberry-perl-$(STRAWBERRYPERLVERSION)-32bit-portable.zip > w32perl/strawberry-perl-$(STRAWBERRYPERLVERSION)-32bit-portable.zip
unzip -d w32perl/strawberry w32perl/strawberry-perl-$(STRAWBERRYPERLVERSION)-32bit-portable.zip
rm w32perl/strawberry-perl-$(STRAWBERRYPERLVERSION)-32bit-portable.zip
w64perl:
mkdir -p w64perl/strawberry
curl http://strawberryperl.com/download/$(STRAWBERRYPERLVERSION)/strawberry-perl-$(STRAWBERRYPERLVERSION)-64bit-portable.zip > w64perl/strawberry-perl-$(STRAWBERRYPERLVERSION)-64bit-portable.zip
unzip -d w64perl/strawberry w64perl/strawberry-perl-$(STRAWBERRYPERLVERSION)-64bit-portable.zip
rm w64perl/strawberry-perl-$(STRAWBERRYPERLVERSION)-64bit-portable.zip
rcedit.exe:
curl -Lo $@ https://github.com/electron/rcedit/releases/download/v0.1.0/rcedit.exe
icons: dist/icon.svg
@echo "Rendering icons (needs rsvg-convert and Adobe Garamond Pro font)"
mkdir -p icons
rsvg-convert -w 256 -h 256 dist/icon.svg > icons/256.png
rsvg-convert -w 128 -h 128 dist/icon.svg > icons/128.png
rsvg-convert -w 64 -h 64 dist/icon.svg > icons/64.png
rsvg-convert -w 48 -h 48 dist/icon.svg > icons/48.png
rsvg-convert -w 32 -h 32 dist/icon.svg > icons/32.png
rsvg-convert -w 16 -h 16 dist/icon.svg > icons/16.png
icons/diogenes.ico: icons
icotool -c icons/256.png icons/128.png icons/64.png icons/48.png icons/32.png icons/16.png > $@
dist/diogenes.icns: icons
png2icns $@ icons/256.png icons/128.png icons/48.png icons/32.png icons/16.png
w32: all electron/electron-v$(ELECTRONVERSION)-win32-ia32 w32perl icons/diogenes.ico rcedit.exe
@echo "Making windows package. Note that this requires wine to be"
@echo "installed, to edit the .exe resources."
rm -rf w32
mkdir -p w32
cp -r electron/electron-v$(ELECTRONVERSION)-win32-ia32/* w32
cp -r client w32/resources/app
mv w32/electron.exe w32/diogenes.exe
cp -r server w32
cp -r dependencies w32
cp -r w32perl/strawberry w32
cp icons/diogenes.ico w32
sed 's/$$/\r/g' < COPYING > w32/COPYING.txt
sed 's/$$/\r/g' < README.md > w32/README.md
wine rcedit.exe w32/diogenes.exe \
--set-icon icons/diogenes.ico \
--set-product-version $(DIOGENESVERSION) \
--set-file-version $(DIOGENESVERSION) \
--set-version-string CompanyName "The Diogenes Team" \
--set-version-string ProductName Diogenes \
--set-version-string FileDescription Diogenes
w64: all electron/electron-v$(ELECTRONVERSION)-win32-x64 w64perl icons/diogenes.ico rcedit.exe
@echo "Making windows package. Note that this requires wine to be"
@echo "installed, to edit the .exe resources."
rm -rf w64
mkdir -p w64
cp -r electron/electron-v$(ELECTRONVERSION)-win32-x64/* w64
cp -r client w64/resources/app
mv w64/electron.exe w64/diogenes.exe
cp -r server w64
cp -r dependencies w64
cp -r w64perl/strawberry w64
cp icons/diogenes.ico w64
sed 's/$$/\r/g' < COPYING > w64/COPYING.txt
sed 's/$$/\r/g' < README.md > w64/README.md
wine rcedit.exe w64/diogenes.exe \
--set-icon icons/diogenes.ico \
--set-product-version $(DIOGENESVERSION) \
--set-file-version $(DIOGENESVERSION) \
--set-version-string CompanyName "The Diogenes Team" \
--set-version-string ProductName Diogenes \
--set-version-string FileDescription Diogenes
electron/electron-v$(ELECTRONVERSION)-darwin-x64:
mkdir -p electron
curl -L https://github.com/electron/electron/releases/download/v$(ELECTRONVERSION)/electron-v$(ELECTRONVERSION)-darwin-x64.zip > electron/electron-v$(ELECTRONVERSION)-darwin-x64.zip
unzip -d electron/electron-v$(ELECTRONVERSION)-darwin-x64 electron/electron-v$(ELECTRONVERSION)-darwin-x64.zip
rm electron/electron-v$(ELECTRONVERSION)-darwin-x64.zip
mac: all electron/electron-v$(ELECTRONVERSION)-darwin-x64 dist/diogenes.icns
rm -rf mac
mkdir -p mac
cp -r electron/electron-v$(ELECTRONVERSION)-darwin-x64/* mac
cp -r client mac/Electron.app/Contents/Resources/app
cp -r server mac/Electron.app/Contents
cp -r dependencies mac/Electron.app/Contents
cp dist/diogenes.icns mac/Electron.app/Contents/Resources/
perl -pi -e 's/electron.icns/diogenes.icns/g' mac/Electron.app/Contents/Info.plist
perl -pi -e 's/Electron/Diogenes/g' mac/Electron.app/Contents/Info.plist
perl -pi -e 's/com.github.electron/uk.ac.durham.diogenes/g' mac/Electron.app/Contents/Info.plist
perl -pi -e 's/$(ELECTRONVERSION)/$(DIOGENESVERSION)/g' mac/Electron.app/Contents/Info.plist
perl -pi -e 's#</dict>#<key>NSHumanReadableCopyright</key>\n<string>Copyright © 2019 Peter Heslin\nDistributed under the GNU GPL version 3</string>\n</dict>#' mac/Electron.app/Contents/Info.plist
mv mac/Electron.app mac/Diogenes.app
mv mac/Diogenes.app/Contents/MacOS/Electron mac/Diogenes.app/Contents/MacOS/Diogenes
mv "mac/Diogenes.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Electron Helper" "mac/Diogenes.app/Contents/Frameworks/Electron Helper.app/Contents/MacOS/Diogenes Helper"
mv "mac/Diogenes.app/Contents/Frameworks/Electron Helper.app" "mac/Diogenes.app/Contents/Frameworks/Diogenes Helper.app"
sed 's/$$/\r/g' < COPYING > mac/COPYING.txt
sed 's/$$/\r/g' < README.md > mac/README.md
zip-linux64: linux64
rm -rf diogenes-linux-$(DIOGENESVERSION)
mv linux64 diogenes-linux-$(DIOGENESVERSION)
tar c diogenes-linux-$(DIOGENESVERSION) | xz > diogenes-linux-$(DIOGENESVERSION).tar.xz
rm -rf diogenes-linux-$(DIOGENESVERSION)
zip-mac: mac
rm -rf diogenes-mac-$(DIOGENESVERSION)
mv mac diogenes-mac-$(DIOGENESVERSION)
zip -r diogenes-mac-$(DIOGENESVERSION).zip diogenes-mac-$(DIOGENESVERSION)
rm -rf diogenes-mac-$(DIOGENESVERSION)
zip-w32: w32
rm -rf diogenes-win32-$(DIOGENESVERSION)
mv w32 diogenes-win32-$(DIOGENESVERSION)
zip -r diogenes-win32-$(DIOGENESVERSION).zip diogenes-win32-$(DIOGENESVERSION)
rm -rf diogenes-win32-$(DIOGENESVERSION)
zip-w64: w64
rm -rf diogenes-win64-$(DIOGENESVERSION)
mv w64 diogenes-win64-$(DIOGENESVERSION)
zip -r diogenes-win64-$(DIOGENESVERSION).zip diogenes-win64-$(DIOGENESVERSION)
rm -rf diogenes-win64-$(DIOGENESVERSION)
zip-all: zip-linux64 zip-mac zip-w32 zip-w64
inno-setup:
mkdir inno-setup
curl -Lo inno-setup/is.exe http://www.jrsoftware.org/download.php/is.exe
cd inno-setup; innoextract is.exe
installer-w32: inno-setup w32
wine inno-setup/app/ISCC.exe dist/diogenes-win32.iss
mv -f dist/Output/mysetup.exe diogenes-setup-win32-$(DIOGENESVERSION).exe
rmdir dist/Output
installer-w64: inno-setup w64
wine inno-setup/app/ISCC.exe dist/diogenes-win64.iss
mv -f Output/mysetup.exe diogenes-setup-win64-$(DIOGENESVERSION).exe
rmdir Output
# NB. Installing this Mac package will report success but silently fail if there exists another copy of Diogenes.app with the same version number anywhere whatsoever on the same disk volume, such as in the mac directory here or another random copy on the devel machine.
installer-macpkg: mac
rm -f Diogenes-$(DIOGENESVERSION).pkg
fpm --prefix=/Applications -C mac -t osxpkg -n Diogenes -v $(DIOGENESVERSION) --osxpkg-identifier-prefix uk.ac.durham.diogenes -s dir Diogenes.app
installer-deb64: linux64
rm -f diogenes-$(DIOGENESVERSION)_amd64.deb
fpm -s dir -t deb -n diogenes -v $(DIOGENESVERSION) -a x86_64 \
-p diogenes-$(DIOGENESVERSION)_amd64.deb -d perl \
-m p.j.heslin@durham.ac.uk --vendor p.j.heslin@durham.ac.uk \
--url http://community.dur.ac.uk/p.j.heslin/Software/Diogenes/ \
--description "Tool for legacy databases of Latin and Greek texts" \
--license GPL3 --post-install dist/post-install-deb.sh \
linux64/=/usr/local/diogenes/ \
dist/diogenes.desktop=/usr/share/applications/ \
dist/icon.svg=/usr/share/icons/diogenes.svg
# Completely untested functionality. I don't know how many of these fpm options are applicable when generating rpms.
installer-rpm64: linux64
rm -f diogenes-$(DIOGENESVERSION).x86_64.rpm
fpm -s dir -t rpm -n diogenes -v $(DIOGENESVERSION) -a x86_64 \
-p diogenes-$(DIOGENESVERSION).x86_64.rpm -d perl \
-m p.j.heslin@durham.ac.uk --vendor p.j.heslin@durham.ac.uk \
--url http://community.dur.ac.uk/p.j.heslin/Software/Diogenes/ \
--description "Tool for legacy databases of Latin and Greek texts" \
--license GPL3 --post-install dist/post-install-rpm.sh \
linux64/=/usr/local/diogenes/ \
dist/diogenes.desktop=/usr/share/applications/ \
dist/icon.svg=/usr/share/icons/diogenes.svg
installer-arch64: linux64
rm -f diogenes-$(DIOGENESVERSION).pkg.tar.xz
fpm -s dir -t pacman -n diogenes -v $(DIOGENESVERSION) -a x86_64 \
-p diogenes-$(DIOGENESVERSION).pkg.tar.xz -d perl \
-m p.j.heslin@durham.ac.uk --vendor p.j.heslin@durham.ac.uk \
--url http://community.dur.ac.uk/p.j.heslin/Software/Diogenes/ \
--description "Tool for legacy databases of Latin and Greek texts" \
--license GPL3 --post-install dist/post-install-rpm.sh \
linux64/=/usr/local/diogenes/ \
dist/diogenes.desktop=/usr/share/applications/ \
dist/icon.svg=/usr/share/icons/diogenes.svg
installer-all: installer-w32 installer-w64 installer-macpkg installer-deb64 installer-rpm64 installer-arch64
clean:
rm -f $(DEPDIR)/UnicodeData-$(UNICODEVERSION).txt
rm -f server/Diogenes/unicode-equivs.pl
rm -f $(DEPDIR)/PersXML.ent
rm -f server/Diogenes/EntityTable.pm
rm -rf server/fonts
rm -rf icons dist/diogenes.icns
rm -f rcedit.exe
rm -rf build
rm -rf electron
rm -rf mac diogenes-mac-$(DIOGENESVERSION)
rm -rf linux64 diogenes-linux64-$(DIOGENESVERSION)
rm -rf w32 w32perl diogenes-w32-$(DIOGENESVERSION)
rm -rf w64 w64perl diogenes-w64-$(DIOGENESVERSION)
rm -rf inno-setup
rm -f diogenes-setup-win32-$(DIOGENESVERSION).exe
rm -f diogenes-setup-win64-$(DIOGENESVERSION).exe
rm -f Diogenes-$(DIOGENESVERSION).pkg
rm -f diogenes-$(DIOGENESVERSION)_amd64.deb
rm -f diogenes-$(DIOGENESVERSION).x86_64.rpm
rm -f diogenes-$(DIOGENESVERSION).pkg.tar.xz