diff --git a/.github/workflows/Linux-pack.yml b/.github/workflows/Linux-pack.yml index f126c7e7..96eb4062 100644 --- a/.github/workflows/Linux-pack.yml +++ b/.github/workflows/Linux-pack.yml @@ -483,12 +483,11 @@ jobs: APPIMAGETOOL_ARCH: x86_64 - name: Packaging appimage run: | - sed -i 's|Exec=/usr/bin/flameshot|Exec=flameshot|g' data/desktopEntry/package/org.flameshot.Flameshot.desktop APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir mkdir -p ${APPIMAGE_DST_PATH} cd $GITHUB_WORKSPACE - cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr + cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr -DUSE_LAUNCHER_ABSOLUTE_PATH:BOOL=OFF make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install $GITHUB_WORKSPACE/appimagetool -s deploy ${APPIMAGE_DST_PATH}/usr/share/applications/org.flameshot.Flameshot.desktop diff --git a/CMakeLists.txt b/CMakeLists.txt index 8aebf527..fa563220 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,9 @@ set(RUN_IN_PLACE CACHE BOOL "Run directly in source directory structure") option(GENERATE_TS "Regenerate translation source files" OFF) +option(USE_EXTERNAL_SINGLEAPPLICATION "Use external QtSingleApplication library" OFF) +option(USE_EXTERNAL_SPDLOG "Use external spdlog library" OFF) +option(USE_LAUNCHER_ABSOLUTE_PATH "Use absolute path for the desktop launcher" ON) include(cmake/StandardProjectSettings.cmake) diff --git a/data/desktopEntry/package/org.flameshot.Flameshot.desktop b/data/desktopEntry/package/org.flameshot.Flameshot.desktop index b0d9b538..a726f6b6 100644 --- a/data/desktopEntry/package/org.flameshot.Flameshot.desktop +++ b/data/desktopEntry/package/org.flameshot.Flameshot.desktop @@ -37,7 +37,7 @@ Keywords[nl_NL]=flameshot;schermfoto;screenshot;schermafdruk;vastleggen;schermop Keywords[es]=flameshot;screenshot;capture;shutter;captura; Keywords[de]=flameshot;screenshot;Bildschirmfoto;Aufnahme; Keywords[pt_BR]=flameshot;screenshot;captura de tela;captura;shutter; -Exec=/usr/bin/flameshot +Exec=@LAUNCHER_EXECUTABLE@ Icon=org.flameshot.Flameshot Terminal=false Type=Application diff --git a/data/snap/snapcraft.yaml b/data/snap/snapcraft.yaml index a737fc9b..ab9b5f24 100644 --- a/data/snap/snapcraft.yaml +++ b/data/snap/snapcraft.yaml @@ -51,6 +51,7 @@ parts: configflags: - '-DCMAKE_BUILD_TYPE=RelWithDebInfo' - '-DCMAKE_INSTALL_PREFIX=/usr' + - '-DUSE_LAUNCHER_ABSOLUTE_PATH:BOOL=OFF' source: https://github.com/flameshot-org/flameshot.git source-type: git override-pull: | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d57ea93e..78d4afee 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -237,6 +237,12 @@ endforeach () include(GNUInstallDirs) set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/Flameshot) +if(USE_LAUNCHER_ABSOLUTE_PATH) + set(LAUNCHER_EXECUTABLE "${CMAKE_INSTALL_FULL_BINDIR}/flameshot") +else() + set(LAUNCHER_EXECUTABLE "flameshot") +endif() + # Install binary install(TARGETS flameshot EXPORT flameshot-targets @@ -245,7 +251,7 @@ install(TARGETS flameshot # Install desktop files, completion and dbus files configure_file(${CMAKE_SOURCE_DIR}/data/desktopEntry/package/org.flameshot.Flameshot.desktop - ${CMAKE_CURRENT_BINARY_DIR}/share/applications/org.flameshot.Flameshot.desktop COPYONLY) + ${CMAKE_CURRENT_BINARY_DIR}/share/applications/org.flameshot.Flameshot.desktop @ONLY) configure_file(${CMAKE_SOURCE_DIR}/data/appdata/org.flameshot.Flameshot.metainfo.xml ${CMAKE_CURRENT_BINARY_DIR}/share/metainfo/org.flameshot.Flameshot.metainfo.xml COPYONLY)