summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/Buildscr
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/puzzles/src/Buildscr')
-rw-r--r--apps/plugins/puzzles/src/Buildscr216
1 files changed, 122 insertions, 94 deletions
diff --git a/apps/plugins/puzzles/src/Buildscr b/apps/plugins/puzzles/src/Buildscr
index 1cc65fd732..b2a4dd58db 100644
--- a/apps/plugins/puzzles/src/Buildscr
+++ b/apps/plugins/puzzles/src/Buildscr
@@ -1,5 +1,9 @@
1# -*- sh -*- 1# -*- sh -*-
2# Build script to build Puzzles. 2# Build script to build Puzzles.
3#
4# You can cut out large components of the build by defining a subset
5# of these options on the bob command line:
6# -DNOSIGN -DNOWINDOWS -DNOMACOS -DNOICONS -DNOJAVA -DNOJS
3 7
4module puzzles 8module puzzles
5 9
@@ -24,62 +28,70 @@ in puzzles do echo '$#define VER "Version $(Version)"' >> version.h
24# them!) 28# them!)
25in puzzles do perl -i -pe 's/Unidentified build/$(Version)/' osx-info.plist 29in puzzles do perl -i -pe 's/Unidentified build/$(Version)/' osx-info.plist
26 30
27# First build some local binaries, to run the icon build. 31ifneq "$(NOICONS)" yes then
28in puzzles do perl mkfiles.pl -U CFLAGS='-Wwrite-strings -Werror' 32 # First build some local binaries, to run the icon build.
29in puzzles do make 33 in puzzles do perl mkfiles.pl -U CFLAGS='-Wwrite-strings -Werror'
34 in puzzles do make -j$(nproc)
35
36 # Now build the screenshots and icons.
37 in puzzles/icons do xvfb-run -s "-screen 0 1024x768x24" make web winicons gtkicons -j$(nproc)
30 38
31# Now build the screenshots and icons. 39 # Destroy the local binaries and autoconf detritus, mostly to avoid
32in puzzles/icons do xvfb-run -s "-screen 0 1024x768x24" make web winicons gtkicons 40 # wasting network bandwidth by transferring them to the delegate
41 # servers.
42 in puzzles do make distclean
33 43
34# Destroy the local binaries and autoconf detritus, mostly to avoid 44endif
35# wasting network bandwidth by transferring them to the delegate
36# servers.
37in puzzles do make distclean
38 45
39# Re-run mkfiles.pl now that it knows the icons are there. 46# Re-run mkfiles.pl now that it knows the icons are there. (Or for the
47# first time, if we didn't bother building the icons.)
40in puzzles do perl mkfiles.pl 48in puzzles do perl mkfiles.pl
41 49
42# Rebuild the configure script. 50# Rebuild the configure script.
43in puzzles do ./mkauto.sh 51in puzzles do ./mkauto.sh
44 52
45# Build the OS X .dmg archive. 53ifneq "$(NOMACOS)" yes then
46delegate osx 54 # Build the OS X .dmg archive.
47 in puzzles do make -f Makefile.osx clean 55 delegate osx
48 in puzzles do make -f Makefile.osx release VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror' 56 in puzzles do make -f Makefile.osx clean
49 return puzzles/Puzzles.dmg 57 in puzzles do make -f Makefile.osx release VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror' -j$(nproc)
50enddelegate 58 return puzzles/Puzzles.dmg
51
52# Build the Windows binaries and installer, and the CHM file.
53in puzzles do make -f Makefile.doc clean
54in puzzles do make -f Makefile.doc # build help files for installer
55in puzzles do mason.pl --args '{"version":"$(Version)","descfile":"gamedesc.txt"}' winwix.mc > puzzles.wxs
56in puzzles do perl winiss.pl $(Version) gamedesc.txt > puzzles.iss
57ifneq "$(VISUAL_STUDIO)" "yes" then
58 in puzzles with clangcl64 do mkdir win64 && Platform=x64 make -f Makefile.clangcl BUILDDIR=win64/ VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror'
59 in puzzles with clangcl32 do mkdir win32 && Platform=x86 make -f Makefile.clangcl BUILDDIR=win32/ SUBSYSVER=,5.01 VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror'
60 # Code-sign the binaries, if the local bob config provides a script
61 # to do so. We assume here that the script accepts an -i option to
62 # provide a 'more info' URL, and an optional -n option to provide a
63 # program name, and that it can take multiple .exe filename
64 # arguments and sign them all in place.
65 ifneq "$(cross_winsigncode)" "" in puzzles do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ win64/*.exe win32/*.exe
66 # Build installers.
67 in puzzles with wixonlinux do candle -arch x64 puzzles.wxs -dWin64=yes -dBindir=win64/ && light -ext WixUIExtension -sval puzzles.wixobj
68 in puzzles with wixonlinux do candle -arch x86 puzzles.wxs -dWin64=no -dBindir=win32/ && light -ext WixUIExtension -sval puzzles.wixobj -o puzzles32.msi
69 ifneq "$(cross_winsigncode)" "" in puzzles do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ -n "Simon Tatham's Portable Puzzle Collection Installer" puzzles.msi puzzles32.msi
70else
71 delegate windows
72 in puzzles with visualstudio do/win nmake -f Makefile.vc clean
73 in puzzles with visualstudio do/win nmake -f Makefile.vc VER=-DVER=$(Version)
74 ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ win64/*.exe
75 # Build installers.
76 in puzzles with wix do/win candle puzzles.wxs -dWin64=yes -dBindir=win64/ && light -ext WixUIExtension -sval puzzles.wixobj
77 in puzzles with innosetup do/win iscc puzzles.iss
78 return puzzles/win64/*.exe
79 return puzzles/puzzles.msi
80 enddelegate 59 enddelegate
81endif 60endif
82in puzzles do chmod +x win32/*.exe win64/*.exe 61
62ifneq "$(NOWINDOWS)" yes then
63 # Build the Windows binaries and installer, and the CHM file.
64 in puzzles do make -f Makefile.doc clean
65 in puzzles do make -f Makefile.doc -j$(nproc) # build help files for installer
66 in puzzles do mason.pl --args '{"version":"$(Version)","descfile":"gamedesc.txt"}' winwix.mc > puzzles.wxs
67 in puzzles do perl winiss.pl $(Version) gamedesc.txt > puzzles.iss
68 ifneq "$(VISUAL_STUDIO)" "yes" then
69 in puzzles with clangcl64 do mkdir win64 && Platform=x64 make -f Makefile.clangcl BUILDDIR=win64/ VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror' -j$(nproc)
70 in puzzles with clangcl32 do mkdir win32 && Platform=x86 make -f Makefile.clangcl BUILDDIR=win32/ SUBSYSVER=,5.01 VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror' -j$(nproc)
71 # Code-sign the binaries, if the local bob config provides a script
72 # to do so. We assume here that the script accepts an -i option to
73 # provide a 'more info' URL, and an optional -n option to provide a
74 # program name, and that it can take multiple .exe filename
75 # arguments and sign them all in place.
76 ifneq "$(cross_winsigncode)" "" in puzzles do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ win64/*.exe win32/*.exe
77 # Build installers.
78 in puzzles with wixonlinux do candle -arch x64 puzzles.wxs -dWin64=yes -dBindir=win64/ && light -ext WixUIExtension -sval puzzles.wixobj
79 in puzzles with wixonlinux do candle -arch x86 puzzles.wxs -dWin64=no -dBindir=win32/ && light -ext WixUIExtension -sval puzzles.wixobj -o puzzles32.msi
80 ifneq "$(cross_winsigncode)" "" in puzzles do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ -n "Simon Tatham's Portable Puzzle Collection Installer" puzzles.msi puzzles32.msi
81 else
82 delegate windows
83 in puzzles with visualstudio do/win nmake -f Makefile.vc clean
84 in puzzles with visualstudio do/win nmake -f Makefile.vc VER=-DVER=$(Version)
85 ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ win64/*.exe
86 # Build installers.
87 in puzzles with wix do/win candle puzzles.wxs -dWin64=yes -dBindir=win64/ && light -ext WixUIExtension -sval puzzles.wixobj
88 in puzzles with innosetup do/win iscc puzzles.iss
89 return puzzles/win64/*.exe
90 return puzzles/puzzles.msi
91 enddelegate
92 endif
93 in puzzles do chmod +x win32/*.exe win64/*.exe
94endif
83 95
84# Build the Pocket PC binaries and CAB. 96# Build the Pocket PC binaries and CAB.
85# 97#
@@ -122,17 +134,19 @@ in puzzles do mkdir devel
122in puzzles/doc do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../puzzles.but 134in puzzles/doc do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../puzzles.but
123in puzzles/devel do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../devel.but 135in puzzles/devel do halibut --html -Chtml-contents-filename:index.html -Chtml-index-filename:indexpage.html -Chtml-template-filename:%k.html -Chtml-template-fragment:%k ../devel.but
124 136
125# Move the deliver-worthy Windows binaries (those specified in 137ifneq "$(NOWINDOWS)" yes then
126# gamedesc.txt, which is generated by mkfiles.pl and helpfully 138 # Move the deliver-worthy Windows binaries (those specified in
127# excludes the command-line auxiliary utilities such as solosolver, 139 # gamedesc.txt, which is generated by mkfiles.pl and helpfully
128# and nullgame.exe) into a subdirectory for easy access. 140 # excludes the command-line auxiliary utilities such as solosolver,
129in puzzles do mkdir winbin64 winbin32 141 # and nullgame.exe) into a subdirectory for easy access.
130in puzzles/win64 do mv `cut -f2 -d: ../gamedesc.txt` ../winbin64 142 in puzzles do mkdir winbin64 winbin32
131in puzzles/win32 do mv `cut -f2 -d: ../gamedesc.txt` ../winbin32 143 in puzzles/win64 do mv `cut -f2 -d: ../gamedesc.txt` ../winbin64
132 144 in puzzles/win32 do mv `cut -f2 -d: ../gamedesc.txt` ../winbin32
133# Make a zip file of the Windows binaries and help files. 145
134in puzzles do zip -j puzzles.zip winbin64/*.exe puzzles.chm puzzles.hlp puzzles.cnt 146 # Make a zip file of the Windows binaries and help files.
135in puzzles do zip -j puzzles32.zip winbin32/*.exe puzzles.chm puzzles.hlp puzzles.cnt 147 in puzzles do zip -j puzzles.zip winbin64/*.exe puzzles.chm puzzles.hlp puzzles.cnt
148 in puzzles do zip -j puzzles32.zip winbin32/*.exe puzzles.chm puzzles.hlp puzzles.cnt
149endif
136 150
137# Create the source archive. (That writes the archive into the 151# Create the source archive. (That writes the archive into the
138# _parent_ directory, so be careful when we deliver it.) 152# _parent_ directory, so be careful when we deliver it.)
@@ -145,31 +159,35 @@ ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl -i~ -pe 'print "!srcdir unfinis
145ifneq "$(JAVA_UNFINISHED)" "" in puzzles do ln -s unfinished/group.R . 159ifneq "$(JAVA_UNFINISHED)" "" in puzzles do ln -s unfinished/group.R .
146ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl mkfiles.pl 160ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl mkfiles.pl
147 161
148# Build the Java applets. 162ifneq "$(NOJAVA)" yes then
149delegate nestedvm 163 # Build the Java applets.
150 in puzzles do make -f Makefile.nestedvm NESTEDVM="$$NESTEDVM" VER=-DVER=$(Version) XFLAGS="-Wwrite-strings -Werror" 164 delegate nestedvm
151 return puzzles/*.jar 165 in puzzles do make -f Makefile.nestedvm NESTEDVM="$$NESTEDVM" VER=-DVER=$(Version) XFLAGS="-Wwrite-strings -Werror" -j$(nproc)
152enddelegate 166 return puzzles/*.jar
167 enddelegate
168endif
153 169
154# Build the Javascript applets. Since my master build machine doesn't 170# Build the Javascript applets. Since my master build machine doesn't
155# have the right dependencies installed for Emscripten, I do this by a 171# have the right dependencies installed for Emscripten, I do this by a
156# delegation. 172# delegation.
157in puzzles do mkdir js # so we can tell output .js files from emcc*.js 173ifneq "$(NOJS)" yes then
158delegate emscripten 174 in puzzles do mkdir js # so we can tell output .js files from emcc*.js
159 in puzzles do make -f Makefile.emcc OUTPREFIX=js/ clean 175 delegate emscripten
160 in puzzles do make -f Makefile.emcc OUTPREFIX=js/ XFLAGS="-Wwrite-strings -Werror" 176 in puzzles do make -f Makefile.emcc OUTPREFIX=js/ clean
161 return puzzles/js/*.js 177 in puzzles do make -f Makefile.emcc OUTPREFIX=js/ XFLAGS="-Wwrite-strings -Werror" -j$(nproc)
162enddelegate 178 return puzzles/js/*.js
163 179 enddelegate
164# Build a set of wrapping HTML pages for easy testing of the 180
165# Javascript puzzles. These aren't quite the same as the versions that 181 # Build a set of wrapping HTML pages for easy testing of the
166# will go on my live website, because those ones will substitute in a 182 # Javascript puzzles. These aren't quite the same as the versions that
167# different footer, and not have to link to the .js files with the 183 # will go on my live website, because those ones will substitute in a
168# ../js/ prefix. But these ones should be good enough to just open 184 # different footer, and not have to link to the .js files with the
169# using a file:// URL in a browser after running a build, and make 185 # ../js/ prefix. But these ones should be good enough to just open
170# sure the main functionality works. 186 # using a file:// URL in a browser after running a build, and make
171in puzzles do mkdir jstest 187 # sure the main functionality works.
172in puzzles/jstest do ../html/jspage.pl --jspath=../js/ /dev/null ../html/*.html 188 in puzzles do mkdir jstest
189 in puzzles/jstest do ../html/jspage.pl --jspath=../js/ /dev/null ../html/*.html
190endif
173 191
174# Set up .htaccess containing a redirect for the archive filename. 192# Set up .htaccess containing a redirect for the archive filename.
175in puzzles do echo "AddType application/octet-stream .chm" > .htaccess 193in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
@@ -179,25 +197,35 @@ in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$
179in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.msi '$$1'puzzles-$(Version)-installer.msi >> .htaccess 197in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.msi '$$1'puzzles-$(Version)-installer.msi >> .htaccess
180 198
181# Phew, we're done. Deliver everything! 199# Phew, we're done. Deliver everything!
182deliver puzzles/icons/*-web.png $@ 200ifneq "$(NOICONS)" yes then
183deliver puzzles/winbin64/*.exe $@ 201 deliver puzzles/icons/*-web.png $@
184deliver puzzles/winbin32/*.exe w32/$@ 202endif
203ifneq "$(NOWINDOWS)" yes then
204 deliver puzzles/winbin64/*.exe $@
205 deliver puzzles/winbin32/*.exe w32/$@
206 deliver puzzles/puzzles.zip $@
207 deliver puzzles/puzzles32.zip w32/$@
208 deliver puzzles/puzzles.msi puzzles-$(Version)-installer.msi
209 deliver puzzles/puzzles32.msi w32/puzzles-$(Version)-32bit-installer.msi
210 deliver puzzles/puzzles.chm $@
211 deliver puzzles/puzzles.hlp $@
212 deliver puzzles/puzzles.cnt $@
213endif
185deliver puzzles/.htaccess $@ 214deliver puzzles/.htaccess $@
186deliver puzzles/doc/*.html doc/$@ 215deliver puzzles/doc/*.html doc/$@
187deliver puzzles/devel/*.html devel/$@ 216deliver puzzles/devel/*.html devel/$@
188deliver puzzles/Puzzles.dmg $@ 217ifneq "$(NOMACOS)" yes then
189deliver puzzles/puzzles.chm $@ 218 deliver puzzles/Puzzles.dmg $@
190deliver puzzles/puzzles.hlp $@ 219endif
191deliver puzzles/puzzles.cnt $@ 220ifneq "$(NOJAVA)" yes then
192deliver puzzles/puzzles.zip $@ 221 deliver puzzles/*.jar java/$@
193deliver puzzles/puzzles32.zip w32/$@ 222endif
194deliver puzzles/puzzles.msi puzzles-$(Version)-installer.msi 223ifneq "$(NOJS)" yes then
195deliver puzzles/puzzles32.msi w32/puzzles-$(Version)-32bit-installer.msi 224 deliver puzzles/js/*.js js/$@
196deliver puzzles/*.jar java/$@ 225 deliver puzzles/jstest/*.html jstest/$@
197deliver puzzles/js/*.js js/$@ 226 deliver puzzles/html/*.html html/$@
198deliver puzzles/jstest/*.html jstest/$@ 227 deliver puzzles/html/*.pl html/$@
199deliver puzzles/html/*.html html/$@ 228endif
200deliver puzzles/html/*.pl html/$@
201deliver puzzles/wwwspans.html $@ 229deliver puzzles/wwwspans.html $@
202deliver puzzles/wwwlinks.html $@ 230deliver puzzles/wwwlinks.html $@
203 231