# These tests seem to fail due to wine failing to start; setting as XFAIL
# since these never run before this patch set.
- make VERBOSE=1 -j4 check XFAIL_TESTS="sigterm dtls-psk"
-# Build NSIS installer
- - SYSROOT=/usr/i686-w64-mingw32/sys-root
- - VERSION=$(cut -f2 -d\" version.c)
- - PROD_VERSION=$(echo "$VERSION" | perl -ne 'm|v(\d+)\.(\d+)(?:\-(\d+)-g.+)|; print "$1.$2." . ($3 or "0") . ".0"') # only X.Y.Z.W is allowed
- - make -C www update && mv public docs
- - curl "https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js" > vpnc-script-win.js
- - ln -bs .libs/openconnect.exe .libs/libopenconnect-5.dll $SYSROOT/mingw/{bin,lib}/*.dll .
- - PATH="$PATH:$PWD" nsiswrapper --name OpenConnect --outfile openconnect-installer.exe $PWD/openconnect.exe $PWD/docs $PWD/vpnc-script-win.js > openconnect.nsi
- - >
- makensis -X"SetCompressor /FINAL lzma" -X'VIAddVersionKey ProductName "OpenConnect"'
- -X"VIProductVersion \"$PROD_VERSION\"" -X"VIAddVersionKey ProductVersion \"$VERSION\""
- -X'VIAddVersionKey Comments "OpenConnect multi-protocol VPN client for Windows (command-line version) built with GnuTLS. For more information, visit https://openconnect.gitlab.io/openconnect"'
- openconnect.nsi
+ - ./make-windows-installer.sh
tags:
- shared
except:
when: always
paths:
- tests/*.log
- - openconnect.nsi
- - openconnect-installer.exe
+ - nsis/openconnect.nsi
+ - nsis/openconnect-installer.exe
MinGW32/OpenSSL:
script:
# These tests seem to fail due to wine failing to start; setting as XFAIL
# since these never run before this patch set.
- make VERBOSE=1 -j4 check XFAIL_TESTS="sigterm dtls-psk"
-# Build NSIS installer
- - SYSROOT=/usr/i686-w64-mingw32/sys-root
- - VERSION=$(cut -f2 -d\" version.c)
- - PROD_VERSION=$(echo "$VERSION" | perl -ne 'm|v(\d+)\.(\d+)(?:\-(\d+)-g.+)|; print "$1.$2." . ($3 or "0") . ".0"') # only X.Y.Z.W is allowed
- - make -C www update && mv public docs
- - curl "https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js" > vpnc-script-win.js
- - ln -bs .libs/openconnect.exe .libs/libopenconnect-5.dll $SYSROOT/mingw/{bin,lib}/*.dll .
- - PATH="$PATH:$PWD" nsiswrapper --name OpenConnect --outfile openconnect-installer.exe $PWD/openconnect.exe $PWD/docs $PWD/vpnc-script-win.js > openconnect.nsi
- - >
- makensis -X"SetCompressor /FINAL lzma" -X'VIAddVersionKey ProductName "OpenConnect"'
- -X"VIProductVersion \"$PROD_VERSION\"" -X"VIAddVersionKey ProductVersion \"$VERSION\""
- -X'VIAddVersionKey Comments "OpenConnect multi-protocol VPN client for Windows (command-line version) built with OpenSSL. For more information, visit https://openconnect.gitlab.io/openconnect"'
- openconnect.nsi
+ - ./make-windows-installer.sh
tags:
- shared
except:
when: always
paths:
- tests/*.log
- - openconnect.nsi
- - openconnect-installer.exe
+ - nsis/openconnect.nsi
+ - nsis/openconnect-installer.exe
MinGW64/GnuTLS:
script:
--- /dev/null
+#!/bin/bash
+#
+# Copyright (C) 2021 Daniel Lenski
+#
+# This builds a Windows installer for OpenConnect using the Fedora nsiswrapper
+# program from https://fedoraproject.org/wiki/MinGW, which in turn depends on
+# NSIS (https://nsis.sourceforge.io).
+#
+# This script should be run *after* successfully cross-building openconnect.exe
+# and libopenconnect-5.dll.
+
+set -e
+
+SYSROOT=/usr/i686-w64-mingw32/sys-root
+
+# only X.Y.Z.W is allowed for the installer's "product version" property
+VERSION=$(cut -f2 -d\" version.c)
+PROD_VERSION=$(echo "$VERSION" | perl -ne 'm|v(\d+)\.(\d+)(?:\-(\d+)-g.+)|; print "$1.$2." . ($3 or "0") . ".0"')
+
+if egrep -q '^#define OPENCONNECT_GNUTLS' config.h; then
+ TLS_LIBRARY=GnuTLS
+elif egrep -q '^#define OPENCONNECT_OPENSSL' config.h; then
+ TLS_LIBRARY=OpenSSL
+else
+ TLS_LIBRARY="Unknown TLS library"
+fi
+
+mkdir nsis
+cd nsis
+
+# build HTML documentation
+make -C ../www update
+ln -s ../public docs
+
+# download latest vpnc-script-win.js
+curl "https://gitlab.com/openconnect/vpnc-scripts/raw/master/vpnc-script-win.js" > vpnc-script-win.js
+
+# add symlinks to OpenConnect .exe/.dll, and all DLLs installed by package manager
+# (so that nsiswrapper can find them)
+ln -s ../.libs/openconnect.exe ../.libs/libopenconnect-5.dll $SYSROOT/mingw/{bin,lib}/*.dll .
+
+# build openconnect.nsi (input to makensis)
+PATH="$PATH:." nsiswrapper --name OpenConnect --outfile openconnect-installer.exe \
+ openconnect.exe docs vpnc-script-win.js > openconnect.nsi.in
+
+# add version information
+cat <<EOF > openconnect.nsi
+SetCompressor /FINAL lzma
+VIAddVersionKey ProductName "OpenConnect"
+VIProductVersion "$PROD_VERSION"
+VIAddVersionKey ProductVersion "$VERSION"
+VIAddVersionKey Comments "OpenConnect multi-protocol VPN client for Windows (command-line version, built with $TLS_LIBRARY). For more information, visit https://openconnect.gitlab.io/openconnect"
+EOF
+
+# build installer
+cat openconnect.nsi.in >> openconnect.nsi
+makensis openconnect.nsi