From 3cf09c261591b939df53c5357ab471c5b3076d22 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 26 Nov 2017 20:12:15 +0000 Subject: [PATCH] Reinstate 32-bit Windows builds of Puzzles. I've built a set of 32-bit binaries, a 32-bit zip file and a 32-bit MSI, all delivered into a 'w32' output directory. --- Buildscr | 32 +++++++++++++++++++------------- mkfiles.pl | 2 +- winwix.mc | 20 +++++++++++++------- 3 files changed, 33 insertions(+), 21 deletions(-) diff --git a/Buildscr b/Buildscr index 4a54d27..b152448 100644 --- a/Buildscr +++ b/Buildscr @@ -55,30 +55,31 @@ in puzzles do make -f Makefile.doc # build help files for installer in puzzles do mason.pl --args '{"version":"$(Version)","descfile":"gamedesc.txt"}' winwix.mc > puzzles.wxs in puzzles do perl winiss.pl $(Version) gamedesc.txt > puzzles.iss ifneq "$(VISUAL_STUDIO)" "yes" then - in puzzles with clangcl64 do Platform=x64 make -f Makefile.clangcl clean - in puzzles with clangcl64 do Platform=x64 make -f Makefile.clangcl VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror' + in puzzles with clangcl64 do mkdir win64 && Platform=x64 make -f Makefile.clangcl BUILDDIR=win64/ VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror' + in puzzles with clangcl32 do mkdir win32 && Platform=x86 make -f Makefile.clangcl BUILDDIR=win32/ VER=-DVER=$(Version) XFLAGS='-Wwrite-strings -Werror' # Code-sign the binaries, if the local bob config provides a script # to do so. We assume here that the script accepts an -i option to # provide a 'more info' URL, and an optional -n option to provide a # program name, and that it can take multiple .exe filename # arguments and sign them all in place. - ifneq "$(cross_winsigncode)" "" in puzzles do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ *.exe + ifneq "$(cross_winsigncode)" "" in puzzles do $(cross_winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ win64/*.exe win32/*.exe # Build installers. - in puzzles with wixonlinux do candle -arch x64 puzzles.wxs && light -ext WixUIExtension -sval puzzles.wixobj - 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 + in puzzles with wixonlinux do candle -arch x64 puzzles.wxs -dWin64=yes -dBindir=win64/ && light -ext WixUIExtension -sval puzzles.wixobj + in puzzles with wixonlinux do candle -arch x86 puzzles.wxs -dWin64=no -dBindir=win32/ && light -ext WixUIExtension -sval puzzles.wixobj -o puzzles32.msi + 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 else delegate windows in puzzles with visualstudio do/win nmake -f Makefile.vc clean in puzzles with visualstudio do/win nmake -f Makefile.vc VER=-DVER=$(Version) - ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ *.exe + ifneq "$(winsigncode)" "" in puzzles do $(winsigncode) -i https://www.chiark.greenend.org.uk/~sgtatham/puzzles/ win64/*.exe # Build installers. - in puzzles with wix do/win candle puzzles.wxs && light -ext WixUIExtension -sval puzzles.wixobj + in puzzles with wix do/win candle puzzles.wxs -dWin64=yes -dBindir=win64/ && light -ext WixUIExtension -sval puzzles.wixobj in puzzles with innosetup do/win iscc puzzles.iss - return puzzles/*.exe + return puzzles/win64/*.exe return puzzles/puzzles.msi enddelegate endif -in puzzles do chmod +x *.exe +in puzzles do chmod +x win32/*.exe win64/*.exe # Build the Pocket PC binaries and CAB. # @@ -125,11 +126,13 @@ in puzzles/devel do halibut --html -Chtml-contents-filename:index.html -Chtml-in # gamedesc.txt, which is generated by mkfiles.pl and helpfully # excludes the command-line auxiliary utilities such as solosolver, # and nullgame.exe) into a subdirectory for easy access. -in puzzles do mkdir winbin -in puzzles do mv `cut -f2 -d: gamedesc.txt` winbin +in puzzles do mkdir winbin64 winbin32 +in puzzles/win64 do mv `cut -f2 -d: ../gamedesc.txt` ../winbin64 +in puzzles/win32 do mv `cut -f2 -d: ../gamedesc.txt` ../winbin32 # Make a zip file of the Windows binaries and help files. -in puzzles do zip -j puzzles.zip winbin/*.exe puzzles.chm puzzles.hlp puzzles.cnt +in puzzles do zip -j puzzles.zip winbin64/*.exe puzzles.chm puzzles.hlp puzzles.cnt +in puzzles do zip -j puzzles32.zip winbin32/*.exe puzzles.chm puzzles.hlp puzzles.cnt # Create the source archive. (That writes the archive into the # _parent_ directory, so be careful when we deliver it.) @@ -177,7 +180,8 @@ in puzzles do echo RedirectMatch temp '(.*/)'puzzles-installer.msi '$$1'puzzles- # Phew, we're done. Deliver everything! deliver puzzles/icons/*-web.png $@ -deliver puzzles/winbin/*.exe $@ +deliver puzzles/winbin64/*.exe $@ +deliver puzzles/winbin32/*.exe w32/$@ deliver puzzles/.htaccess $@ deliver puzzles/doc/*.html doc/$@ deliver puzzles/devel/*.html devel/$@ @@ -186,7 +190,9 @@ deliver puzzles/puzzles.chm $@ deliver puzzles/puzzles.hlp $@ deliver puzzles/puzzles.cnt $@ deliver puzzles/puzzles.zip $@ +deliver puzzles/puzzles32.zip w32/$@ deliver puzzles/puzzles.msi puzzles-$(Version)-installer.msi +deliver puzzles/puzzles32.msi w32/puzzles-$(Version)-32bit-installer.msi deliver puzzles/*.jar java/$@ deliver puzzles/js/*.js js/$@ deliver puzzles/jstest/*.html jstest/$@ diff --git a/mkfiles.pl b/mkfiles.pl index c0874ae..20fd7e0 100755 --- a/mkfiles.pl +++ b/mkfiles.pl @@ -638,7 +638,7 @@ if (defined $makefiles{'clangcl'}) { print "\t\$(RC) \$(RCFLAGS) ".$d->{deps}->[0]." -o ".$d->{obj}."\n\n"; } else { $deflist = join "", map { " /D$_" } @{$d->{defs}}; - print "\t\$(CC) /Fo\$(BUILDDIR)".$d->{obj}." \$(COMPAT) \$(CFLAGS) \$(XFLAGS)$deflist /c \$<\n\n"; + print "\t\$(CC) /Fo".$d->{obj}." \$(COMPAT) \$(CFLAGS) \$(XFLAGS)$deflist /c \$<\n\n"; } } print "\nclean:\n". diff --git a/winwix.mc b/winwix.mc index 4a72c09..58dbdbe 100644 --- a/winwix.mc +++ b/winwix.mc @@ -12,6 +12,12 @@ has 'descfile' => (required => 1); + + + + + + % # Product tag. The Id component is set to "*", which causes WiX to @@ -61,7 +67,7 @@ has 'descfile' => (required => 1); % # (individual files or shortcuts or additions to PATH) that are % # installed. - + % # The following components all install things in the main @@ -71,12 +77,12 @@ has 'descfile' => (required => 1); % # the more obscure things like LICENCE are just there for % # the sake of being _somewhere_ and don't rate a shortcut. -<%method file_component ($filename, $shortcutname)> +<%method file_component ($prefix, $filename, $shortcutname)> % my $filename_id = file_component_name($filename); + Source="<% $prefix %><% $filename %>" KeyPath="yes"> % if (defined $shortcutname) { (required => 1); % for my $exe (@exes) { -<% $.file_component($exe, $names{$exe}) %> +<% $.file_component('$(var.Bindir)', $exe, $names{$exe}) %> % } -<% $.file_component("puzzles.chm", "Puzzles Manual") %> -<% $.file_component("website.url", "Puzzles Web Site") %> -<% $.file_component("LICENCE") %> +<% $.file_component('', "puzzles.chm", "Puzzles Manual") %> +<% $.file_component('', "website.url", "Puzzles Web Site") %> +<% $.file_component('', "LICENCE") %>