From 0382b690e36260f141654539088b3cc63cccf789 Mon Sep 17 00:00:00 2001 From: tresf Date: Wed, 2 Aug 2017 23:53:01 -0400 Subject: [PATCH] Add stk rawwaves --- .travis/linux..install.sh | 2 +- cmake/linux/package_linux.sh.in | 4 ++++ src/core/ConfigManager.cpp | 11 ++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis/linux..install.sh b/.travis/linux..install.sh index f5988a83d70..55511a7f40b 100644 --- a/.travis/linux..install.sh +++ b/.travis/linux..install.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash PACKAGES="cmake libsndfile-dev fftw3-dev libvorbis-dev libogg-dev libmp3lame-dev - libasound2-dev libjack-dev libsdl-dev libsamplerate0-dev libstk0-dev + libasound2-dev libjack-dev libsdl-dev libsamplerate0-dev libstk0-dev stk libfluidsynth-dev portaudio19-dev wine-dev g++-multilib libfltk1.3-dev libgig-dev libsoundio-dev" diff --git a/cmake/linux/package_linux.sh.in b/cmake/linux/package_linux.sh.in index cde14d674a1..9c0913f3202 100644 --- a/cmake/linux/package_linux.sh.in +++ b/cmake/linux/package_linux.sh.in @@ -90,6 +90,10 @@ cp -R "@CMAKE_INSTALL_PREFIX@/." "${APPDIR}usr" rm -rf "${APPDIR}usr/include" success "${APPDIR}" +# Copy rawwaves directory for stk/mallets +mkdir -p "${APPDIR}usr/share/stk/" +cp -R /usr/share/stk/rawwaves/ "${APPDIR}usr/share/stk/" + # Create a wrapper script which calls the lmms executable mv "${APPDIR}usr/bin/lmms" "${APPDIR}usr/bin/lmms.real" # shellcheck disable=SC1083 diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 5ccb4d345d4..231475002f1 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -503,7 +503,16 @@ void ConfigManager::loadConfigFile( const QString & configFile ) #elif defined(LMMS_BUILD_APPLE) m_stkDir = qApp->applicationDirPath() + "/../share/stk/rawwaves/"; #else - m_stkDir = "/usr/share/stk/rawwaves/"; + if ( qApp->applicationDirPath().startsWith("/tmp/") ) + { + // Assume AppImage bundle + m_stkDir = qApp->applicationDirPath() + "/../share/stk/rawwaves/"; + } + else + { + // Fallback to system provided location + m_stkDir = "/usr/share/stk/rawwaves/"; + } #endif } #endif