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/CMakeLists.txt b/CMakeLists.txt index a0306c5c273..044afcb1191 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,6 +152,9 @@ IF(WANT_QT5) Qt5::Xml ) + # 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) ELSE() @@ -424,7 +427,11 @@ IF(WANT_VST) FIND_PACKAGE(Wine) IF(WINE_FOUND) SET(LMMS_SUPPORT_VST TRUE) - SET(STATUS_VST "OK") + IF(WINE_LIBRARY_FIX) + SET(STATUS_VST "OK, with workaround linking ${WINE_LIBRARY_FIX}") + ELSE() + SET(STATUS_VST "OK") + ENDIF() ELSEIF(WANT_VST_NOWINE) SET(LMMS_SUPPORT_VST TRUE) SET(STATUS_VST "OK") diff --git a/cmake/linux/CMakeLists.txt b/cmake/linux/CMakeLists.txt index 78a7c541ab5..87f4194057b 100644 --- a/cmake/linux/CMakeLists.txt +++ b/cmake/linux/CMakeLists.txt @@ -1,4 +1,19 @@ -INSTALL(FILES lmms.png DESTINATION "${DATA_DIR}/pixmaps") -INSTALL(FILES lmms DESTINATION "${DATA_DIR}/menu") +INSTALL(FILES lmms.svg DESTINATION "${DATA_DIR}/icons/hicolor/scalable/apps") +INSTALL(FILES project.svg DESTINATION "${DATA_DIR}/icons/hicolor/scalable/mimetypes/" RENAME "application-x-lmms-project.svg") INSTALL(FILES lmms.desktop DESTINATION "${DATA_DIR}/applications") INSTALL(FILES lmms.xml DESTINATION "${DATA_DIR}/mime/packages") + +# AppImage creation target +SET(APPIMAGE_FILE "${CMAKE_BINARY_DIR}/${CMAKE_PROJECT_NAME}-${VERSION}-linux-${CMAKE_SYSTEM_PROCESSOR}.AppImage") + +CONFIGURE_FILE("package_linux.sh.in" "${CMAKE_BINARY_DIR}/package_linux.sh" @ONLY) + +FILE(REMOVE "${APPIMAGE_FILE}") +ADD_CUSTOM_TARGET(removeappimage + COMMAND rm -f "${APPIMAGE_FILE}" + COMMENT "Removing old AppImage") +ADD_CUSTOM_TARGET(appimage + COMMAND chmod +x "${CMAKE_BINARY_DIR}/package_linux.sh" + COMMAND "${CMAKE_BINARY_DIR}/package_linux.sh" + COMMENT "Generating AppImage") +ADD_DEPENDENCIES(appimage removeappimage) diff --git a/cmake/linux/lmms b/cmake/linux/lmms index 27488618506..884f0fed4b2 100644 --- a/cmake/linux/lmms +++ b/cmake/linux/lmms @@ -1,4 +1,4 @@ ?package(lmms):needs="X11" section="Apps/Sound" \ title="LMMS" hints="Audio" command="/usr/bin/lmms" \ longtitle="LMMS" \ - icon="/usr/share/pixmaps/lmms.png" + icon="/usr/share/icons/hicolor/scalable/apps/lmms.svg" diff --git a/cmake/linux/lmms.desktop b/cmake/linux/lmms.desktop index 0d236d446d3..4f8000d29a8 100644 --- a/cmake/linux/lmms.desktop +++ b/cmake/linux/lmms.desktop @@ -1,10 +1,10 @@ [Desktop Entry] Name=LMMS -GenericName=music production suite +GenericName=Music production suite GenericName[ca]=Programari de producció musical GenericName[de]=Software zur Musik-Produktion GenericName[fr]=Ensemble pour la production musicale -Comment=easy music production for everyone! +Comment=Music sequencer and synthesizer Comment[ca]=Producció fàcil de música per a tothom! Comment[fr]=Production facile de musique pour tout le monde ! Icon=lmms diff --git a/cmake/linux/lmms.svg b/cmake/linux/lmms.svg new file mode 100644 index 00000000000..ffe6976ce96 --- /dev/null +++ b/cmake/linux/lmms.svg @@ -0,0 +1,1540 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cmake/linux/lmms.xml b/cmake/linux/lmms.xml index 01675156053..579c3f12fdc 100644 --- a/cmake/linux/lmms.xml +++ b/cmake/linux/lmms.xml @@ -4,11 +4,7 @@ LMMS project Projecte LMMS - - - - - + diff --git a/cmake/linux/package_linux.sh.in b/cmake/linux/package_linux.sh.in new file mode 100644 index 00000000000..275baba351b --- /dev/null +++ b/cmake/linux/package_linux.sh.in @@ -0,0 +1,170 @@ +#!/usr/bin/env bash +# Creates Linux ".AppImage" for @PROJECT_NAME_UCASE@ +# +# Depends: linuxdeployqt +# +# Notes: Will attempt to fetch linuxdeployqt automatically (x86_64 only) +# See Also: https://github.com/probonopd/linuxdeployqt/blob/master/BUILDING.md + +set -e + +USERBIN="$HOME/bin" +LINUXDEPLOYQT="$USERBIN/linuxdeployqt" +APPIMAGETOOL="$USERBIN/appimagetool" +VERBOSITY=2 # 3=debug +LOGFILE="@CMAKE_BINARY_DIR@/appimage.log" +APPDIR="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.AppDir/" +DESKTOPFILE="${APPDIR}usr/share/applications/lmms.desktop" +STRIP="" + +# Don't strip for Debug|RelWithDebInfo builds +if [[ "@CMAKE_BUILD_TYPE@" == *"Deb"* ]]; then + STRIP="-no-strip" +fi + +# Console colors +RED="\\x1B[1;31m" +GREEN="\\x1B[1;32m" +YELLOW="\\x1B[1;33m" +PLAIN="\\x1B[0m" + +function error { + echo -e " ${PLAIN}[${RED}error${PLAIN}] ${1}" + return 1 +} + +function success { + echo -e " ${PLAIN}[${GREEN}success${PLAIN}] ${1}" +} + +function skipped { + echo -e " ${PLAIN}[${YELLOW}skipped${PLAIN}] ${1}" +} + + +# Check for problematic install locations +INSTALL=$(echo "@CMAKE_INSTALL_PREFIX@" | sed 's/\/*$//g') +if [ "$INSTALL" == "/usr/local" ] || [ "$INSTALL" == "/usr" ] ; then + error "Incompatible CMAKE_INSTALL_PREFIX for creating AppImage: @CMAKE_INSTALL_PREFIX@" +fi + +echo -e "\nWriting verbose output to \"${LOGFILE}\"" + +# Ensure linuxdeployqt uses the same qmake version as cmake +export PATH="$(dirname "@QT_QMAKE_EXECUTABLE@")":$PATH + +# Fetch portable linuxdeployqt if cache is older than $DAYSOLD +echo -e "\nDownloading linuxdeployqt to ${LINUXDEPLOYQT}..." +mkdir -p "$HOME/bin" +DAYSOLD=2 +if env -i which linuxdeployqt > /dev/null 2>&1; then + skipped "System already provides this utility" +elif ! find "$LINUXDEPLOYQT" -mtime -$DAYSOLD 2>/dev/null|grep -q "." > /dev/null 2>&1; then + url="https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-$(uname -p).AppImage" + echo " [.......] Couldn't find linuxdeployqt newer than $DAYSOLD days old" + echo " [.......] Downloading ($(uname -p)): ${url}" + wget "$url" -O "$LINUXDEPLOYQT" -q || (rm "$LINUXDEPLOYQT" && false) + chmod +x "$LINUXDEPLOYQT" + touch "$LINUXDEPLOYQT" + success "Downloaded $LINUXDEPLOYQT" + "$LINUXDEPLOYQT" --appimage-extract > /dev/null 2>&1 + mv "squashfs-root/usr/bin/appimagetool" "$APPIMAGETOOL" + success "Extracted $APPIMAGETOOL" + mv "squashfs-root/usr/bin/mksquashfs" "$USERBIN/mksquashfs" + success "Extracted $USERBIN/mksquashfs" + rm -rf "squashfs-root/" + +else + skipped "$LINUXDEPLOYQT is less than $DAYSOLD days old" +fi + +# Make skeleton AppDir +echo -e "\nCreating ${APPDIR}..." +rm -rf "${APPDIR}" +mkdir -p "${APPDIR}usr" +success "Created ${APPDIR}" + +# Clone install to AppDir +echo -e "\nCopying @CMAKE_INSTALL_PREFIX@ to ${APPDIR}..." +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 +cat >"${APPDIR}usr/bin/lmms" < /dev/null 2>&1; then + echo "VirtualBox detected. Forcing libgl software rendering." + export LIBGL_ALWAYS_SOFTWARE=1; +fi +QT_X11_NO_NATIVE_MENUBAR=1 QT_AUTO_SCREEN_SCALE_FACTOR=1 \$DIR/usr/bin/lmms.real "\$@" +EOL + +chmod +x "${APPDIR}usr/bin/lmms" + +# Per https://github.com/probonopd/linuxdeployqt/issues/129 +unset LD_LIBRARY_PATH + +# Ensure linuxdeployqt can find shared objects +export LD_LIBRARY_PATH="${APPDIR}usr/lib/lmms/":$LD_LIBRARY_PATH + +# Handle wine linking +if [ -d "@WINE_LIBRARY_FIX@" ]; then + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@WINE_LIBRARY_FIX@:@WINE_LIBRARY_FIX@wine/ +fi + +# Move executables so linuxdeployqt can find them +ZYNLIB="${APPDIR}usr/lib/lmms/RemoteZynAddSubFx" +VSTLIB="${APPDIR}usr/lib/lmms/RemoteVstPlugin.exe.so" + +ZYNBIN="${APPDIR}usr/bin/RemoteZynAddSubFx" +VSTBIN="${APPDIR}usr/bin/RemoteVstPlugin.exe.so" + +mv "$ZYNLIB" "$ZYNBIN" +mv "$VSTLIB" "$VSTBIN" + +# Patch the desktop file +sed -i 's/.*Exec=.*/Exec=lmms.real/' "$DESKTOPFILE" + +# Fix linking for soft-linked plugins +for file in "${APPDIR}usr/lib/lmms/"*.so; do + thisfile="${APPDIR}usr/lib/lmms/${file##*/}" + executables="${executables} -executable=$thisfile" +done +executables="${executables} -executable=${ZYNBIN}" +executables="${executables} -executable=${VSTBIN}" +executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imp_1199.so" +executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imbeq_1197.so" +executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1193.so" +executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1194.so" + +# Bundle both qt and non-qt dependencies into appimage format +echo -e "\nBundling and relinking system dependencies..." +echo -e ">>>>> linuxdeployqt" > "$LOGFILE" +# shellcheck disable=SC2086 +"$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1 +success "Bundled and relinked dependencies" + +# Link to original location so lmms can find them +ln -sr "$ZYNBIN" "$ZYNLIB" +ln -sr "$VSTBIN" "$VSTLIB" + +# Remove wine library conflict +rm -f "${APPDIR}/usr/lib/libwine.so.1" + +# Create AppImage +echo -e "\nFinishing the AppImage..." +echo -e "\n\n>>>>> appimagetool" >> "$LOGFILE" +"$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@" >> "$LOGFILE" 2>&1 +success "Created @APPIMAGE_FILE@" + +echo -e "\nFinished" diff --git a/data/application-x-lmms-project.svg b/cmake/linux/project.svg similarity index 100% rename from data/application-x-lmms-project.svg rename to cmake/linux/project.svg diff --git a/cmake/modules/FindWine.cmake b/cmake/modules/FindWine.cmake index da76f3ff338..47850dcd111 100644 --- a/cmake/modules/FindWine.cmake +++ b/cmake/modules/FindWine.cmake @@ -7,6 +7,8 @@ # WINE_DEFINITIONS - Compiler switches required for using wine # +LIST(APPEND CMAKE_PREFIX_PATH /opt/wine-stable /opt/wine-devel /opt/wine-staging) + FIND_PATH(WINE_INCLUDE_DIR windows/windows.h PATH_SUFFIXES wine) FIND_LIBRARY(WINE_LIBRARY NAMES wine PATH_SUFFIXES wine i386-linux-gnu/wine) FIND_PROGRAM(WINE_CXX NAMES wineg++ winegcc winegcc64 winegcc32) @@ -14,6 +16,26 @@ FIND_PROGRAM(WINE_CXX NAMES wineg++ winegcc winegcc64 winegcc32) set(WINE_INCLUDE_DIRS ${WINE_INCLUDE_DIR} ) set(WINE_LIBRARIES ${WINE_LIBRARY} ) +# Handle wine linking problems +EXEC_PROGRAM(${WINE_CXX} ARGS "-v -m32 /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT) + +# Debian systems +IF("${WINEBUILD_OUTPUT}" MATCHES ".*x86_64-linux-gnu/wine/libwinecrt0.a.*") + SET(WINE_LIBRARY_FIX "/usr/lib/i386-linux-gnu/" ) +# Fedora systems +ELSEIF("${WINEBUILD_OUTPUT}" MATCHES "/usr/lib/lib64/wine/libwinecrt0.a.*") + SET(WINE_LIBRARY_FIX "/usr/lib/i386/") +# Wine stable +ELSEIF("${WINEBUILD_OUTPUT}" MATCHES "/opt/wine-stable/lib64/wine/libwinecrt0.a.*") + SET(WINE_LIBRARY_FIX "/opt/wine-stable/lib/") +# Wine development +ELSEIF("${WINEBUILD_OUTPUT}" MATCHES "/opt/wine-devel/lib64/wine/libwinecrt0.a.*") + SET(WINE_LIBRARY_FIX "/opt/wine-devel/lib/") +# Wine staging +ELSEIF("${WINEBUILD_OUTPUT}" MATCHES "/opt/wine-staging/lib64/wine/libwinecrt0.a.*") + SET(WINE_LIBRARY_FIX "/opt/wine-staging/lib/") +ENDIF() + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Wine DEFAULT_MSG WINE_LIBRARIES WINE_INCLUDE_DIRS) diff --git a/plugins/LadspaEffect/CMakeLists.txt b/plugins/LadspaEffect/CMakeLists.txt index 8ab9685c74d..029cd9168b5 100644 --- a/plugins/LadspaEffect/CMakeLists.txt +++ b/plugins/LadspaEffect/CMakeLists.txt @@ -2,6 +2,10 @@ INCLUDE(BuildPlugin) # Disable C++11 REMOVE_DEFINITIONS(-std=c++0x) +# Enable C++11 for CXXFLAGS only and not for Windows +IF(NOT LMMS_BUILD_WIN32) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +ENDIF() BUILD_PLUGIN(ladspaeffect LadspaEffect.cpp LadspaControls.cpp LadspaControlDialog.cpp LadspaSubPluginFeatures.cpp LadspaEffect.h LadspaControls.h LadspaControlDialog.h LadspaSubPluginFeatures.h MOCFILES LadspaEffect.h LadspaControls.h LadspaControlDialog.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") diff --git a/plugins/papu/CMakeLists.txt b/plugins/papu/CMakeLists.txt index b45fcf61472..20d9bbd2033 100644 --- a/plugins/papu/CMakeLists.txt +++ b/plugins/papu/CMakeLists.txt @@ -1,6 +1,3 @@ INCLUDE(BuildPlugin) -# Disable C++11 -REMOVE_DEFINITIONS(-std=c++0x) - BUILD_PLUGIN(papu papu_instrument.cpp papu_instrument.h Basic_Gb_Apu.cpp Basic_Gb_Apu.h gb_apu/Gb_Oscs.cpp gb_apu/Gb_Apu.h gb_apu/Blip_Buffer.cpp gb_apu/Gb_Apu.cpp gb_apu/Gb_Oscs.h gb_apu/blargg_common.h gb_apu/Blip_Buffer.h gb_apu/Multi_Buffer.cpp gb_apu/blargg_source.h gb_apu/Multi_Buffer.h MOCFILES papu_instrument.h EMBEDDED_RESOURCES "${CMAKE_CURRENT_SOURCE_DIR}/*.png") diff --git a/plugins/vst_base/CMakeLists.txt b/plugins/vst_base/CMakeLists.txt index a9a8088411b..a3f919adf31 100644 --- a/plugins/vst_base/CMakeLists.txt +++ b/plugins/vst_base/CMakeLists.txt @@ -33,30 +33,32 @@ IF(LMMS_BUILD_LINUX AND NOT WANT_VST_NOWINE) IF(LMMS_HOST_X86_64) SET(EXTRA_FLAGS -m32) - - # workaround for broken wineg++ in WINE 1.4 (shipped e.g. with Ubuntu Precise) - EXEC_PROGRAM( ${WINE_CXX} ARGS "-v -m32 /dev/zero" OUTPUT_VARIABLE WINEBUILD_OUTPUT) - IF("${WINEBUILD_OUTPUT}" MATCHES ".*x86_64-linux-gnu/wine/libwinecrt0.a.*") - SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs /usr/lib/i386-linux-gnu/wine/libwinecrt0.a -L/usr/lib/i386-linux-gnu/wine/ -luser32 -lkernel32 -lgdi32) - ENDIF() - #The following check works on Fedora systems - IF("${WINEBUILD_OUTPUT}" MATCHES ".*lib64/wine/libwinecrt0.a.*") - SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs /usr/lib/i386/wine/libwinecrt0.a -luser32 -lkernel32 -lgdi32) + IF(WINE_LIBRARY_FIX) + SET(EXTRA_FLAGS ${EXTRA_FLAGS} -nodefaultlibs ${WINE_LIBRARY_FIX}wine/libwinecrt0.a -L${WINE_LIBRARY_FIX}wine/ -luser32 -lkernel32 -lgdi32) ENDIF() ENDIF(LMMS_HOST_X86_64) SET(WINE_CXX_FLAGS "" CACHE STRING "Extra flags passed to wineg++") +STRING(REPLACE "include/wine" "include" WINE_INCLUDE_BASE_DIR ${WINE_INCLUDE_DIR}) +STRING(REPLACE "lib/libwine.so" "lib" WINE_LIBRARY_DIR ${WINE_LIBRARY}) STRING(REPLACE " " ";" WINE_BUILD_FLAGS ${CMAKE_CXX_FLAGS} " " ${CMAKE_EXE_LINKER_FLAGS} " " ${WINE_CXX_FLAGS}) ADD_CUSTOM_COMMAND( - SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp" - COMMAND ${WINE_CXX} - ARGS -I${CMAKE_BINARY_DIR} -I${CMAKE_SOURCE_DIR}/include -I${CMAKE_INSTALL_PREFIX}/include/wine/windows -I${CMAKE_INSTALL_PREFIX}/include -I/usr/include/wine/windows ${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp -ansi -mwindows -lpthread ${EXTRA_FLAGS} -fno-omit-frame-pointer ${WINE_BUILD_FLAGS} -o ../RemoteVstPlugin - # Ensure correct file extension - COMMAND sh -c "mv ../RemoteVstPlugin.exe ../RemoteVstPlugin || true" - TARGET vstbase - OUTPUTS ../RemoteVstPlugin - ) + SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp" + COMMAND ${WINE_CXX} + ARGS -I${CMAKE_BINARY_DIR} + -I${CMAKE_SOURCE_DIR}/include + -I${WINE_INCLUDE_BASE_DIR} + -L${WINE_LIBRARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp + -ansi -mwindows -lpthread ${EXTRA_FLAGS} -fno-omit-frame-pointer + ${WINE_BUILD_FLAGS} + -o ../RemoteVstPlugin + # Ensure correct file extension + COMMAND sh -c "mv ../RemoteVstPlugin.exe ../RemoteVstPlugin || true" + TARGET vstbase + OUTPUTS ../RemoteVstPlugin +) SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES ../RemoteVstPlugin.exe.so) INSTALL(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin" "${CMAKE_CURRENT_BINARY_DIR}/../RemoteVstPlugin.exe.so" DESTINATION "${PLUGIN_DIR}") 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