Travis: cross-compile in Docker containers with mingw-w64 toolchain
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
language: cpp
|
||||
compiler: gcc
|
||||
services:
|
||||
- docker
|
||||
dist: trusty
|
||||
sudo: required
|
||||
cache:
|
||||
@@ -14,14 +16,11 @@ matrix:
|
||||
- os: osx
|
||||
osx_image: xcode8.2
|
||||
- env: QT5=True
|
||||
- env: QT5=True TARGET_OS=win32
|
||||
- env: QT5=True TARGET_OS=win64
|
||||
- os: osx
|
||||
env: QT5=True
|
||||
install: ${TRAVIS_BUILD_DIR}/.travis/install.sh
|
||||
script: ${TRAVIS_BUILD_DIR}/.travis/script.sh
|
||||
after_script: ${TRAVIS_BUILD_DIR}/.travis/after_script.sh
|
||||
before_deploy: make package
|
||||
deploy:
|
||||
provider: releases
|
||||
api_key:
|
||||
@@ -31,5 +30,5 @@ deploy:
|
||||
on:
|
||||
tags: true
|
||||
all_branches: true
|
||||
condition: '("$TARGET_OS" = win??) && "$QT5"'
|
||||
condition: '("$TARGET_OS" = win??)'
|
||||
repo: LMMS/lmms
|
||||
|
||||
17
.travis/common/windows-build.sh
Executable file
17
.travis/common/windows-build.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CPUS=$(cat /proc/cpuinfo | grep bogo | wc -l)
|
||||
|
||||
cd /lmms
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
|
||||
../cmake/build_mingw$1.sh
|
||||
|
||||
echo Building on $CPUS CPUs
|
||||
make -j$((CPUS+1))
|
||||
|
||||
make package
|
||||
|
||||
mv -v *setup.exe /lmms
|
||||
36
.travis/linux.cross.win32/Dockerfile
Normal file
36
.travis/linux.cross.win32/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
FROM ubuntu:artful
|
||||
MAINTAINER Tobias Junghans <tobydox@users.sf.net>
|
||||
|
||||
RUN \
|
||||
apt-get update && \
|
||||
apt-get install -y software-properties-common && \
|
||||
add-apt-repository -y "ppa:tobydox/mingw-w64" && \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y --force-yes \
|
||||
git \
|
||||
cmake \
|
||||
pkgconfig \
|
||||
make \
|
||||
nsis \
|
||||
tofrodos \
|
||||
qt4-linguist-tools \
|
||||
g++-mingw-w64 \
|
||||
qt5base-mingw-w64 \
|
||||
sdl-mingw-w64
|
||||
libvorbis-mingw-w64 \
|
||||
fluidsynth-mingw-w64 \
|
||||
stk-mingw-w64 \
|
||||
glib2-mingw-w64 \
|
||||
portaudio-mingw-w64 \
|
||||
libsndfile-mingw-w64 \
|
||||
fftw-mingw-w64 \
|
||||
flac-mingw-w64 \
|
||||
fltk-mingw-w64 \
|
||||
libsamplerate-mingw-w64 \
|
||||
libgig-mingw-w64 \
|
||||
libsoundio-mingw-w64 \
|
||||
lame-mingw-w64 \
|
||||
&& \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
5
.travis/linux.cross.win32/script.sh
Executable file
5
.travis/linux.cross.win32/script.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
/lmms/.travis/common/windows-build.sh 32
|
||||
|
||||
|
||||
36
.travis/linux.cross.win64/Dockerfile
Normal file
36
.travis/linux.cross.win64/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
FROM ubuntu:artful
|
||||
MAINTAINER Tobias Junghans <tobydox@users.sf.net>
|
||||
|
||||
RUN \
|
||||
apt-get update && \
|
||||
apt-get install -y software-properties-common && \
|
||||
add-apt-repository -y "ppa:tobydox/mingw-w64" && \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y --force-yes \
|
||||
git \
|
||||
cmake \
|
||||
pkgconfig \
|
||||
make \
|
||||
nsis \
|
||||
tofrodos \
|
||||
qt4-linguist-tools \
|
||||
g++-mingw-w64 \
|
||||
qt5base-mingw-w64 \
|
||||
sdl-mingw-w64
|
||||
libvorbis-mingw-w64 \
|
||||
fluidsynth-mingw-w64 \
|
||||
stk-mingw-w64 \
|
||||
glib2-mingw-w64 \
|
||||
portaudio-mingw-w64 \
|
||||
libsndfile-mingw-w64 \
|
||||
fftw-mingw-w64 \
|
||||
flac-mingw-w64 \
|
||||
fltk-mingw-w64 \
|
||||
libsamplerate-mingw-w64 \
|
||||
libgig-mingw-w64 \
|
||||
libsoundio-mingw-w64 \
|
||||
lame-mingw-w64 \
|
||||
&& \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
5
.travis/linux.cross.win64/script.sh
Executable file
5
.travis/linux.cross.win64/script.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
/lmms/.travis/common/windows-build.sh 64
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
set -e
|
||||
|
||||
sudo add-apt-repository ppa:tobydox/mingw-x-trusty -y
|
||||
sudo apt-get update -qq
|
||||
docker build -t lmms-build ${TRAVIS_BUILD_DIR}/.travis/linux.cross.win32/
|
||||
|
||||
|
||||
@@ -2,31 +2,3 @@
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$QT5" ]; then
|
||||
MINGW_PACKAGES="mingw32-x-qt5base"
|
||||
else
|
||||
MINGW_PACKAGES="mingw32-x-qt"
|
||||
fi
|
||||
|
||||
MINGW_PACKAGES="mingw32-x-sdl mingw32-x-libvorbis mingw32-x-fluidsynth mingw32-x-stk
|
||||
mingw32-x-glib2 mingw32-x-portaudio mingw32-x-libsndfile mingw32-x-fftw
|
||||
mingw32-x-flac mingw32-x-fltk mingw32-x-libsamplerate
|
||||
mingw32-x-pkgconfig mingw32-x-binutils mingw32-x-gcc mingw32-x-runtime
|
||||
mingw32-x-libgig mingw32-x-libsoundio mingw32-x-lame $MINGW_PACKAGES"
|
||||
|
||||
export MINGW_PACKAGES
|
||||
|
||||
"$TRAVIS_BUILD_DIR/.travis/linux.win.download.sh" win32
|
||||
|
||||
PACKAGES="nsis cloog-isl libmpc3 qt4-linguist-tools mingw32 $MINGW_PACKAGES"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
sudo apt-get install -y $PACKAGES
|
||||
|
||||
# ccache 3.2 is needed because mingw32-x-gcc is version 4.9, which causes cmake
|
||||
# to use @file command line passing, which in turn ccache 3.1.9 doesn't support
|
||||
pushd /tmp
|
||||
wget http://archive.ubuntu.com/ubuntu/pool/main/c/ccache/ccache_3.2.4-1_amd64.deb
|
||||
sha256sum -c "$TRAVIS_BUILD_DIR/.travis/ccache.sha256"
|
||||
sudo dpkg -i ccache_3.2.4-1_amd64.deb
|
||||
popd
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
set -e
|
||||
|
||||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
|
||||
../cmake/build_mingw32.sh
|
||||
docker run -v ${TRAVIS_BUILD_DIR}:/lmms:rw lmms-build /bin/sh /lmms/.travis/linux.cross.win32/script.sh
|
||||
|
||||
|
||||
@@ -2,4 +2,5 @@
|
||||
|
||||
set -e
|
||||
|
||||
"$TRAVIS_BUILD_DIR/.travis/linux.win32.before_install.sh"
|
||||
docker build -t lmms-build ${TRAVIS_BUILD_DIR}/.travis/linux.cross.win64/
|
||||
|
||||
|
||||
@@ -2,24 +2,3 @@
|
||||
|
||||
set -e
|
||||
|
||||
# First, install 32-bit deps
|
||||
"$TRAVIS_BUILD_DIR/.travis/linux.win32.install.sh"
|
||||
|
||||
if [ "$QT5" ]; then
|
||||
MINGW_PACKAGES="mingw64-x-qt5base"
|
||||
else
|
||||
MINGW_PACKAGES="mingw64-x-qt"
|
||||
fi
|
||||
|
||||
MINGW_PACKAGES="mingw64-x-sdl mingw64-x-libvorbis mingw64-x-fluidsynth mingw64-x-stk
|
||||
mingw64-x-glib2 mingw64-x-portaudio mingw64-x-libsndfile
|
||||
mingw64-x-fftw mingw64-x-flac mingw64-x-fltk mingw64-x-libsamplerate
|
||||
mingw64-x-pkgconfig mingw64-x-binutils mingw64-x-gcc mingw64-x-runtime
|
||||
mingw64-x-libgig mingw64-x-libsoundio mingw64-x-lame $MINGW_PACKAGES"
|
||||
|
||||
export MINGW_PACKAGES
|
||||
|
||||
"$TRAVIS_BUILD_DIR/.travis/linux.win.download.sh" win64
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
sudo apt-get install -y $MINGW_PACKAGES
|
||||
|
||||
@@ -3,4 +3,5 @@
|
||||
set -e
|
||||
|
||||
export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON"
|
||||
../cmake/build_mingw64.sh
|
||||
docker run -v ${TRAVIS_BUILD_DIR}:/lmms:rw lmms-build /bin/sh /lmms/.travis/linux.cross.win64/script.sh
|
||||
|
||||
|
||||
Reference in New Issue
Block a user