diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2020-10-30 14:14:28 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2020-10-30 16:36:08 -0700 |
commit | 20d97f7bff723c44f62248648abd29325bcb3fed (patch) | |
tree | 532117543612871abdb51c55e82aab4d45d2e8e3 /packaging/windows | |
parent | f425bbbde3ce775962db4ee71a3e6cd1431cd49a (diff) | |
download | subsurface-20d97f7bff723c44f62248648abd29325bcb3fed.tar.gz |
build-system: enable both 32 & 64 bit Windows builds
The 32bit build won't include libmtp and therefore won't support the Garmin
Descent Mk2/Mk2i.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'packaging/windows')
-rw-r--r-- | packaging/windows/create-win-installer.sh | 22 | ||||
-rwxr-xr-x | packaging/windows/mxe-based-build.sh | 44 |
2 files changed, 43 insertions, 23 deletions
diff --git a/packaging/windows/create-win-installer.sh b/packaging/windows/create-win-installer.sh index f8d95f156..c9f9f87f5 100644 --- a/packaging/windows/create-win-installer.sh +++ b/packaging/windows/create-win-installer.sh @@ -5,13 +5,18 @@ cd /__w [ ! -d mxe ] || ln -s /win/mxe . +# grab the version number +cd subsurface +VERSION=$(./scripts/get-version linux) +cd .. + # prep the container bash subsurface/.github/workflows/scripts/windows-container-prep.sh # remove artifact from prior builds rm -f mdbtools/include/mdbver.h -# build the installer +# build the 64bit installer rm -rf win64 mkdir win64 cd win64 @@ -20,9 +25,20 @@ cd win64 export MXEBUILDTYPE=x86_64-w64-mingw32.shared export PATH=/win/mxe/usr/bin:$PATH bash -ex ../subsurface/packaging/windows/mxe-based-build.sh installer -mv subsurface/subsurface-*.exe /__w +mv subsurface/subsurface-$VERSION.exe /__w bash -ex ../subsurface/packaging/windows/smtk2ssrf-mxe-build.sh -a -i -mv smtk-import/smtk2ssrf*.exe /__w +mv smtk-import/smtk2ssrf-$VERSION.exe /__w + +# build the 32bit installer +cd /__w +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-$VERSION.exe /__w/subsurface-32bit-$VERSION.exe diff --git a/packaging/windows/mxe-based-build.sh b/packaging/windows/mxe-based-build.sh index cb2e65beb..4b71d03af 100755 --- a/packaging/windows/mxe-based-build.sh +++ b/packaging/windows/mxe-based-build.sh @@ -1,6 +1,6 @@ #!/bin/bash -e -# build Subsurface for Win32 +# build Subsurface for Windows # # this file assumes that you have installed MXE on your system # and installed a number of dependencies as well. @@ -153,26 +153,30 @@ if [ ! -f libdivecomputer/configure ] ; then autoreconf --install fi -# build libmtp as that isn't available via MXE -cd "$BUILDDIR" -if [[ ! -d libmtp || -f build.libmtp ]] ; then - rm -f build.libmtp - cd "$BASEDIR/libmtp" - export NOCONFIGURE=1 - # crudely disable the interactive part of autogen.sh - sed --in-place=.bak 's/read IN/IN="N"/;s/echo "Auto/#echo "Auto/' autogen.sh - bash autogen.sh - mv autogen.sh.bak autogen.sh +# if this is a 64bit build then build libmtp as that isn't available via MXE +# for 32bit builds the library currently fails to build, so support for +# MTP devices (right now just the Garmin Descent Mk2/Mk2i) is not available on 32bit Windows +if [ "$MXEBUILDTYPE" = "x86_64-w64-mingw32.shared" ] ; then cd "$BUILDDIR" - mkdir -p libmtp - cd libmtp - "$BASEDIR"/libmtp/configure \ - CC="$MXEBUILDTYPE"-gcc \ - --host="$MXEBUILDTYPE" \ - --enable-shared \ - --prefix="$BASEDIR"/"$MXEDIR"/usr/"$MXEBUILDTYPE" - make $JOBS - make install + if [[ ! -d libmtp || -f build.libmtp ]] ; then + rm -f build.libmtp + cd "$BASEDIR/libmtp" + export NOCONFIGURE=1 + # crudely disable the interactive part of autogen.sh + sed --in-place=.bak 's/read IN/IN="N"/;s/echo "Auto/#echo "Auto/' autogen.sh + bash autogen.sh + mv autogen.sh.bak autogen.sh + cd "$BUILDDIR" + mkdir -p libmtp + cd libmtp + "$BASEDIR"/libmtp/configure \ + CC="$MXEBUILDTYPE"-gcc \ + --host="$MXEBUILDTYPE" \ + --enable-shared \ + --prefix="$BASEDIR"/"$MXEDIR"/usr/"$MXEBUILDTYPE" + make $JOBS + make install + fi fi cd "$BUILDDIR" |