summaryrefslogtreecommitdiff
path: root/apps/plugins/puzzles/src/Buildscr
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2017-04-29 18:21:56 -0400
committerFranklin Wei <git@fwei.tk>2017-04-29 18:24:42 -0400
commit881746789a489fad85aae8317555f73dbe261556 (patch)
treecec2946362c4698c8db3c10f3242ef546c2c22dd /apps/plugins/puzzles/src/Buildscr
parent03dd4b92be7dcd5c8ab06da3810887060e06abd5 (diff)
downloadrockbox-881746789a489fad85aae8317555f73dbe261556.tar.gz
rockbox-881746789a489fad85aae8317555f73dbe261556.zip
puzzles: refactor and resync with upstream
This brings puzzles up-to-date with upstream revision 2d333750272c3967cfd5cd3677572cddeaad5932, though certain changes made by me, including cursor-only Untangle and some compilation fixes remain. Upstream code has been moved to its separate subdirectory and future syncs can be done by simply copying over the new sources. Change-Id: Ia6506ca5f78c3627165ea6791d38db414ace0804
Diffstat (limited to 'apps/plugins/puzzles/src/Buildscr')
-rw-r--r--apps/plugins/puzzles/src/Buildscr194
1 files changed, 194 insertions, 0 deletions
diff --git a/apps/plugins/puzzles/src/Buildscr b/apps/plugins/puzzles/src/Buildscr
new file mode 100644
index 0000000000..910981f079
--- /dev/null
+++ b/apps/plugins/puzzles/src/Buildscr
@@ -0,0 +1,194 @@
1# -*- sh -*-
2# Build script to build Puzzles.
3
4module puzzles
5
6set Version $(!builddate).$(vcsid)
7
8# Start by substituting the right version number in configure.ac.
9in puzzles do perl -i~ -pe 's/6.66/$(Version)/' configure.ac
10in puzzles do rm configure.ac~
11
12# And put it into the documentation as a versionid.
13# use perl to avoid inconsistent behaviour of echo '\v'
14in puzzles do perl -e 'print "\n\\versionid Simon Tatham'\''s Portable Puzzle Collection, version $$ARGV[0]\n"' $(Version) >> puzzles.but
15in puzzles do perl -e 'print "\n\\versionid Simon Tatham'\''s Portable Puzzle Collection, version $$ARGV[0]\n"' $(Version) >> devel.but
16
17# Write out a version.h that contains the real version number.
18in puzzles do echo '/* Generated by automated build script */' > version.h
19in puzzles do echo '$#define VER "Version $(Version)"' >> version.h
20
21# And do the same substitution in the OS X metadata. (This is a bit
22# icky in principle because it presumes that my version numbers don't
23# need XML escaping, but frankly, if they ever do then I should fix
24# them!)
25in puzzles do perl -i -pe 's/Unidentified build/$(Version)/' osx-info.plist
26
27# First build some local binaries, to run the icon build.
28in puzzles do perl mkfiles.pl -U
29in puzzles do make
30
31# Now build the screenshots and icons.
32in puzzles/icons do xvfb-run -s "-screen 0 1024x768x24" make web winicons gtkicons
33
34# Destroy the local binaries and autoconf detritus, mostly to avoid
35# wasting network bandwidth by transferring them to the delegate
36# servers.
37in puzzles do make distclean
38
39# Re-run mkfiles.pl now that it knows the icons are there.
40in puzzles do perl mkfiles.pl
41
42# Rebuild the configure script.
43in puzzles do ./mkauto.sh
44
45# Build the OS X .dmg archive.
46delegate osx
47 in puzzles do make -f Makefile.osx clean
48 in puzzles do make -f Makefile.osx release VER=-DVER=$(Version)
49 return puzzles/Puzzles.dmg
50enddelegate
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 chm
55in puzzles do make -f Makefile.doc # build help file for installer
56in puzzles do mason.pl --args '{"version":"$(Version)","descfile":"gamedesc.txt"}' winwix.mc > puzzles.wxs
57in puzzles do perl winiss.pl $(Version) gamedesc.txt > puzzles.iss
58delegate windows
59 # Ignore the poorly controlled return value from HHC, and instead
60 # just test that the output file was generated.
61 in puzzles with htmlhelp do/win hhc puzzles.hhp & type puzzles.chm >nul
62 # FIXME: Cygwin alternative?
63 in puzzles with visualstudio do/win nmake -f Makefile.vc clean
64 in puzzles with visualstudio do/win nmake -f Makefile.vc VER=-DVER=$(Version)
65 # Code-sign the binaries, if the local bob config provides a script
66 # to do so. We assume here that the script accepts an -i option to
67 # provide a 'more info' URL, and an optional -n option to provide a
68 # program name, and that it can take multiple .exe filename
69 # arguments and sign them all in place.
70 ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ *.exe
71 # Build installers.
72 in puzzles with wix do/win candle puzzles.wxs && light -ext WixUIExtension -sval puzzles.wixobj
73 in puzzles with innosetup do/win iscc puzzles.iss
74 ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i http://www.chiark.greenend.org.uk/~sgtatham/puzzles/ -n "Simon Tatham's Portable Puzzle Collection Installer" puzzles.msi Output/installer.exe
75 return puzzles/puzzles.chm
76 return puzzles/*.exe
77 return puzzles/Output/installer.exe
78 return puzzles/puzzles.msi
79enddelegate
80in puzzles do chmod +x *.exe
81
82# Build the Pocket PC binaries and CAB.
83#
84# NOTE: This part of the build script requires the Windows delegate
85# server to have the cabwiz program on its PATH. This will
86# typically be at
87#
88# C:\Program Files\Windows CE Tools\WCE420\POCKET PC 2003\Tools
89#
90# but it might not be if you've installed it somewhere else, or
91# have a different version.
92#
93# NOTE ALSO: This part of the build is commented out, for the
94# moment, because cabwiz does unhelpful things when run from within
95# a bob delegate process (or, more generally, when run from any
96# terminal-based remote login to a Windows machine, including
97# Cygwin opensshd and Windows Telnet). The symptom is that cabwiz
98# just beeps and sits there. Until I figure out how to build the
99# .cab from an automated process (and I'm willing to consider silly
100# approaches such as a third-party CAB generator), I don't think I
101# can sensibly enable this build.
102
103#in puzzles do perl wceinf.pl gamedesc.txt > puzzles.inf
104#delegate windows
105# in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce clean'
106# in puzzles do cmd /c 'wcearmv4 & nmake -f Makefile.wce VER=-DVER=$(Version)'
107# # Nasty piece of sh here which saves the return code from cabwiz,
108# # outputs its errors and/or warnings, and then propagates the
109# # return code back to bob. If only cabwiz could output to
110# # standard error LIKE EVERY OTHER COMMAND-LINE UTILITY IN THE
111# # WORLD, I wouldn't have to do this.
112# in puzzles do cat puzzles.inf
113# in puzzles do cmd /c 'wcearmv4 & bash -c cabwiz puzzles.inf /err cabwiz.err /cpu ARMV4'; a=$$?; cat cabwiz.err; exit $$a
114# return puzzles/puzzles.armv4.cab
115#enddelegate
116
117# Build the help file and the HTML docs.
118in puzzles do make -f Makefile.doc clean # remove CHM-target HTML
119in puzzles do make -f Makefile.doc # and rebuild help file...
120in puzzles do mkdir doc
121in 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
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
124
125# Move the deliver-worthy Windows binaries (those specified in
126# gamedesc.txt, which is generated by mkfiles.pl and helpfully
127# excludes the command-line auxiliary utilities such as solosolver,
128# and nullgame.exe) into a subdirectory for easy access.
129in puzzles do mkdir winbin
130in puzzles do mv `cut -f2 -d: gamedesc.txt` winbin
131
132# Make a zip file of the Windows binaries and help files.
133in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt
134
135# Create the source archive. (That writes the archive into the
136# _parent_ directory, so be careful when we deliver it.)
137in puzzles do ./makedist.sh $(Version)
138
139# Build the autogenerated pieces of the main web page.
140in puzzles do perl webpage.pl
141
142ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl -i~ -pe 'print "!srcdir unfinished/\n" if /!srcdir icons/' Recipe
143ifneq "$(JAVA_UNFINISHED)" "" in puzzles do ln -s unfinished/group.R .
144ifneq "$(JAVA_UNFINISHED)" "" in puzzles do perl mkfiles.pl
145
146# Build the Java applets.
147delegate nestedvm
148 in puzzles do make -f Makefile.nestedvm NESTEDVM="$$NESTEDVM" VER=-DVER=$(Version)
149 return puzzles/*.jar
150enddelegate
151
152# Build the Javascript applets. Since my master build machine doesn't
153# have the right dependencies installed for Emscripten, I do this by a
154# delegation.
155in puzzles do mkdir js # so we can tell output .js files from emcc*.js
156delegate emscripten
157 in puzzles do make -f Makefile.emcc OUTPREFIX=js/ clean
158 in puzzles do make -f Makefile.emcc OUTPREFIX=js/
159 return puzzles/js/*.js
160enddelegate
161
162# Set up .htaccess containing a redirect for the archive filename.
163in puzzles do echo "AddType application/octet-stream .chm" > .htaccess
164in puzzles do echo "AddType application/octet-stream .hlp" >> .htaccess
165in puzzles do echo "AddType application/octet-stream .cnt" >> .htaccess
166in . do set -- puzzles*.tar.gz; echo RedirectMatch temp '(.*/)'puzzles.tar.gz '$$1'"$$1" >> puzzles/.htaccess
167in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.msi '$$1'puzzles-$(Version)-installer.msi >> .htaccess
168in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.exe '$$1'puzzles-$(Version)-installer.exe >> .htaccess
169
170# Phew, we're done. Deliver everything!
171deliver puzzles/icons/*-web.png $@
172deliver puzzles/winbin/*.exe $@
173deliver puzzles/.htaccess $@
174deliver puzzles/doc/*.html doc/$@
175deliver puzzles/devel/*.html devel/$@
176deliver puzzles/Puzzles.dmg $@
177deliver puzzles/puzzles.chm $@
178deliver puzzles/puzzles.hlp $@
179deliver puzzles/puzzles.cnt $@
180deliver puzzles/puzzles.zip $@
181deliver puzzles/puzzles.msi puzzles-$(Version)-installer.msi
182deliver puzzles/Output/installer.exe puzzles-$(Version)-installer.exe
183deliver puzzles/*.jar java/$@
184deliver puzzles/js/*.js js/$@
185deliver puzzles/html/*.html html/$@
186deliver puzzles/html/*.pl html/$@
187deliver puzzles/wwwspans.html $@
188deliver puzzles/wwwlinks.html $@
189
190# deliver puzzles/puzzles.armv4.cab $@ # (not built at the moment)
191
192# This one isn't in the puzzles subdir, because makedist.sh left it
193# one level up.
194deliver puzzles*.tar.gz $@