mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Travis: also build an MXE/Windows installer
In the process, simplify our dependency a bit by no longer building against libssh2 (we don't support ssh based authentication for git on Windows) and libcurl (since it's proxy implementation doesn't appear to actually work on Windows, anyway). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
a157fa5c67
commit
4d04f74312
5 changed files with 118 additions and 61 deletions
|
@ -1,6 +1,12 @@
|
|||
|
||||
matrix:
|
||||
include:
|
||||
- env: SUBSURFACE_PLATFORM='windows'
|
||||
os: linux
|
||||
dist: trusty
|
||||
sudo: required
|
||||
language: c++
|
||||
|
||||
- env: SUBSURFACE_PLATFORM='linux'
|
||||
os: linux
|
||||
dist: trusty
|
||||
|
|
|
@ -41,8 +41,6 @@
|
|||
#
|
||||
# ~/src/mxe <- MXE git with Qt5, automake (see above)
|
||||
# /grantlee <- Grantlee 5.0.0 sources from git
|
||||
# /libssh2 <- from git - v1.6 seems to work
|
||||
# /libcurl <- from git - 7.42.1 seems to work - rename folder!
|
||||
# /subsurface <- current subsurface git
|
||||
# /libdivecomputer <- appropriate libdc/Subsurface-branch branch
|
||||
# /libgit2 <- libgit2 0.23.1 or similar
|
||||
|
@ -132,7 +130,7 @@ if [[ ! -d grantlee || -f build.grantlee ]] ; then
|
|||
rm -f build.grantlee
|
||||
mkdir -p grantlee
|
||||
cd grantlee
|
||||
i686-w64-mingw32.shared-cmake -DCMAKE_TOOLCHAIN_FILE="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/share/cmake/mxe-conf.cmake \
|
||||
i686-w64-mingw32.shared-cmake \
|
||||
-DCMAKE_BUILD_TYPE=$RELEASE \
|
||||
-DBUILD_TESTS=OFF \
|
||||
"$BASEDIR"/grantlee
|
||||
|
@ -141,61 +139,6 @@ if [[ ! -d grantlee || -f build.grantlee ]] ; then
|
|||
make install
|
||||
fi
|
||||
|
||||
|
||||
# libssh2:
|
||||
|
||||
cd "$BUILDDIR"
|
||||
if [[ ! -d libssh2 || -f build.libssh2 ]] ; then
|
||||
rm -f build.libssh2
|
||||
mkdir -p libssh2
|
||||
cd libssh2
|
||||
|
||||
i686-w64-mingw32.shared-cmake -DCMAKE_TOOLCHAIN_FILE="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/share/cmake/mxe-conf.cmake \
|
||||
-DCMAKE_BUILD_TYPE=$RELEASE \
|
||||
-DBUILD_EXAMPLES=OFF \
|
||||
-DBUILD_TESTING=OFF \
|
||||
-DBUILD_SHARED_LIBS=ON \
|
||||
"$BASEDIR"/libssh2
|
||||
make $JOBS
|
||||
make install
|
||||
# don't install your dlls in bin, please
|
||||
cp "$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/bin/libssh2.dll "$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/lib
|
||||
fi
|
||||
|
||||
|
||||
# libcurl
|
||||
|
||||
cd "$BUILDDIR"
|
||||
if [[ ! -d libcurl || -f build.libcurl ]] ; then
|
||||
rm -f build.libcurl
|
||||
mkdir -p libcurl
|
||||
cd libcurl
|
||||
../../libcurl/configure --host=i686-w64-mingw32.shared \
|
||||
--prefix="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/ \
|
||||
--disable-ftp \
|
||||
--disable-ldap \
|
||||
--disable-ldaps \
|
||||
--disable-rtsp \
|
||||
--enable-proxy \
|
||||
--enable-dict \
|
||||
--disable-telnet \
|
||||
--disable-tftp \
|
||||
--disable-pop3 \
|
||||
--disable-imap \
|
||||
--disable-smb \
|
||||
--disable-smtp \
|
||||
--disable-gopher \
|
||||
--disable-manual \
|
||||
--with-libssh2="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/
|
||||
|
||||
# now remove building the executable
|
||||
sed -i 's/SUBDIRS = lib src include/SUBDIRS = lib include/' Makefile
|
||||
|
||||
make $JOBS
|
||||
make install
|
||||
fi
|
||||
|
||||
|
||||
# libgit2:
|
||||
|
||||
cd "$BUILDDIR"
|
||||
|
@ -203,7 +146,7 @@ if [[ ! -d libgit2 || -f build.libgit2 ]] ; then
|
|||
rm -f build.libgit2
|
||||
mkdir -p libgit2
|
||||
cd libgit2
|
||||
i686-w64-mingw32.shared-cmake -DCMAKE_TOOLCHAIN_FILE="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/share/cmake/mxe-conf.cmake \
|
||||
i686-w64-mingw32.shared-cmake \
|
||||
-DBUILD_CLAR=OFF -DTHREADSAFE=ON \
|
||||
-DCMAKE_BUILD_TYPE=$RELEASE \
|
||||
-DDLLTOOL="$BASEDIR"/"$MXEDIR"/usr/bin/i686-w64-mingw32.shared-dlltool \
|
||||
|
@ -228,7 +171,9 @@ if [[ ! -d libdivecomputer || -f build.libdivecomputer ]] ; then
|
|||
mkdir -p libdivecomputer
|
||||
cd libdivecomputer
|
||||
|
||||
"$BASEDIR"/libdivecomputer/configure --host=i686-w64-mingw32.shared \
|
||||
"$BASEDIR"/libdivecomputer/configure \
|
||||
CC=i686-w64-mingw32.shared-gcc \
|
||||
--host=i686-w64-mingw32.shared \
|
||||
--enable-shared \
|
||||
--prefix="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared
|
||||
make $JOBS
|
||||
|
@ -323,7 +268,7 @@ done
|
|||
|
||||
cd "$BUILDDIR"/subsurface
|
||||
|
||||
i686-w64-mingw32.shared-cmake -DCMAKE_TOOLCHAIN_FILE="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/share/cmake/mxe-conf.cmake \
|
||||
i686-w64-mingw32.shared-cmake \
|
||||
-DCMAKE_PREFIX_PATH="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/qt5 \
|
||||
-DCMAKE_BUILD_TYPE=$RELEASE \
|
||||
-DQT_TRANSLATION_DIR="$BASEDIR"/"$MXEDIR"/usr/i686-w64-mingw32.shared/qt5/translations \
|
||||
|
|
15
scripts/windows/after_success.sh
Normal file
15
scripts/windows/after_success.sh
Normal file
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ ! -z $TRAVIS_BRANCH ] && [ "$TRAVIS_BRANCH" != "master" ] ; then
|
||||
export UPLOADTOOL_SUFFIX=$TRAVIS_BRANCH
|
||||
fi
|
||||
|
||||
cd ${TRAVIS_BUILD_DIR}/../win32/subsurface
|
||||
|
||||
echo "Submitting the folloing Windows installer for continuous build release:"
|
||||
find . -name subsurface\*.exe
|
||||
|
||||
# get and run the upload script
|
||||
wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
|
||||
bash ./upload.sh subsurface*.exe
|
||||
|
79
scripts/windows/before_install.sh
Normal file
79
scripts/windows/before_install.sh
Normal file
|
@ -0,0 +1,79 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
|
||||
# Travis only pulls shallow repos. But that messes with git describe.
|
||||
# Sorry Travis, fetching the whole thing and the tags as well...
|
||||
git fetch --unshallow
|
||||
git pull --tags
|
||||
git describe
|
||||
|
||||
# grab our own custom MXE environment
|
||||
cd ${TRAVIS_BUILD_DIR}/..
|
||||
echo "Downloading prebuilt MXE environment from Subsurface-divelog.org"
|
||||
wget -q http://subsurface-divelog.org/downloads/mxe-994ad473.tar.xz
|
||||
mkdir -p mxe
|
||||
cd mxe
|
||||
tar xJf ../mxe-994ad473.tar.xz
|
||||
|
||||
# hack around path dependency - needs to be fixed
|
||||
sudo mkdir -p /data/winqt551/
|
||||
sudo ln -s ${TRAVIS_BUILD_DIR}/../mxe /data/winqt551/mxe-current
|
||||
ls -l /data/winqt551/mxe-current/usr
|
||||
|
||||
# libdivecomputer uses the wrong include path for libusb
|
||||
# the pkgconfig file for libusb already gives the include path as
|
||||
# ../include/libusb-1.0 yet libdivecomputer wants to use
|
||||
# include <libusb-1.0/libusb.h>
|
||||
cd usr/i686-w64-mingw32.shared/include/libusb-1.0
|
||||
ln -s . libusb-1.0
|
||||
cd ${TRAVIS_BUILD_DIR}/..
|
||||
|
||||
# now set up our other dependencies
|
||||
|
||||
CURRENT_LIBZIP="1.2.0"
|
||||
CURRENT_HIDAPI="hidapi-0.7.0"
|
||||
CURRENT_LIBUSB="v1.0.21"
|
||||
CURRENT_LIBGIT2="v0.26.0"
|
||||
|
||||
|
||||
#this will soon be a git submodule
|
||||
echo "Get libdivecomputer"
|
||||
cd ${TRAVIS_BUILD_DIR}/..
|
||||
git clone -b Subsurface-branch https://github.com/Subsurface-divelog/libdc.git libdivecomputer
|
||||
cd libdivecomputer
|
||||
if [ ! -f ./configure ] ; then
|
||||
autoreconf --install .
|
||||
autoreconf --install . # not a typo - somehow/sometimes libdivecomputer needs to run this twice. Don't ask.
|
||||
fi
|
||||
|
||||
echo "Get libusb"
|
||||
cd ${TRAVIS_BUILD_DIR}/..
|
||||
git clone https://github.com/libusb/libusb
|
||||
cd libusb
|
||||
if ! git checkout $CURRENT_LIBUSB ; then
|
||||
echo "Can't find the right tag in libusb - giving up"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Get libgit2"
|
||||
cd ${TRAVIS_BUILD_DIR}/..
|
||||
git clone https://github.com/libgit2/libgit2.git
|
||||
cd libgit2
|
||||
if ! git checkout $CURRENT_LIBGIT2 ; then
|
||||
echo "Can't find the right tag in libgit2 - giving up"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Get googlemaps"
|
||||
cd ${TRAVIS_BUILD_DIR}/..
|
||||
git clone https://github.com/Subsurface-divelog/googlemaps.git
|
||||
|
||||
echo "Get Grantlee"
|
||||
cd ${TRAVIS_BUILD_DIR}/..
|
||||
git clone https://github.com/steveire/grantlee.git
|
||||
cd grantlee
|
||||
if ! git checkout v5.0.0 ; then
|
||||
echo "can't check out v5.0.0 of grantlee -- giving up"
|
||||
exit 1
|
||||
fi
|
12
scripts/windows/travisbuild.sh
Normal file
12
scripts/windows/travisbuild.sh
Normal file
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# this gets executed by Travis when building an installer for Windows
|
||||
# it gets started from inside the subsurface directory
|
||||
# with all the other projects downloaded and installed in parralel to
|
||||
# subsurface; in order to be compatible with the assumed layout, we
|
||||
# need to create the secondary build directory
|
||||
cd ${TRAVIS_BUILD_DIR}/..
|
||||
mkdir win32
|
||||
ls -l
|
||||
cd win32
|
||||
bash -ex ${TRAVIS_BUILD_DIR}/packaging/windows/mxe-based-build.sh installer
|
Loading…
Add table
Reference in a new issue