Skip to content

Commit

Permalink
Enable auto-uploading of PRs (#4041)
Browse files Browse the repository at this point in the history
Removes Qt4 from build system
Uploads PRs to transfer.sh
  • Loading branch information
tresf authored Dec 23, 2017
1 parent 07de453 commit 7f9d01e
Show file tree
Hide file tree
Showing 21 changed files with 96 additions and 194 deletions.
12 changes: 3 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ cache:
matrix:
include:
- env: TYPE=style
- os: linux
- env: TARGET_OS=win32
- env: TARGET_OS=win64
- os: osx
osx_image: xcode8.2
- env: QT5=
- env: QT5=True
- env: QT5=True TARGET_OS=win32
- env: QT5=True TARGET_OS=win64
- os: osx
osx_image: xcode8.2
env: QT5=True
osx_image: xcode8.3
install: ${TRAVIS_BUILD_DIR}/.travis/install.sh
script: ${TRAVIS_BUILD_DIR}/.travis/script.sh
after_script: ${TRAVIS_BUILD_DIR}/.travis/after_script.sh
Expand All @@ -33,5 +27,5 @@ deploy:
on:
tags: true
all_branches: true
condition: '("$TARGET_OS" = win??) && "$QT5"'
condition: '("$TARGET_OS" = win??)'
repo: LMMS/lmms
10 changes: 2 additions & 8 deletions .travis/linux..install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,17 @@ set -e
PACKAGES="cmake libsndfile-dev fftw3-dev libvorbis-dev libogg-dev libmp3lame-dev
libasound2-dev libjack-jackd2-dev libsdl-dev libsamplerate0-dev libstk0-dev stk
libfluidsynth-dev portaudio19-dev g++-multilib libfltk1.3-dev
libgig-dev libsoundio-dev"
libgig-dev libsoundio-dev qt59base qt59translations qt59tools"

# swh build dependencies
SWH_PACKAGES="perl libxml2-utils libxml-perl liblist-moreutils-perl"

# VST dependencies
VST_PACKAGES="wine-dev libqt5x11extras5-dev qtbase5-private-dev libxcb-util0-dev libxcb-keysyms1-dev"
VST_PACKAGES="wine-dev qt59x11extras qtbase5-private-dev libxcb-util0-dev libxcb-keysyms1-dev"

# Help with unmet dependencies
PACKAGES="$PACKAGES $SWH_PACKAGES $VST_PACKAGES libjack-jackd2-0"

if [ "$QT5" ]; then
PACKAGES="$PACKAGES qt59base qt59translations qt59tools"
else
PACKAGES="$PACKAGES libqt4-dev"
fi

# shellcheck disable=SC2086
sudo apt-get install -y $PACKAGES

Expand Down
10 changes: 4 additions & 6 deletions .travis/linux..script.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/env bash
if [ "$QT5" ]; then
unset QTDIR QT_PLUGIN_PATH LD_LIBRARY_PATH
# shellcheck disable=SC1091
source /opt/qt59/bin/qt59-env.sh
fi
unset QTDIR QT_PLUGIN_PATH LD_LIBRARY_PATH
# shellcheck disable=SC1091
source /opt/qt59/bin/qt59-env.sh

set -e

# shellcheck disable=SC2086
cmake -DUSE_WERROR=ON $CMAKE_FLAGS ..
cmake -DUSE_WERROR=ON -DCMAKE_INSTALL_PREFIX=../target $CMAKE_FLAGS ..
8 changes: 1 addition & 7 deletions .travis/linux.win32.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,11 @@

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"
mingw32-x-libgig mingw32-x-libsoundio mingw32-x-lame mingw32-x-qt5base"

# swh build dependencies
SWH_PACKAGES="perl libxml2-utils libxml-perl liblist-moreutils-perl"
Expand Down
8 changes: 1 addition & 7 deletions .travis/linux.win64.install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@ 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"
mingw64-x-libgig mingw64-x-libsoundio mingw64-x-lame mingw64-x-qt5base"

export MINGW_PACKAGES

Expand Down
11 changes: 4 additions & 7 deletions .travis/osx..install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@

set -e

PACKAGES="cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio stk portaudio node fltk"

if [ "$QT5" ]; then
PACKAGES="$PACKAGES qt@5.5"
else
PACKAGES="$PACKAGES cartr/qt4/qt@4"
fi
PACKAGES="cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libsoundio stk portaudio node fltk qt5"

if "${TRAVIS}"; then
PACKAGES="$PACKAGES ccache"
Expand All @@ -30,4 +24,7 @@ brew install fftw --ignore-dependencies

brew install --build-from-source "https://gist.githubusercontent.com/tresf/c9260c43270abd4ce66ff40359588435/raw/fluid-synth.rb"

# Build libgig 4.1.0 from source to avoid 3.3.0 "ISO C++11 does not allow access declarations"
brew install --build-from-source "https://raw.githubusercontent.com/tresf/homebrew-core/gig/Formula/libgig.rb"

sudo npm install -g appdmg
10 changes: 4 additions & 6 deletions .travis/osx..script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

set -e

if [ "$QT5" ]; then
# Workaround; No FindQt5.cmake module exists
CMAKE_PREFIX_PATH="$(brew --prefix qt@5.5)"
export CMAKE_PREFIX_PATH
fi
# Workaround; No FindQt5.cmake module exists
CMAKE_PREFIX_PATH="$(brew --prefix qt5)"
export CMAKE_PREFIX_PATH

# shellcheck disable=SC2086
cmake $CMAKE_FLAGS -DUSE_WERROR=OFF ..
cmake -DUSE_WERROR=OFF -DCMAKE_INSTALL_PREFIX=../target $CMAKE_FLAGS ..
22 changes: 21 additions & 1 deletion .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ else
mkdir -p build
cd build

export CMAKE_FLAGS="-DWANT_QT5=$QT5 -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo"
export CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo"

if [ -z "$TRAVIS_TAG" ]; then
export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON"
Expand All @@ -31,4 +31,24 @@ else
tests/tests

fi

# Package and upload non-tagged builds
if [ ! -z "$TRAVIS_TAG" ]; then
# Skip, handled by travis deploy instead
exit 0
elif [[ $TARGET_OS == win* ]]; then
make -j4 package
PACKAGE="$(ls lmms-*win*.exe)"
elif [[ $TRAVIS_OS_NAME == osx ]]; then
make -j4 install > /dev/null
make dmg
PACKAGE="$(ls lmms-*.dmg)"
else
make -j4 install > /dev/null
make appimage
PACKAGE="$(ls lmms-*.AppImage)"
fi

echo "Uploading $PACKAGE to transfer.sh..."
curl --upload-file "$PACKAGE" "https://transfer.sh/$PACKAGE" || true
fi
72 changes: 23 additions & 49 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ OPTION(WANT_TAP "Include Tom's Audio Processing LADSPA plugins" ON)
OPTION(WANT_VST "Include VST support" ON)
OPTION(WANT_VST_NOWINE "Include partial VST support (without wine)" OFF)
OPTION(WANT_WINMM "Include WinMM MIDI support" OFF)
OPTION(WANT_QT5 "Build with Qt5" OFF)
OPTION(WANT_DEBUG_FPE "Debug floating point exceptions" OFF)


Expand Down Expand Up @@ -137,59 +136,34 @@ CHECK_INCLUDE_FILES(locale.h LMMS_HAVE_LOCALE_H)

LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}")

IF(WANT_QT5)
SET(QT5 TRUE)

FIND_PACKAGE(Qt5Core REQUIRED)
FIND_PACKAGE(Qt5Gui REQUIRED)
FIND_PACKAGE(Qt5LinguistTools)
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(Qt5Xml REQUIRED)

INCLUDE_DIRECTORIES(
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
)

SET(QT_LIBRARIES
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Xml
)
FIND_PACKAGE(Qt5 COMPONENTS Core Gui Widgets Xml REQUIRED)
FIND_PACKAGE(Qt5 COMPONENTS LinguistTools QUIET)

IF(LMMS_BUILD_LINUX)
FIND_PACKAGE(Qt5X11Extras REQUIRED)
LIST(APPEND QT_LIBRARIES Qt5::X11Extras)
ENDIF()

# Resolve Qt5::qmake to full path for use in packaging scripts
GET_TARGET_PROPERTY(QT_QMAKE_EXECUTABLE "${Qt5Core_QMAKE_EXECUTABLE}" IMPORTED_LOCATION)
INCLUDE_DIRECTORIES(
${Qt5Core_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
)

FIND_PACKAGE(Qt5Test)
SET(QT_QTTEST_LIBRARY Qt5::Test)
ELSE()
SET(QT5 FALSE)
SET(QT_LIBRARIES
Qt5::Core
Qt5::Gui
Qt5::Widgets
Qt5::Xml
)

# check for Qt4
SET(QT_MIN_VERSION "4.6.0" COMPONENTS QtCore QtGui QtXml)
FIND_PACKAGE(Qt4 REQUIRED)
SET(QT_USE_QTXML 1)
IF(WIN32)
SET(QT_TRANSLATIONS_DIR "${MINGW_PREFIX}/share/qt4/translations/")
ENDIF(WIN32)
IF(EXISTS "${QT_TRANSLATIONS_DIR}")
MESSAGE("-- Found Qt translations in ${QT_TRANSLATIONS_DIR}")
ADD_DEFINITIONS(-D'QT_TRANSLATIONS_DIR="${QT_TRANSLATIONS_DIR}"')
ENDIF()
IF(NOT WIN32)
STRING(REPLACE "-DQT_DLL" "" QT_DEFINITIONS "${QT_DEFINITIONS}")
ENDIF()
INCLUDE("${QT_USE_FILE}")
IF(LMMS_BUILD_LINUX)
FIND_PACKAGE(Qt5 COMPONENTS X11Extras REQUIRED)
LIST(APPEND QT_LIBRARIES Qt5::X11Extras)
ENDIF()

# Resolve Qt5::qmake to full path for use in packaging scripts
GET_TARGET_PROPERTY(QT_QMAKE_EXECUTABLE "${Qt5Core_QMAKE_EXECUTABLE}" IMPORTED_LOCATION)

FIND_PACKAGE(Qt5Test)
SET(QT_QTTEST_LIBRARY Qt5::Test)

# check for libsndfile
PKG_CHECK_MODULES(SNDFILE REQUIRED sndfile>=1.0.18)
IF(NOT SNDFILE_FOUND)
Expand Down
5 changes: 1 addition & 4 deletions INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ Where <prefix> can be /usr, /usr/local, /opt, etc. The default is /usr/local.
Building with QT5

First of all please note that CMake >= 2.8.11 is required for building with
Qt5 support. In order to build LMMS with Qt5, add the following flag when
invoking cmake:

-DWANT_QT5=ON
Qt5 support.

If your Qt5 installation does not reside in standard installation paths,
additionally pass e.g.
Expand Down
11 changes: 2 additions & 9 deletions cmake/apple/install_apple.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,8 @@ MSG_COLOR='\x1B[1;36m'
COLOR_RESET='\x1B[0m'
echo -e "$MSG_COLOR\n\nCreating App Bundle \"$APP\"...$COLOR_RESET"

# Prefer Qt 5.5 (QTBUG-53533)
qtpath=$(brew --prefix qt@5.5)/bin

# Fallback Qt 5.6+
if [ ! -d "$qtpath" ]; then
qtpath=$(brew--prefix qt5)/bin
fi

export PATH=$PATH:$qtpath
qtpath="$(dirname "@QT_QMAKE_EXECUTABLE@")"
export PATH="$PATH:$qtpath"

# Remove any old .app bundles
rm -Rf "$APP"
Expand Down
9 changes: 1 addition & 8 deletions cmake/build_mingw32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@ export PATH=$MINGW/bin:$PATH
export CFLAGS="-march=pentium3 -mtune=generic -mpreferred-stack-boundary=5 -mfpmath=sse"
export CXXFLAGS="$CFLAGS"

if [ "$1" = "-qt5" ]; then
QT5=True
fi

if [ $QT5 ]; then
CMAKE_OPTS="-DWANT_QT5=$QT5 -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
fi

CMAKE_OPTS="-DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# shellcheck disable=SC2086
Expand Down
9 changes: 1 addition & 8 deletions cmake/build_mingw64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,7 @@ else
fi

export PATH=$MINGW/bin:$PATH

if [ "$1" = "-qt5" ]; then
QT5=True
fi

if [ $QT5 ]; then
CMAKE_OPTS="-DWANT_QT5=$QT5 -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
fi
CMAKE_OPTS="-DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

Expand Down
14 changes: 4 additions & 10 deletions cmake/modules/BuildPlugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,8 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
ADD_GEN_QRC(RCC_OUT "${PLUGIN_NAME}.qrc" PREFIX artwork/${PLUGIN_NAME} ${PLUGIN_EMBEDDED_RESOURCES})
ENDIF(ER_LEN)

IF(QT5)
QT5_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
QT5_WRAP_UI(plugin_UIC_out ${PLUGIN_UICFILES})
ELSE()
QT4_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
QT4_WRAP_UI(plugin_UIC_out ${PLUGIN_UICFILES})
ENDIF()
QT5_WRAP_CPP(plugin_MOC_out ${PLUGIN_MOCFILES})
QT5_WRAP_UI(plugin_UIC_out ${PLUGIN_UICFILES})

FOREACH(f ${PLUGIN_SOURCES})
ADD_FILE_DEPENDENCIES(${f} ${RCC_OUT} ${plugin_UIC_out})
Expand All @@ -61,9 +56,8 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME)
ADD_LIBRARY(${PLUGIN_NAME} MODULE ${PLUGIN_SOURCES} ${plugin_MOC_out} ${RCC_OUT})
ENDIF ()

IF(QT5)
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} Qt5::Widgets Qt5::Xml)
ENDIF()
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} Qt5::Widgets Qt5::Xml)

IF(LMMS_BUILD_WIN32)
TARGET_LINK_LIBRARIES(${PLUGIN_NAME} lmms)
ENDIF(LMMS_BUILD_WIN32)
Expand Down
11 changes: 1 addition & 10 deletions cmake/modules/GenQrc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,5 @@ MACRO(ADD_GEN_QRC RCCOUT QRC_OUT)
ENDIF()

GEN_QRC(${QRC_FILE} "${ARGN}")
QT_ADD_RESOURCES(${RCCOUT} ${QRC_FILE})
ENDMACRO()


MACRO(QT_ADD_RESOURCES)
IF(QT5)
QT5_ADD_RESOURCES(${ARGN})
ELSE()
QT4_ADD_RESOURCES(${ARGN})
ENDIF()
QT5_ADD_RESOURCES(${RCCOUT} ${QRC_FILE})
ENDMACRO()
6 changes: 2 additions & 4 deletions data/locale/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
if (QT5)
set (QT_LUPDATE_EXECUTABLE "${Qt5_LUPDATE_EXECUTABLE}")
set (QT_LRELEASE_EXECUTABLE "${Qt5_LRELEASE_EXECUTABLE}")
endif ()
SET(QT_LUPDATE_EXECUTABLE "${Qt5_LUPDATE_EXECUTABLE}")
SET(QT_LRELEASE_EXECUTABLE "${Qt5_LRELEASE_EXECUTABLE}")

IF(QT_LUPDATE_EXECUTABLE STREQUAL "")
EXECUTE_PROCESS(COMMAND "lupdate" "--help" RESULT_VARIABLE LUPDATE_FALLBACK OUTPUT_QUIET)
Expand Down
Loading

0 comments on commit 7f9d01e

Please sign in to comment.