summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-28 10:33:25 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-09-28 10:38:08 -0700
commit63cc2d864fe8e5c776f3675067100a907a45b2f3 (patch)
tree06909a30521c7c8c83091f2a7206367d54d31bf4 /packaging
parent6835f03bae324d45fb5f6970beb26b781bfb8c24 (diff)
downloadsubsurface-63cc2d864fe8e5c776f3675067100a907a45b2f3.tar.gz
build-system: document how to create a Windows installer
These are the instructions that I use at this point. Removed a long obsolete script - it's been many, many years since that last was useful (it was still using qmake to try to build Subsurface) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'packaging')
-rw-r--r--packaging/windows/README.md18
-rw-r--r--packaging/windows/create-win-installer.sh27
-rwxr-xr-xpackaging/windows/mingw-make.sh75
3 files changed, 45 insertions, 75 deletions
diff --git a/packaging/windows/README.md b/packaging/windows/README.md
new file mode 100644
index 000000000..803df2c50
--- /dev/null
+++ b/packaging/windows/README.md
@@ -0,0 +1,18 @@
+# Creating a Windows installer
+
+The scripts here help with cross building Subsurface and smtk2ssrf for Windows.
+
+The preferred method to create a Windows installer is to use our own docker
+image that has all the build components pre-assembled.
+All it takes is this:
+
+```
+cd /some/path/windows
+git clone git://github.com/subsurface/subsurface
+cd subsurface
+git submodule init
+git submodule update
+docker run -v /some/path/windows:/__w subsurface/mxe-build-container:1.1 /bin/bash /__w/subsurface/packaging/windows/create-win-installer.sh
+```
+
+This will result in subsurface-VERSION.exe and smtk2ssrf-VERSION.exe to be created.
diff --git a/packaging/windows/create-win-installer.sh b/packaging/windows/create-win-installer.sh
new file mode 100644
index 000000000..e5e5c946e
--- /dev/null
+++ b/packaging/windows/create-win-installer.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# this is run inside the docker container
+cd /__w
+
+[ ! -d mxe ] || ln -s /win/mxe .
+
+# prep the container
+bash subsurface/.github/workflows/scripts/windows-container-prep.sh
+
+# remove artifact from prior builds
+rm mdbtools/include/mdbver.h
+
+# build the installer
+rm -rf win32
+mkdir win32
+cd win32
+
+# build Subsurface and then smtk2ssrf
+export MXEBUILDTYPE=i686-w64-mingw32.shared
+bash -ex ../subsurface/packaging/windows/mxe-based-build.sh installer
+mv subsurface/subsurface-*.exe /__w
+
+bash -ex ../subsurface/packaging/windows/smtk2ssrf-mxe-build.sh -a -i
+
+mv smtk-import/smtk2ssrf*.exe /__w
+
diff --git a/packaging/windows/mingw-make.sh b/packaging/windows/mingw-make.sh
deleted file mode 100755
index a1cdde42a..000000000
--- a/packaging/windows/mingw-make.sh
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/bin/sh
-#
-# just a small shell script that is used to invoke make with the right
-# parameters to cross compile a binary for Windows
-#
-# the paths work for the default mingw32 install on Fedora - adjust as
-# necessary
-# this assumes that local cross builds for libdivecomputer and libgit2
-# are in ../libdivecomputer and ../libgit2
-
-# force recreation of the nsi file and Subsurface version header file
-# in order to get the correct version number
-BASEDIR=$(dirname $0)
-rm $BASEDIR/subsurface.nsi > /dev/null 2>&1
-rm $BASEDIR/../../ssrf-version.h > /dev/null 2>&1
-
-if [[ $1 == "Qt5-64" ]] ; then
- export PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH
- MINGW_MAKE="mingw64-make"
-else
- export PATH=/usr/i686-w64-mingw32/sys-root/mingw/bin:$PATH
- MINGW_MAKE="mingw32-make"
-fi
-export objdump=mingw-objdump
-
-if [[ $1 == "Qt5-64" ]] ; then
- shift
- mingw64-qmake-qt5 \
- CROSS_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw \
- QMAKE_LRELEASE=/usr/x86_64-w64-mingw32/bin/qt5/lrelease \
- QMAKE_MOC=/usr/x86_64-w64-mingw32/bin/qt5/moc \
- QMAKE_UIC=/usr/x86_64-w64-mingw32/bin/qt5/uic \
- QMAKE_RCC=/usr/x86_64-w64-mingw32/bin/qt5/rcc \
- LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
- QMAKE_LIBDIR+=../openssl \
- CONFIG+=win64target \
- CONFIG+=brokenQt532win \
- $BASEDIR/../../subsurface.pro
-
-elif [[ $1 == "Qt5" ]] ; then
- shift
- mingw32-qmake-qt5 \
- CROSS_PATH=/usr/i686-w64-mingw32/sys-root/mingw \
- QMAKE_LRELEASE=/usr/i686-w64-mingw32/bin/qt5/lrelease \
- QMAKE_MOC=/usr/i686-w64-mingw32/bin/qt5/moc \
- QMAKE_UIC=/usr/i686-w64-mingw32/bin/qt5/uic \
- QMAKE_RCC=/usr/i686-w64-mingw32/bin/qt5/rcc \
- LIBDCDEVEL=../libdivecomputer \
- LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
- $BASEDIR/../../subsurface.pro
-
-elif [[ $1 == "Qt5debug" ]] ; then
- shift
- mingw32-qmake-qt5 \
- CROSS_PATH=/usr/i686-w64-mingw32/sys-root/mingw \
- QMAKE_LRELEASE=/usr/i686-w64-mingw32/bin/qt5/lrelease \
- QMAKE_MOC=/usr/i686-w64-mingw32/bin/qt5/moc \
- QMAKE_UIC=/usr/i686-w64-mingw32/bin/qt5/uic \
- QMAKE_RCC=/usr/i686-w64-mingw32/bin/qt5/rcc \
- QMAKE_CFLAGS_RELEASE='$$QMAKE_CFLAGS_DEBUG -O0 -g' \
- QMAKE_CXXFLAGS_RELEASE='$$QMAKE_CXXFLAGS_DEBUG -O0 -g' \
- LIBDCDEVEL=../libdivecomputer \
- LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
- V=1 \
- $BASEDIR/../../subsurface.pro
-
-else
-
- mingw32-qmake-qt4 \
- CROSS_PATH=/usr/i686-w64-mingw32/sys-root/mingw \
- LIBGIT2DEVEL=../libgit2 CONFIG+=libgit21-api \
- $BASEDIR/../../subsurface.pro
-fi
-
-$MINGW_MAKE $@