diff options
Diffstat (limited to 'apps/plugins/puzzles/src/Buildscr')
-rw-r--r-- | apps/plugins/puzzles/src/Buildscr | 216 |
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 | ||
4 | module puzzles | 8 | module puzzles |
5 | 9 | ||
@@ -24,62 +28,70 @@ in puzzles do echo '$#define VER "Version $(Version)"' >> version.h | |||
24 | # them!) | 28 | # them!) |
25 | in puzzles do perl -i -pe 's/Unidentified build/$(Version)/' osx-info.plist | 29 | in 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. | 31 | ifneq "$(NOICONS)" yes then |
28 | in puzzles do perl mkfiles.pl -U CFLAGS='-Wwrite-strings -Werror' | 32 | # First build some local binaries, to run the icon build. |
29 | in 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 |
32 | in 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 | 44 | endif |
35 | # wasting network bandwidth by transferring them to the delegate | ||
36 | # servers. | ||
37 | in 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.) | ||
40 | in puzzles do perl mkfiles.pl | 48 | in puzzles do perl mkfiles.pl |
41 | 49 | ||
42 | # Rebuild the configure script. | 50 | # Rebuild the configure script. |
43 | in puzzles do ./mkauto.sh | 51 | in puzzles do ./mkauto.sh |
44 | 52 | ||
45 | # Build the OS X .dmg archive. | 53 | ifneq "$(NOMACOS)" yes then |
46 | delegate 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) |
50 | enddelegate | 58 | return puzzles/Puzzles.dmg |
51 | |||
52 | # Build the Windows binaries and installer, and the CHM file. | ||
53 | in puzzles do make -f Makefile.doc clean | ||
54 | in puzzles do make -f Makefile.doc # build help files for installer | ||
55 | in puzzles do mason.pl --args '{"version":"$(Version)","descfile":"gamedesc.txt"}' winwix.mc > puzzles.wxs | ||
56 | in puzzles do perl winiss.pl $(Version) gamedesc.txt > puzzles.iss | ||
57 | ifneq "$(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 | ||
70 | else | ||
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 |
81 | endif | 60 | endif |
82 | in puzzles do chmod +x win32/*.exe win64/*.exe | 61 | |
62 | ifneq "$(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 | ||
94 | endif | ||
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 | |||
122 | in 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 | 134 | in 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 |
123 | in 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 | 135 | in 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 | 137 | ifneq "$(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, |
129 | in puzzles do mkdir winbin64 winbin32 | 141 | # and nullgame.exe) into a subdirectory for easy access. |
130 | in puzzles/win64 do mv `cut -f2 -d: ../gamedesc.txt` ../winbin64 | 142 | in puzzles do mkdir winbin64 winbin32 |
131 | in 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 | |
134 | in 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. |
135 | in 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 | ||
149 | endif | ||
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 | |||
145 | ifneq "$(JAVA_UNFINISHED)" "" in puzzles do ln -s unfinished/group.R . | 159 | ifneq "$(JAVA_UNFINISHED)" "" in puzzles do ln -s unfinished/group.R . |
146 | ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl mkfiles.pl | 160 | ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl mkfiles.pl |
147 | 161 | ||
148 | # Build the Java applets. | 162 | ifneq "$(NOJAVA)" yes then |
149 | delegate 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) |
152 | enddelegate | 166 | return puzzles/*.jar |
167 | enddelegate | ||
168 | endif | ||
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. |
157 | in puzzles do mkdir js # so we can tell output .js files from emcc*.js | 173 | ifneq "$(NOJS)" yes then |
158 | delegate 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) |
162 | enddelegate | 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 |
171 | in puzzles do mkdir jstest | 187 | # sure the main functionality works. |
172 | in 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 | ||
190 | endif | ||
173 | 191 | ||
174 | # Set up .htaccess containing a redirect for the archive filename. | 192 | # Set up .htaccess containing a redirect for the archive filename. |
175 | in puzzles do echo "AddType application/octet-stream .chm" > .htaccess | 193 | in 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 '$ | |||
179 | in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.msi '$$1'puzzles-$(Version)-installer.msi >> .htaccess | 197 | in 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! |
182 | deliver puzzles/icons/*-web.png $@ | 200 | ifneq "$(NOICONS)" yes then |
183 | deliver puzzles/winbin64/*.exe $@ | 201 | deliver puzzles/icons/*-web.png $@ |
184 | deliver puzzles/winbin32/*.exe w32/$@ | 202 | endif |
203 | ifneq "$(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 $@ | ||
213 | endif | ||
185 | deliver puzzles/.htaccess $@ | 214 | deliver puzzles/.htaccess $@ |
186 | deliver puzzles/doc/*.html doc/$@ | 215 | deliver puzzles/doc/*.html doc/$@ |
187 | deliver puzzles/devel/*.html devel/$@ | 216 | deliver puzzles/devel/*.html devel/$@ |
188 | deliver puzzles/Puzzles.dmg $@ | 217 | ifneq "$(NOMACOS)" yes then |
189 | deliver puzzles/puzzles.chm $@ | 218 | deliver puzzles/Puzzles.dmg $@ |
190 | deliver puzzles/puzzles.hlp $@ | 219 | endif |
191 | deliver puzzles/puzzles.cnt $@ | 220 | ifneq "$(NOJAVA)" yes then |
192 | deliver puzzles/puzzles.zip $@ | 221 | deliver puzzles/*.jar java/$@ |
193 | deliver puzzles/puzzles32.zip w32/$@ | 222 | endif |
194 | deliver puzzles/puzzles.msi puzzles-$(Version)-installer.msi | 223 | ifneq "$(NOJS)" yes then |
195 | deliver puzzles/puzzles32.msi w32/puzzles-$(Version)-32bit-installer.msi | 224 | deliver puzzles/js/*.js js/$@ |
196 | deliver puzzles/*.jar java/$@ | 225 | deliver puzzles/jstest/*.html jstest/$@ |
197 | deliver puzzles/js/*.js js/$@ | 226 | deliver puzzles/html/*.html html/$@ |
198 | deliver puzzles/jstest/*.html jstest/$@ | 227 | deliver puzzles/html/*.pl html/$@ |
199 | deliver puzzles/html/*.html html/$@ | 228 | endif |
200 | deliver puzzles/html/*.pl html/$@ | ||
201 | deliver puzzles/wwwspans.html $@ | 229 | deliver puzzles/wwwspans.html $@ |
202 | deliver puzzles/wwwlinks.html $@ | 230 | deliver puzzles/wwwlinks.html $@ |
203 | 231 | ||