From ff958338e7e7c955446712e08989ef51ddc506bc Mon Sep 17 00:00:00 2001 From: Lukas W Date: Fri, 20 Oct 2017 10:54:24 +0200 Subject: [PATCH] Revert Travis docker changes --- .travis.yml | 8 +++-- .travis/common/windows-build.sh | 18 ---------- .travis/linux.cross.win32/Dockerfile | 38 --------------------- .travis/linux.cross.win32/script.sh | 5 --- .travis/linux.cross.win64/Dockerfile | 38 --------------------- .travis/linux.cross.win64/script.sh | 5 --- .travis/linux.win.download.sh | 16 +++++++++ .travis/linux.win32.before_install.sh | 4 +-- .travis/linux.win32.install.sh | 28 +++++++++++++++ .travis/linux.win32.script.sh | 3 +- .travis/linux.win64.before_install.sh | 3 +- .travis/linux.win64.install.sh | 21 ++++++++++++ .travis/linux.win64.script.sh | 3 +- .travis/script.sh | 4 --- CMakeLists.txt | 3 +- cmake/build_mingw32.sh | 13 ++++--- cmake/build_mingw64.sh | 13 ++++--- cmake/modules/MinGWCrossCompile.cmake | 12 ++++--- cmake/modules/Win32Toolchain.cmake | 2 +- cmake/modules/Win64Toolchain.cmake | 4 +-- plugins/vst_base/Win64/CMakeLists.txt | 3 +- src/CMakeLists.txt | 49 ++++++++++++++------------- 22 files changed, 130 insertions(+), 163 deletions(-) delete mode 100755 .travis/common/windows-build.sh delete mode 100644 .travis/linux.cross.win32/Dockerfile delete mode 100755 .travis/linux.cross.win32/script.sh delete mode 100644 .travis/linux.cross.win64/Dockerfile delete mode 100755 .travis/linux.cross.win64/script.sh create mode 100755 .travis/linux.win.download.sh diff --git a/.travis.yml b/.travis.yml index 2bb48707b..9e73bf834 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,10 @@ language: cpp compiler: gcc -services: - - docker dist: trusty sudo: required cache: directories: + - apt_mingw_cache - $HOME/.ccache matrix: include: @@ -15,11 +14,14 @@ 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: @@ -29,5 +31,5 @@ deploy: on: tags: true all_branches: true - condition: '("$TARGET_OS" = win??)' + condition: '("$TARGET_OS" = win??) && "$QT5"' repo: LMMS/lmms diff --git a/.travis/common/windows-build.sh b/.travis/common/windows-build.sh deleted file mode 100755 index c2c3c79ea..000000000 --- a/.travis/common/windows-build.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -set -e - -CPUS=$(grep -c bogo /proc/cpuinfo) - -cd /lmms - -mkdir build -cd build - -../cmake/build_mingw"$1".sh - -echo Building on "$CPUS" CPUs -make -j$((CPUS+1)) - -make package - -mv -v lmms-*.exe /lmms diff --git a/.travis/linux.cross.win32/Dockerfile b/.travis/linux.cross.win32/Dockerfile deleted file mode 100644 index 99c966893..000000000 --- a/.travis/linux.cross.win32/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM ubuntu:artful -MAINTAINER Tobias Junghans - -RUN \ - apt-get update && \ - apt-get install --no-install-recommends -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 \ - pkg-config \ - make \ - nsis \ - tofrodos \ - g++-mingw-w64 \ - libz-mingw-w64-dev \ - qt5base-mingw-w64 \ - qt5tools-mingw-w64 \ - qt5translations-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/* - diff --git a/.travis/linux.cross.win32/script.sh b/.travis/linux.cross.win32/script.sh deleted file mode 100755 index d79b3f6e7..000000000 --- a/.travis/linux.cross.win32/script.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -/lmms/.travis/common/windows-build.sh 32 - - diff --git a/.travis/linux.cross.win64/Dockerfile b/.travis/linux.cross.win64/Dockerfile deleted file mode 100644 index 99c966893..000000000 --- a/.travis/linux.cross.win64/Dockerfile +++ /dev/null @@ -1,38 +0,0 @@ -FROM ubuntu:artful -MAINTAINER Tobias Junghans - -RUN \ - apt-get update && \ - apt-get install --no-install-recommends -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 \ - pkg-config \ - make \ - nsis \ - tofrodos \ - g++-mingw-w64 \ - libz-mingw-w64-dev \ - qt5base-mingw-w64 \ - qt5tools-mingw-w64 \ - qt5translations-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/* - diff --git a/.travis/linux.cross.win64/script.sh b/.travis/linux.cross.win64/script.sh deleted file mode 100755 index eae3d9530..000000000 --- a/.travis/linux.cross.win64/script.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -/lmms/.travis/common/windows-build.sh 64 - - diff --git a/.travis/linux.win.download.sh b/.travis/linux.win.download.sh new file mode 100755 index 000000000..215d4eb93 --- /dev/null +++ b/.travis/linux.win.download.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -e + +CACHE_DIR=$TRAVIS_BUILD_DIR/apt_mingw_cache/$1 +mkdir -p "$CACHE_DIR" + +pushd "$CACHE_DIR" + +# shellcheck disable=SC2086 +apt-get --print-uris --yes install $MINGW_PACKAGES | grep ^\' | cut -d\' -f2 > downloads.list +wget -N --input-file downloads.list + +sudo cp ./*.deb /var/cache/apt/archives/ + +popd diff --git a/.travis/linux.win32.before_install.sh b/.travis/linux.win32.before_install.sh index ef9f8233d..e0cfcbafb 100755 --- a/.travis/linux.win32.before_install.sh +++ b/.travis/linux.win32.before_install.sh @@ -2,5 +2,5 @@ set -e -docker build -t lmms-build "${TRAVIS_BUILD_DIR}/.travis/linux.cross.win32/" - +sudo add-apt-repository ppa:tobydox/mingw-x-trusty -y +sudo apt-get update -qq diff --git a/.travis/linux.win32.install.sh b/.travis/linux.win32.install.sh index 7e96b6b02..4c35555e3 100755 --- a/.travis/linux.win32.install.sh +++ b/.travis/linux.win32.install.sh @@ -2,3 +2,31 @@ 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 diff --git a/.travis/linux.win32.script.sh b/.travis/linux.win32.script.sh index 263a5ffd0..2ee9342c0 100755 --- a/.travis/linux.win32.script.sh +++ b/.travis/linux.win32.script.sh @@ -3,5 +3,4 @@ set -e export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON" -docker run -v "${TRAVIS_BUILD_DIR}":/lmms:rw lmms-build /bin/sh /lmms/.travis/linux.cross.win32/script.sh - +../cmake/build_mingw32.sh diff --git a/.travis/linux.win64.before_install.sh b/.travis/linux.win64.before_install.sh index 40cf3674e..083039391 100755 --- a/.travis/linux.win64.before_install.sh +++ b/.travis/linux.win64.before_install.sh @@ -2,5 +2,4 @@ set -e -docker build -t lmms-build "${TRAVIS_BUILD_DIR}/.travis/linux.cross.win64/" - +"$TRAVIS_BUILD_DIR/.travis/linux.win32.before_install.sh" diff --git a/.travis/linux.win64.install.sh b/.travis/linux.win64.install.sh index 7e96b6b02..2d03e0320 100755 --- a/.travis/linux.win64.install.sh +++ b/.travis/linux.win64.install.sh @@ -2,3 +2,24 @@ 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 diff --git a/.travis/linux.win64.script.sh b/.travis/linux.win64.script.sh index 5e2485c6d..1815c7319 100755 --- a/.travis/linux.win64.script.sh +++ b/.travis/linux.win64.script.sh @@ -3,5 +3,4 @@ set -e export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON" -docker run -v "${TRAVIS_BUILD_DIR}":/lmms:rw lmms-build /bin/sh /lmms/.travis/linux.cross.win64/script.sh - +../cmake/build_mingw64.sh diff --git a/.travis/script.sh b/.travis/script.sh index 6da6252f4..4367f942e 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -10,10 +10,6 @@ if [ "$TYPE" = 'style' ]; then # shellcheck disable=SC2046 shellcheck $(find -O3 "$TRAVIS_BUILD_DIR/.travis/" "$TRAVIS_BUILD_DIR/cmake/" -type f -name '*.sh' -o -name "*.sh.in") -elif [[ $TARGET_OS == "win32" || $TARGET_OS == "win64" ]] ; then - - "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh" - else mkdir build diff --git a/CMakeLists.txt b/CMakeLists.txt index 28ff4a8f4..ee47d120e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,6 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH}) IF(COMMAND CMAKE_POLICY) CMAKE_POLICY(SET CMP0005 NEW) CMAKE_POLICY(SET CMP0003 NEW) - CMAKE_POLICY(SET CMP0020 NEW) IF (CMAKE_MAJOR_VERSION GREATER 2) CMAKE_POLICY(SET CMP0026 OLD) CMAKE_POLICY(SET CMP0050 OLD) @@ -139,9 +138,9 @@ IF(WANT_QT5) FIND_PACKAGE(Qt5Core REQUIRED) FIND_PACKAGE(Qt5Gui REQUIRED) + FIND_PACKAGE(Qt5LinguistTools) FIND_PACKAGE(Qt5Widgets REQUIRED) FIND_PACKAGE(Qt5Xml REQUIRED) - FIND_PACKAGE(Qt5LinguistTools REQUIRED) INCLUDE_DIRECTORIES( ${Qt5Core_INCLUDE_DIRS} diff --git a/cmake/build_mingw32.sh b/cmake/build_mingw32.sh index c92f5dac6..b5501dc88 100755 --- a/cmake/build_mingw32.sh +++ b/cmake/build_mingw32.sh @@ -3,17 +3,22 @@ # Accomodate both linux windows mingw locations MINGW=/mingw32 if [ -z "$MSYSCON" ]; then - MINGW=/usr/i686-w64-mingw32 + MINGW=/opt$MINGW else CMAKE_OPTS="$CMAKE_OPTS -DLMMS_BUILD_MSYS=1" - export PATH=$MINGW/bin:$PATH fi -export PKG_CONFIG_PATH=$MINGW/lib/pkgconfig/ +export PATH=$MINGW/bin:$PATH export CFLAGS="-march=pentium3 -mtune=generic -mpreferred-stack-boundary=5 -mfpmath=sse" export CXXFLAGS="$CFLAGS" -CMAKE_OPTS="-DWANT_QT5=True -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS" +if [ "$1" = "-qt5" ]; then + QT5=True +fi + +if [ $QT5 ]; then + CMAKE_OPTS="-DWANT_QT5=$QT5 -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS" +fi DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/cmake/build_mingw64.sh b/cmake/build_mingw64.sh index fd7f465bc..42a662bf1 100755 --- a/cmake/build_mingw64.sh +++ b/cmake/build_mingw64.sh @@ -3,15 +3,20 @@ # Accomodate both linux windows mingw locations MINGW=/mingw64 if [ -z "$MSYSCON" ]; then - MINGW=/usr/x86_64-w64-mingw32 + MINGW=/opt$MINGW else CMAKE_OPTS="$CMAKE_OPTS -DLMMS_BUILD_MSYS=1" - export PATH=$MINGW/bin:$PATH fi -export PKG_CONFIG_PATH=$MINGW/lib/pkgconfig/ +export PATH=$MINGW/bin:$PATH -CMAKE_OPTS="-DWANT_QT5=True -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS" +if [ "$1" = "-qt5" ]; then + QT5=True +fi + +if [ $QT5 ]; then + CMAKE_OPTS="-DWANT_QT5=$QT5 -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS" +fi DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/cmake/modules/MinGWCrossCompile.cmake b/cmake/modules/MinGWCrossCompile.cmake index a9483cf43..50ea72900 100644 --- a/cmake/modules/MinGWCrossCompile.cmake +++ b/cmake/modules/MinGWCrossCompile.cmake @@ -40,8 +40,7 @@ IF(LMMS_BUILD_MSYS) ENDIF() # Linux mingw requires explicitly defined tools to prevent clash with native system tools ELSE() - SET(MINGW_PREFIX /usr/${MINGW_TARGET}/) - SET(MINGW_TOOL_PREFIX /usr/bin/${MINGW_TARGET}-) + SET(MINGW_TOOL_PREFIX ${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32-) # Specify the cross compiler SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc) @@ -51,6 +50,7 @@ ELSE() # Mingw tools SET(STRIP ${MINGW_TOOL_PREFIX}strip) SET(WINDRES ${MINGW_TOOL_PREFIX}windres) + SET(ENV{PKG_CONFIG} ${MINGW_TOOL_PREFIX}pkg-config) # Search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) @@ -61,14 +61,15 @@ ELSE() # For 32-bit vst support IF(WIN64) # Specify the 32-bit cross compiler - SET(MINGW_PREFIX32 /usr/${MINGW_TARGET32}/) - SET(MINGW_TOOL_PREFIX32 /usr/bin/${MINGW_TARGET32}-) + SET(MINGW_TOOL_PREFIX32 ${MINGW_PREFIX32}/bin/${CMAKE_SYSTEM_PROCESSOR32}-w64-mingw32-) SET(CMAKE_C_COMPILER32 ${MINGW_TOOL_PREFIX32}gcc) SET(CMAKE_CXX_COMPILER32 ${MINGW_TOOL_PREFIX32}g++) ENDIF() + + INCLUDE_DIRECTORIES(${MINGW_PREFIX}/include) ENDIF() -LINK_DIRECTORIES(${MINGW_PREFIX}/lib) +LINK_DIRECTORIES(${MINGW_PREFIX}/lib ${MINGW_PREFIX}/bin) # Qt tools SET(QT_BINARY_DIR ${MINGW_PREFIX}/bin) @@ -83,6 +84,7 @@ IF(NOT DEFINED ENV{MINGW_DEBUG_INFO}) MESSAGE("* CMAKE_CXX_COMPILER : ${CMAKE_CXX_COMPILER}") MESSAGE("* CMAKE_RC_COMPILER : ${CMAKE_RC_COMPILER}") MESSAGE("* WINDRES : ${WINDRES}") + MESSAGE("* ENV{PKG_CONFIG} : $ENV{PKG_CONFIG}") MESSAGE("* MINGW_TOOL_PREFIX32 : ${MINGW_TOOL_PREFIX32}") MESSAGE("* CMAKE_C_COMPILER32 : ${CMAKE_C_COMPILER32}") MESSAGE("* CMAKE_CXX_COMPILER32 : ${CMAKE_CXX_COMPILER32}") diff --git a/cmake/modules/Win32Toolchain.cmake b/cmake/modules/Win32Toolchain.cmake index 45e3e680e..60e8d3a47 100644 --- a/cmake/modules/Win32Toolchain.cmake +++ b/cmake/modules/Win32Toolchain.cmake @@ -1,7 +1,7 @@ IF(LMMS_BUILD_MSYS) SET(MINGW_PREFIX /mingw32) ELSE() - SET(MINGW_TARGET i686-w64-mingw32) + SET(MINGW_PREFIX /opt/mingw32) ENDIF() SET(CMAKE_SYSTEM_PROCESSOR i686) diff --git a/cmake/modules/Win64Toolchain.cmake b/cmake/modules/Win64Toolchain.cmake index ab6a95d56..2b569e7ac 100644 --- a/cmake/modules/Win64Toolchain.cmake +++ b/cmake/modules/Win64Toolchain.cmake @@ -2,8 +2,8 @@ IF(LMMS_BUILD_MSYS) SET(MINGW_PREFIX /mingw64) SET(MINGW_PREFIX32 /mingw32) ELSE() - SET(MINGW_TARGET32 i686-w64-mingw32) - SET(MINGW_TARGET x86_64-w64-mingw32) + SET(MINGW_PREFIX /opt/mingw64) + SET(MINGW_PREFIX32 /opt/mingw32) ENDIF() SET(CMAKE_SYSTEM_PROCESSOR x86_64) diff --git a/plugins/vst_base/Win64/CMakeLists.txt b/plugins/vst_base/Win64/CMakeLists.txt index 10a508daf..6a670829c 100644 --- a/plugins/vst_base/Win64/CMakeLists.txt +++ b/plugins/vst_base/Win64/CMakeLists.txt @@ -14,7 +14,6 @@ ADD_CUSTOM_COMMAND(TARGET RemoteVstPlugin32 POST_BUILD COMMAND "${STRIP}" "$