Travis build with MinGW
This commit is contained in:
parent
c06b0e37c7
commit
d3b0cef35f
8 changed files with 72 additions and 9 deletions
|
|
@ -5,6 +5,11 @@ env:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
include:
|
include:
|
||||||
|
- os: linux
|
||||||
|
env:
|
||||||
|
- CROSS_COMPILE=mingw32
|
||||||
|
- CONTAINER=cross
|
||||||
|
|
||||||
- os: linux
|
- os: linux
|
||||||
arch: amd64
|
arch: amd64
|
||||||
dist: bionic
|
dist: bionic
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
. .travis/environment.sh
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
make install
|
buildenv make install
|
||||||
tar -zcvf "${INSTALL_DIR}.tar.gz" ${INSTALL_DIR}
|
tar -zcvf "${INSTALL_DIR}.tar.gz" ${INSTALL_DIR}
|
||||||
mv "${INSTALL_DIR}.tar.gz" ${TRAVIS_BUILD_DIR}
|
mv "${INSTALL_DIR}.tar.gz" ${TRAVIS_BUILD_DIR}
|
||||||
cd ..
|
cd ..
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,31 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
. .travis/environment.sh
|
||||||
|
|
||||||
cmake_dir="cmake-3.13.0-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}"
|
cmake_dir="cmake-3.13.0-${TRAVIS_OS_NAME}-${TRAVIS_CPU_ARCH}"
|
||||||
cmake_arc="${cmake_dir}.tar.gz"
|
cmake_arc="${cmake_dir}.tar.gz"
|
||||||
cmake_url="https://github.com/sfztools/cmake/releases/download/${TRAVIS_OS_NAME}/${cmake_arc}"
|
cmake_url="https://github.com/sfztools/cmake/releases/download/${TRAVIS_OS_NAME}/${cmake_arc}"
|
||||||
|
|
||||||
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
if [[ ${CROSS_COMPILE} == "mingw32" ]]; then
|
||||||
|
buildenv bash -c "echo Hello from container" # ensure to start the container
|
||||||
|
docker cp "$container":/etc/pacman.conf pacman.conf
|
||||||
|
cat >>pacman.conf <<EOF
|
||||||
|
[multilib]
|
||||||
|
Include = /etc/pacman.d/mirrorlist
|
||||||
|
|
||||||
|
[mingw-w64]
|
||||||
|
SigLevel = Optional TrustAll
|
||||||
|
Server = https://github.com/jpcima/arch-mingw-w64/releases/download/repo.\$arch/
|
||||||
|
EOF
|
||||||
|
docker cp pacman.conf "$container":/etc/pacman.conf
|
||||||
|
rm -f pacman.conf
|
||||||
|
elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
||||||
wget -q ${cmake_url}
|
wget -q ${cmake_url}
|
||||||
tar xzf ${cmake_arc}
|
tar xzf ${cmake_arc}
|
||||||
cd ${TRAVIS_BUILD_DIR}/${cmake_dir}
|
cd ${TRAVIS_BUILD_DIR}/${cmake_dir}
|
||||||
sudo cp bin/* /usr/local/bin/
|
sudo cp bin/* /usr/local/bin/
|
||||||
sudo cp -r share/* /usr/local/share/
|
sudo cp -r share/* /usr/local/share/
|
||||||
export PATH="/usr/local/bin:$PATH" # FIXME
|
|
||||||
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
|
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
|
||||||
sudo ln -s /usr/local /opt/local
|
sudo ln -s /usr/local /opt/local
|
||||||
brew update
|
brew update
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
. .travis/environment.sh
|
||||||
|
|
||||||
# Travis Webhook
|
# Travis Webhook
|
||||||
wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
|
wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
|
||||||
|
|
|
||||||
31
.travis/environment.sh
Normal file
31
.travis/environment.sh
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
# Global environment included from all scripts #
|
||||||
|
# ---------------------------------------------------------------------------- #
|
||||||
|
|
||||||
|
# add /usr/local/bin to path, for custom cmake installs
|
||||||
|
if [[ ${TRAVIS_OS_NAME} == "linux" || ${TRAVIS_OS_NAME} == "osx" ]]; then
|
||||||
|
export PATH="/usr/local/bin:$PATH"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# buildenv runs a command in host machine or container, depending on build
|
||||||
|
if [[ ${CROSS_COMPILE} == "mingw32" ]]; then
|
||||||
|
buildenv() {
|
||||||
|
setup_container archlinux
|
||||||
|
docker exec -w "$(pwd)" -i -t "$container" "$@"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
buildenv() {
|
||||||
|
"$@"
|
||||||
|
}
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create a container based on given image if not existing
|
||||||
|
# the container id is persisted in a file across different scripts
|
||||||
|
setup_container() {
|
||||||
|
if [ -f ${TRAVIS_BUILD_DIR}/docker-container-id ]; then
|
||||||
|
container=$(cat ${TRAVIS_BUILD_DIR}/docker-container-id)
|
||||||
|
else
|
||||||
|
container=$(docker run -d -i -t -v /home:/home "$1" /bin/bash)
|
||||||
|
echo "$container" > ${TRAVIS_BUILD_DIR}/docker-container-id
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
. .travis/environment.sh
|
||||||
|
|
||||||
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
if [[ ${CROSS_COMPILE} == "mingw32" ]]; then
|
||||||
|
buildenv pacman -Sqy --noconfirm
|
||||||
|
buildenv pacman -Sq --noconfirm base-devel wget mingw-w64-cmake mingw-w64-gcc mingw-w64-pkg-config mingw-w64-libsndfile
|
||||||
|
buildenv i686-w64-mingw32-gcc -v && buildenv i686-w64-mingw32-g++ -v && buildenv i686-w64-mingw32-cmake --version
|
||||||
|
elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
||||||
sudo apt-get install libasound2-dev libjack-jackd2-dev libsndfile1-dev lv2-dev
|
sudo apt-get install libasound2-dev libjack-jackd2-dev libsndfile1-dev lv2-dev
|
||||||
gcc -v && g++ -v && cmake --version && /usr/local/bin/cmake --version && $SHELL --version
|
gcc -v && g++ -v && cmake --version && /usr/local/bin/cmake --version && $SHELL --version
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
. .travis/environment.sh
|
||||||
|
|
||||||
mkdir -p build/${INSTALL_DIR} && cd build
|
mkdir -p build/${INSTALL_DIR} && cd build
|
||||||
/usr/local/bin/cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} ..
|
|
||||||
|
|
||||||
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
if [[ ${CROSS_COMPILE} == "mingw32" ]]; then
|
||||||
|
|
||||||
make -j$(nproc)
|
buildenv i686-w64-mingw32-cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} -DSFIZZ_JACK=OFF ..
|
||||||
|
buildenv make -j
|
||||||
|
elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
|
||||||
|
|
||||||
|
buildenv cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} ..
|
||||||
|
buildenv make -j$(nproc)
|
||||||
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
|
elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then
|
||||||
|
|
||||||
make -j$(sysctl -n hw.ncpu)
|
buildenv cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=${PWD}/${INSTALL_DIR} ..
|
||||||
|
buildenv make -j$(sysctl -n hw.ncpu)
|
||||||
|
|
||||||
# Xcode not currently supported, see https://gitlab.kitware.com/cmake/cmake/issues/18088
|
# Xcode not currently supported, see https://gitlab.kitware.com/cmake/cmake/issues/18088
|
||||||
# xcodebuild -project sfizz.xcodeproj -alltargets -configuration Debug build
|
# xcodebuild -project sfizz.xcodeproj -alltargets -configuration Debug build
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -x # No fail, we need to go back to the original branch at the end
|
set -x # No fail, we need to go back to the original branch at the end
|
||||||
|
. .travis/environment.sh
|
||||||
|
|
||||||
# Build documentation only from Linux x86_64 builds
|
# Build documentation only from Linux x86_64 builds
|
||||||
if [[ ${TRAVIS_CPU_ARCH} != "amd64" || ${TRAVIS_OS_NAME} != "linux" ]]; then
|
if [[ ${TRAVIS_CPU_ARCH} != "amd64" || ${TRAVIS_OS_NAME} != "linux" || "${CROSS_COMPILE}" != "" ]]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue