aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2019-01-15 14:36:25 -0500
committerPaul Duncan <pabs@pablotron.org>2019-01-15 14:36:25 -0500
commit49ba8b03c4ebab4a28fa75cfb64694f84816b8ed (patch)
treed36873805786d10f21e91652d78398066cb5a17e
parentfaf8258720a4224ced7b9c161afdbb29946e6eb5 (diff)
downloadsok-49ba8b03c4ebab4a28fa75cfb64694f84816b8ed.tar.bz2
sok-49ba8b03c4ebab4a28fa75cfb64694f84816b8ed.zip
add src/msi/ and sok.msi custom target
-rw-r--r--meson.build24
-rw-r--r--src/msi/README.md22
-rw-r--r--src/msi/sok.wxs166
3 files changed, 209 insertions, 3 deletions
diff --git a/meson.build b/meson.build
index d9dca9d..0f515f2 100644
--- a/meson.build
+++ b/meson.build
@@ -1,9 +1,15 @@
project('sok', 'c', default_options: ['c_std=c11'])
+# MSI settings
+MSI_SDL_LIB_DIR = '/usr/local/x86_64-w64-mingw32/bin'
+
# find libm (used for SDL version)
cc = meson.get_compiler('c')
libm = cc.find_library('m', required: true)
+# find wixl (used for windows version)
+wixl = find_program('wixl', native: true, disabler: true)
+
# core source (shared across all applications)
sources = [
'src/core/sok-level-parser.c',
@@ -16,13 +22,12 @@ sources = [
# text UI
executable('text', sources + [
'src/levels/levels.c',
- 'src/text/main.c',
- 'src/text/action.c',
+ 'src/text/main.c', 'src/text/action.c',
'src/text/draw.c',
], dependencies: [])
# sdl (main) exe
-executable('sok', sources + [
+sok_exe = executable('sok', sources + [
'src/levels/levels.c',
'src/sdl/warp-buf.c',
'src/sdl/color.c',
@@ -41,6 +46,19 @@ executable('sok', sources + [
libm,
])
+# sok.msi
+custom_target('msi',
+ input: 'src/msi/sok.wxs',
+ output: 'sok.msi',
+ command: [
+ wixl,
+ '-o', '@OUTPUT@',
+ '-D', 'BUILD_DIR=.',
+ '-D', 'SDL_LIB_DIR=' + MSI_SDL_LIB_DIR,
+ '@INPUT@',
+ ]
+)
+
# sprite-packer exe
executable('sprite-packer', [
'src/sprite-packer/main.c',
diff --git a/src/msi/README.md b/src/msi/README.md
new file mode 100644
index 0000000..7d420f5
--- /dev/null
+++ b/src/msi/README.md
@@ -0,0 +1,22 @@
+Generate MSI installer for Windows.
+
+Setup:
+
+ apt-get install wixl
+
+Build (using sok.msi build target):
+
+ ninja sok.msi
+
+Dependencies:
+
+* `SDL2-devel` (from libsdl.org)
+* `SDL2_ttf-devel` (from libsdl.org)
+
+Example (generate by hand):
+
+ # generate sok.msi
+ wixl -o sok.msi \
+ -D BUILD_DIR=../../build-w64 \
+ -D SDL_LIB_DIR=/usr/local/x86_64-w64-mingw32/bin \
+ sok.wxs
diff --git a/src/msi/sok.wxs b/src/msi/sok.wxs
new file mode 100644
index 0000000..2a15cfa
--- /dev/null
+++ b/src/msi/sok.wxs
@@ -0,0 +1,166 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!--
+To build:
+ wixl -o sok.msi \
+ -D BUILD_DIR=../../build-w64 \
+ -D SDL_LIB_DIR=/usr/local/x86_64-w64-mingw32/bin \
+ sok.wxs
+
+GUIDs (wget -qO- https://www.uuidgenerator.net/api/guid/10):
+# 3626b379-ca7b-4fae-990e-b00cdeb0f2d7
+# dd702ed3-2b65-4d05-bc99-205aafbb8c37
+# ca5c1c3c-4bb5-4123-b8ff-e1228e3457eb
+# be925023-1bc1-4e05-a5bf-64b831106651
+# 29d288a3-09f7-408b-8412-8d0e6176a235
+# 8089e94a-61f3-402e-b1b4-6b7346dc96e9
+# 1e8a655d-7370-410c-95f2-2e42c41d9031
+# 67058335-6a4e-4cf0-bc34-c8cc2e2e2578
+# e9383c16-e1cb-432a-b8db-d799c8225c85
+# 58de5bfd-4962-4fbc-a2e7-01da77bd050b
+
+-->
+<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
+ <Product
+ Name='Sokoban'
+ Id='3626b379-ca7b-4fae-990e-b00cdeb0f2d7'
+ UpgradeCode='dd702ed3-2b65-4d05-bc99-205aafbb8c37'
+ Language='1033'
+ Codepage='1252'
+ Version='1.0'
+ Manufacturer='Pablotron'
+ >
+ <Package
+ Id='*'
+ Keywords='Installer'
+ Description="Pablotron Sokoban installer."
+ Comments='Pablotron sokoban.'
+ Manufacturer='Pablotron'
+ InstallerVersion='100'
+ Languages='1033'
+ Compressed='yes'
+ SummaryCodepage='1252'
+ />
+
+ <Media
+ Id='1'
+ Cabinet='sok.cab'
+ EmbedCab='yes'
+ DiskPrompt="CD-ROM #1"
+ />
+
+ <Property
+ Id='DiskPrompt'
+ Value="Pablotron Sokoban 1.0 Installation [1]"
+ />
+
+ <Directory Id='TARGETDIR' Name='SourceDir'>
+ <Directory Id='ProgramFilesFolder' Name='PFiles'>
+ <Directory Id='Pablotron' Name='Pablotron'>
+ <Directory Id='INSTALLDIR' Name='Sokoban 1.0'>
+
+ <Component
+ Id='cmp-sok-exe'
+ Guid='ca5c1c3c-4bb5-4123-b8ff-e1228e3457eb'
+ >
+ <File
+ Id='file-sok-exe'
+ Name='sok.exe'
+ DiskId='1'
+ Source='$(var.BUILD_DIR)/sok.exe'
+ KeyPath='yes'
+ />
+ </Component>
+
+ <Component
+ Id='cmp-solve-exe'
+ Guid='be925023-1bc1-4e05-a5bf-64b831106651'
+ >
+ <File
+ Id='file-solve-exe'
+ Name='solve.exe'
+ DiskId='1'
+ Source='$(var.BUILD_DIR)/solve.exe'
+ KeyPath='yes'
+ />
+ </Component>
+
+ <Component
+ Id='cmp-text-exe'
+ Guid='29d288a3-09f7-408b-8412-8d0e6176a235'
+ >
+ <File
+ Id='file-text-exe'
+ Name='text.exe'
+ DiskId='1'
+ Source='$(var.BUILD_DIR)/text.exe'
+ KeyPath='yes'
+ />
+ </Component>
+
+ <Component
+ Id='cmp-libfreetype-dll'
+ Guid='8089e94a-61f3-402e-b1b4-6b7346dc96e9'
+ >
+ <File
+ Id='file-libfreetype-6-dll'
+ Name='libfreetype-6.dll'
+ DiskId='1'
+ Source='$(var.SDL_LIB_DIR)/libfreetype-6.dll'
+ KeyPath='yes'
+ />
+ </Component>
+
+ <Component
+ Id='cmp-sdl2-ttf-dll'
+ Guid='1e8a655d-7370-410c-95f2-2e42c41d9031'
+ >
+ <File
+ Id='file-sdl2-ttf-dll'
+ Name='SDL2_ttf.dll'
+ DiskId='1'
+ Source='$(var.SDL_LIB_DIR)/SDL2_ttf.dll'
+ KeyPath='yes'
+ />
+ </Component>
+
+ <Component
+ Id='cmp-sdl2-dll'
+ Guid='67058335-6a4e-4cf0-bc34-c8cc2e2e2578'
+ >
+ <File
+ Id='file-sdl2-dll'
+ Name='SDL2.dll'
+ DiskId='1'
+ Source='$(var.SDL_LIB_DIR)/SDL2.dll'
+ KeyPath='yes'
+ />
+ </Component>
+
+ <Component
+ Id='cmp-zlib1-dll'
+ Guid='e9383c16-e1cb-432a-b8db-d799c8225c85'
+ >
+ <File
+ Id='file-zlib1-dll'
+ Name='zlib1.dll'
+ DiskId='1'
+ Source='$(var.SDL_LIB_DIR)/zlib1.dll'
+ KeyPath='yes'
+ />
+ </Component>
+ </Directory>
+ </Directory>
+ </Directory>
+ </Directory>
+
+ <Feature Id='Complete' Level='1'>
+ <ComponentRef Id='cmp-sok-exe'/>
+ <ComponentRef Id='cmp-solve-exe'/>
+ <ComponentRef Id='cmp-text-exe'/>
+ <ComponentRef Id='cmp-libfreetype-dll'/>
+ <ComponentRef Id='cmp-sdl2-ttf-dll'/>
+ <ComponentRef Id='cmp-sdl2-dll'/>
+ <ComponentRef Id='cmp-zlib1-dll'/>
+ </Feature>
+ </Product>
+</Wix>