From 151c43c2c02fc94a5e8f988e56a20ff7220bd08d Mon Sep 17 00:00:00 2001 From: Javier Serrano Polo Date: Fri, 17 Jan 2020 16:55:07 +0100 Subject: [PATCH] Switch to Xenial build environment (#4813) * Switch to Xenial build environment * Add Carla submodule/weak linking support, related #3963 * Fix Carla detection in AppImage, closes #5369 --- .gitmodules | 3 +++ .travis.yml | 6 +++++- .travis/linux..before_install.sh | 6 ------ .travis/linux..install.sh | 10 ++------- CMakeLists.txt | 3 ++- cmake/linux/launch_lmms.sh | 7 +++---- cmake/linux/package_linux.sh.in | 7 ++++--- cmake/modules/BuildPlugin.cmake | 6 +++++- plugins/carlabase/CMakeLists.txt | 29 +++++++++++++++++++++++++-- plugins/carlabase/DummyCarla.cpp | 12 +++++++++++ plugins/carlabase/carla | 1 + plugins/carlabase/carla.cpp | 3 ++- plugins/carlabase/logo.png | Bin 0 -> 3313 bytes plugins/carlapatchbay/CMakeLists.txt | 4 ++-- plugins/carlarack/CMakeLists.txt | 4 ++-- 15 files changed, 70 insertions(+), 31 deletions(-) create mode 100644 plugins/carlabase/DummyCarla.cpp create mode 160000 plugins/carlabase/carla create mode 100644 plugins/carlabase/logo.png diff --git a/.gitmodules b/.gitmodules index 4abd7ae3e7c..3c0663dd62d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "src/3rdparty/rpmalloc/rpmalloc"] path = src/3rdparty/rpmalloc/rpmalloc url = https://github.com/rampantpixels/rpmalloc.git +[submodule "plugins/carlabase/carla"] + path = plugins/carlabase/carla + url = https://github.com/falktx/carla diff --git a/.travis.yml b/.travis.yml index 5f8002cb191..396217af8f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: cpp compiler: gcc -dist: trusty +dist: xenial sudo: required cache: directories: @@ -10,13 +10,17 @@ cache: matrix: include: - env: TARGET_OS=win32 + dist: trusty - env: TARGET_OS=win64 + dist: trusty - os: osx osx_image: xcode8.2 - env: QT5= - env: QT5=True - env: QT5=True TARGET_OS=win32 TARGET_DEPLOY=True + dist: trusty - env: QT5=True TARGET_OS=win64 TARGET_DEPLOY=True + dist: trusty - os: osx osx_image: xcode8.2 env: QT5=True diff --git a/.travis/linux..before_install.sh b/.travis/linux..before_install.sh index 91f86eef2af..8e6d7bb00c7 100644 --- a/.travis/linux..before_install.sh +++ b/.travis/linux..before_install.sh @@ -1,9 +1,3 @@ #!/usr/bin/env bash - -sudo add-apt-repository ppa:beineri/opt-qt592-trusty -y -sudo add-apt-repository ppa:andrewrk/libgroove -y -sudo sed -e "s/trusty/precise/" -i \ - /etc/apt/sources.list.d/andrewrk-libgroove-trusty.list - sudo dpkg --add-architecture i386 sudo apt-get update -qq || true diff --git a/.travis/linux..install.sh b/.travis/linux..install.sh index 3e86eecfe87..72481fc23c8 100644 --- a/.travis/linux..install.sh +++ b/.travis/linux..install.sh @@ -2,7 +2,7 @@ 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 + libfluidsynth-dev portaudio19-dev g++-multilib libfltk1.3-dev fluid libgig-dev libsoundio-dev" VST_PACKAGES="wine-dev libqt5x11extras5-dev qtbase5-private-dev libxcb-util0-dev libxcb-keysyms1-dev" @@ -11,15 +11,9 @@ VST_PACKAGES="wine-dev libqt5x11extras5-dev qtbase5-private-dev libxcb-util0-dev PACKAGES="$PACKAGES $VST_PACKAGES libjack-jackd2-0" if [ $QT5 ]; then - PACKAGES="$PACKAGES qt59base qt59translations qt59tools" + PACKAGES="$PACKAGES qttools5-dev-tools" else PACKAGES="$PACKAGES libqt4-dev" fi sudo apt-get install -y $PACKAGES - -# kxstudio repo offers Carla; avoid package conflicts (wine, etc) by running last -sudo add-apt-repository -y ppa:kxstudio-debian/libs -sudo add-apt-repository -y ppa:kxstudio-debian/apps -sudo apt-get update -sudo apt-get install -y carla diff --git a/CMakeLists.txt b/CMakeLists.txt index e3c62cb44ad..a84018eac6c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,7 +241,8 @@ IF(WANT_CARLA) SET(LMMS_HAVE_CARLA TRUE) SET(STATUS_CARLA "OK") ELSE(CARLA_FOUND) - SET(STATUS_CARLA "not found, please install the latest carla") + SET(LMMS_HAVE_WEAKCARLA TRUE) + SET(STATUS_CARLA "OK (weak linking enabled)") ENDIF(CARLA_FOUND) ENDIF(WANT_CARLA) diff --git a/cmake/linux/launch_lmms.sh b/cmake/linux/launch_lmms.sh index e6432aa3a37..198b5711a53 100644 --- a/cmake/linux/launch_lmms.sh +++ b/cmake/linux/launch_lmms.sh @@ -1,9 +1,8 @@ #!/usr/bin/env bash -alias standard_which="command -v" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export PATH="$PATH:/sbin" -if standard_which carla > /dev/null 2>&1; then - CARLAPATH="$(standard_which carla)" +if command -v carla > /dev/null 2>&1; then + CARLAPATH="$(command -v carla)" CARLAPREFIX="${CARLAPATH%/bin*}" echo "Carla appears to be installed on this system at $CARLAPREFIX/lib[64]/carla so we'll use it." export LD_LIBRARY_PATH=$CARLAPREFIX/lib/carla:$CARLAPREFIX/lib64/carla:$LD_LIBRARY_PATH @@ -22,4 +21,4 @@ else echo "Jack does not appear to be installed. That's OK, we'll use a dummy version instead." export LD_LIBRARY_PATH=$DIR/usr/lib/lmms/optional:$LD_LIBRARY_PATH fi -QT_X11_NO_NATIVE_MENUBAR=1 "$DIR"/usr/bin/lmms.real "$@" \ No newline at end of file +QT_X11_NO_NATIVE_MENUBAR=1 "$DIR"/usr/bin/lmms.real "$@" diff --git a/cmake/linux/package_linux.sh.in b/cmake/linux/package_linux.sh.in index cb3764dcb01..8e48c24389d 100644 --- a/cmake/linux/package_linux.sh.in +++ b/cmake/linux/package_linux.sh.in @@ -105,7 +105,7 @@ chmod +x "${APPDIR}usr/bin/lmms" unset LD_LIBRARY_PATH # Ensure linuxdeployqt can find shared objects -export LD_LIBRARY_PATH="${APPDIR}usr/lib/lmms/":$LD_LIBRARY_PATH +export LD_LIBRARY_PATH="${APPDIR}usr/lib/lmms/":"${APPDIR}usr/lib/lmms/optional":$LD_LIBRARY_PATH # Handle wine linking if [ -d "@WINE_LIBRARY_FIX@" ]; then @@ -120,7 +120,7 @@ ZYNBIN="${APPDIR}usr/bin/RemoteZynAddSubFx" VSTBIN="${APPDIR}usr/bin/RemoteVstPlugin.exe.so" mv "$ZYNLIB" "$ZYNBIN" -mv "$VSTLIB" "$VSTBIN" +mv "$VSTLIB" "$VSTBIN" || true # Patch the desktop file sed -i 's/.*Exec=.*/Exec=lmms.real/' "$DESKTOPFILE" @@ -146,13 +146,14 @@ success "Bundled and relinked dependencies" # Link to original location so lmms can find them ln -sr "$ZYNBIN" "$ZYNLIB" -ln -sr "$VSTBIN" "$VSTLIB" +ln -sr "$VSTBIN" "$VSTLIB" || true # Remove wine library conflict rm -f "${APPDIR}/usr/lib/libwine.so.1" # Use system-provided carla rm -f "${APPDIR}usr/lib/"libcarla*.so +rm -f "${APPDIR}usr/lib/lmms/optional/"libcarla*.so # Remove bundled jack in LD_LIBRARY_PATH if exists if [ -e "${APPDIR}/usr/lib/libjack.so.0" ]; then diff --git a/cmake/modules/BuildPlugin.cmake b/cmake/modules/BuildPlugin.cmake index 25cca92afbc..f69fafe862f 100644 --- a/cmake/modules/BuildPlugin.cmake +++ b/cmake/modules/BuildPlugin.cmake @@ -70,7 +70,11 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME) TARGET_LINK_LIBRARIES(${PLUGIN_NAME} lmms) ENDIF(LMMS_BUILD_WIN32) - INSTALL(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION "${PLUGIN_DIR}") + IF(LMMS_BUILD_WIN32 AND "${PLUGIN_LINK}" STREQUAL "SHARED") + INSTALL(TARGETS ${PLUGIN_NAME} RUNTIME DESTINATION "${PLUGIN_DIR}") + ELSE() + INSTALL(TARGETS ${PLUGIN_NAME} LIBRARY DESTINATION "${PLUGIN_DIR}") + ENDIF() IF(LMMS_BUILD_APPLE) IF ("${PLUGIN_LINK}" STREQUAL "SHARED") diff --git a/plugins/carlabase/CMakeLists.txt b/plugins/carlabase/CMakeLists.txt index 4fa81a4916f..722f8463da8 100644 --- a/plugins/carlabase/CMakeLists.txt +++ b/plugins/carlabase/CMakeLists.txt @@ -6,7 +6,29 @@ IF(NOT CMAKE_VERSION VERSION_LESS 3.9) CMAKE_POLICY(SET CMP0068 OLD) ENDIF() -if(LMMS_HAVE_CARLA) +# If Carla was not provided by the system, make a dummy library instead +if(LMMS_HAVE_WEAKCARLA) + # Mimic the Makefile header + FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/config.h "") + SET(CARLA_INCLUDE_DIRS + ${CMAKE_CURRENT_SOURCE_DIR}/carla/source + ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/includes + ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/utils + ${CMAKE_CURRENT_SOURCE_DIR}/carla/source/backend + ${CMAKE_CURRENT_BINARY_DIR} + ) + INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS}) + ADD_LIBRARY(carla_native-plugin MODULE DummyCarla.cpp) + INSTALL(TARGETS carla_native-plugin LIBRARY DESTINATION "${PLUGIN_DIR}/optional") + SET(CARLA_LIBRARIES $) + SET(CARLA_LIBRARY_DIRS $) + # Set parent scope variables so carlarack and carlapatchbay can see them + SET(CARLA_LIBRARIES ${CARLA_LIBRARIES} PARENT_SCOPE) + SET(CARLA_INCLUDE_DIRS ${CARLA_INCLUDE_DIRS} PARENT_SCOPE) + SET(CARLA_LIBRARY_DIRS ${CARLA_LIBRARY_DIRS} PARENT_SCOPE) +endif() + +if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA) INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS}) LINK_DIRECTORIES(${CARLA_LIBRARY_DIRS}) @@ -17,4 +39,7 @@ if(LMMS_HAVE_CARLA) BUILD_WITH_INSTALL_RPATH TRUE INSTALL_RPATH_USE_LINK_PATH TRUE INSTALL_RPATH "${CARLA_RPATH}") -endif(LMMS_HAVE_CARLA) + IF(LMMS_HAVE_WEAKCARLA) + ADD_DEPENDENCIES(carlabase carla_native-plugin) + ENDIF() +endif() diff --git a/plugins/carlabase/DummyCarla.cpp b/plugins/carlabase/DummyCarla.cpp new file mode 100644 index 00000000000..560e866b7b6 --- /dev/null +++ b/plugins/carlabase/DummyCarla.cpp @@ -0,0 +1,12 @@ +// A dummy Carla interface +#include "CarlaNativePlugin.h" + +const char* carla_get_library_filename() { return nullptr; } +const char* carla_get_library_folder() { return nullptr; } +const NativePluginDescriptor* carla_get_native_rack_plugin() { return nullptr; } +const NativePluginDescriptor* carla_get_native_patchbay_plugin() { return nullptr; } +const NativePluginDescriptor* carla_get_native_patchbay16_plugin() { return nullptr; } +const NativePluginDescriptor* carla_get_native_patchbay32_plugin() { return nullptr; } +const NativePluginDescriptor* carla_get_native_patchbay64_plugin() { return nullptr; } +const NativePluginDescriptor* carla_get_native_patchbay_cv_plugin() { return nullptr; } +CarlaBackend::CarlaEngine* carla_get_native_plugin_engine(const NativePluginDescriptor* desc, NativePluginHandle handle) { return nullptr; } diff --git a/plugins/carlabase/carla b/plugins/carlabase/carla new file mode 160000 index 00000000000..4ac8ff2ef41 --- /dev/null +++ b/plugins/carlabase/carla @@ -0,0 +1 @@ +Subproject commit 4ac8ff2ef412d4ab190d2e285e318b1f339af4ae diff --git a/plugins/carlabase/carla.cpp b/plugins/carlabase/carla.cpp index b25677f5c5f..0029a6b4298 100644 --- a/plugins/carlabase/carla.cpp +++ b/plugins/carlabase/carla.cpp @@ -438,7 +438,8 @@ PluginView* CarlaInstrument::instantiateView(QWidget* parent) // Disable plugin focus per https://bugreports.qt.io/browse/QTBUG-30181 #ifndef CARLA_OS_MAC if (QWidget* const window = parent->window()) - fHost.uiParentId = window->winId(); + // TODO: Remove cast; Only needed for Qt4 + fHost.uiParentId = (uintptr_t)window->winId(); else #endif fHost.uiParentId = 0; diff --git a/plugins/carlabase/logo.png b/plugins/carlabase/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..353d5d718d6fef054ff4fed2932f4f45df7f792c GIT binary patch literal 3313 zcmV&P)9M@gPKj)l%%)a+NZLecHP3^de<=E~G@`KuK z+G3LYL6NEoDM%$$qAGu&{!_spAR+M&;;#w;rGFH)2vQW0K!ZYsit4mDq)lRnSh8iu z4#v;DkA2;{uRF7|=N$f+oxQtz*L!c;QUpKg=**lsGxK}@zURycYb~QBgb;uLBp?%9Se`FoS~h1?Vxa3WY+<7?X;{Vi~P<21rOLW7b+}t^K)J zK?q@m5XKnO0oIjLjZUZ2kW#ja#bO80p%B7a+h=}mZqA8Dqf<($9eZawkDY#8f9ykh z#3S0(x%#S>jn%HKuXRNl5lv@luC=M&S)p`$ znab@I+}1i%yJyMonr3SEEYmxuaWYBj%N5p^%B(GysTWJOz1lzstZ%8;-01uNaX0b9 zyK9N7TI*%s_iLq6$qj|*`+A{Jhyyc9sfRzgzwzr&KcPQAmzA;ns%8D2ubOR5yA4)yc$8*kl}34$Mz8mpEf65n7-t8_sOVlOX2121m$HAWwY~*Zip8P_m`KlR${3T1 zMx#4U?pl5B)IR^W3U3>k|8a+|0SAZzSwI6Ci^ibwX#)*fXsW$y!!3+JfC$iJnL5kd z>y3xk$2ASoN|<`m#?GAazL=O%_S@(9hVT0>&;^X@X+IW?MrWp!d*oC5nt%BC`zAW` zwvVyF3t+h4oVNlq4$kYRurbHs`M9Qf*ZYE5Xx#^d;1@nMbNJeQ@y2RPtfW$@cB9eI z5|EDLM77qLhcoSu$00U}fwvV2K2f?DYvC)oaOKpXpgDH_+#Re6LLnwCRC< zdf+_Udv@p^7AXG6M_Lj6rH|!5p|#F9juQoBWMN@JEG;cXfJ8o~4`kQCm<{It;?ybH zV`|0d$T+KP=i2D?(84hxc=C-m=+JW~18a9Y3VUYu0}0o4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Q+>**QwX* z+nBk1GQc{45Q8ybu~rDtcZ`VRIM(w#D}*poVujd<{B_#$CPFTsEvQTS%K`!>=1-I_-Ab=5jeA7cXA4k38~7*Ymvfa#LMT zf0&P31x5$bcSba|sk}d+pEM^t9t_e@fRI_Q*TOguQOUt4=K0?F>ifXD<2e4six;f~ zjO)6-QmXOpz4&<>74C6yvz@-M8J8<0IMr-w28)%NSP~+iwsQEC6KldAt zA|uNGhwt3{fl{jBx~>nwH!>QHhDan5qU}d@Drv;&Pe(u6=~!94)kWL!IobRaV|swG zK_D*z5MczlYf^;y7uI0 z=lRrQ%2~edi~5Q$5s*wN(%DGw^J;`hDuYU%&+AgXU#7NHrB83vSEtFVrOn{t|o-AfAjtLw|+1y-}vZ5@^muBqh4O*r4o`{1eK47cwV7% zaa1Oa%;Zp+9Fa_hSSF8ddWc9DBRcqAi*8KAt_-S>!`U@MsxVDDpTR6jbjr|)ckq;l zj<{i+vPywen68!ef4?TKzxmzr4{zSn*NrhtzVEM=N~I12za0Gk_|;(G#!Wwac%B#0 vTFd{9pFNaPCLWJ>xAn8fApKwZ-R8dmmiW9w#no5v00000NkvXXu0mjf39(~9 literal 0 HcmV?d00001 diff --git a/plugins/carlapatchbay/CMakeLists.txt b/plugins/carlapatchbay/CMakeLists.txt index d9aa6b32102..8e358891649 100644 --- a/plugins/carlapatchbay/CMakeLists.txt +++ b/plugins/carlapatchbay/CMakeLists.txt @@ -1,4 +1,4 @@ -if(LMMS_HAVE_CARLA) +if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA) ADD_DEFINITIONS(-DCARLA_PLUGIN_PATCHBAY -DCARLA_PLUGIN_SYNTH) INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../carlabase") @@ -6,4 +6,4 @@ if(LMMS_HAVE_CARLA) ${CARLA_LIBRARY_DIRS}) LINK_LIBRARIES(carlabase) BUILD_PLUGIN(carlapatchbay carlapatchbay.cpp EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") -endif(LMMS_HAVE_CARLA) +endif() diff --git a/plugins/carlarack/CMakeLists.txt b/plugins/carlarack/CMakeLists.txt index 1834b23715e..5de833dd59f 100644 --- a/plugins/carlarack/CMakeLists.txt +++ b/plugins/carlarack/CMakeLists.txt @@ -1,4 +1,4 @@ -if(LMMS_HAVE_CARLA) +if(LMMS_HAVE_CARLA OR LMMS_HAVE_WEAKCARLA) ADD_DEFINITIONS(-DCARLA_PLUGIN_RACK -DCARLA_PLUGIN_SYNTH) INCLUDE(BuildPlugin) INCLUDE_DIRECTORIES(${CARLA_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/../carlabase") @@ -6,4 +6,4 @@ if(LMMS_HAVE_CARLA) ${CARLA_LIBRARY_DIRS}) LINK_LIBRARIES(carlabase) BUILD_PLUGIN(carlarack carlarack.cpp EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") -endif(LMMS_HAVE_CARLA) +endif()