From 756fa6b0f90e7cad3b4a24f543bc2ded4804de21 Mon Sep 17 00:00:00 2001 From: Sushi Fish Date: Wed, 14 Feb 2024 10:15:59 +0100 Subject: [PATCH 01/33] added waylandcompositor plugin deployer --- src/deployers/CMakeLists.txt | 1 + src/deployers/PluginsDeployerFactory.cpp | 5 +++ .../WaylandcompositorPluginsDeployer.cpp | 38 +++++++++++++++++++ .../WaylandcompositorPluginsDeployer.h | 17 +++++++++ 4 files changed, 61 insertions(+) create mode 100644 src/deployers/WaylandcompositorPluginsDeployer.cpp create mode 100644 src/deployers/WaylandcompositorPluginsDeployer.h diff --git a/src/deployers/CMakeLists.txt b/src/deployers/CMakeLists.txt index 40e2429..0833e05 100644 --- a/src/deployers/CMakeLists.txt +++ b/src/deployers/CMakeLists.txt @@ -21,6 +21,7 @@ set(CLASSES PrintSupportPluginsDeployer TextToSpeechPluginsDeployer TlsBackendsDeployer + WaylandcompositorPluginsDeployer ) # TODO: CMake <= 3.7 (at least!) doesn't allow for using OBJECT libraries with target_link_libraries diff --git a/src/deployers/PluginsDeployerFactory.cpp b/src/deployers/PluginsDeployerFactory.cpp index 72ea048..ea88ec2 100644 --- a/src/deployers/PluginsDeployerFactory.cpp +++ b/src/deployers/PluginsDeployerFactory.cpp @@ -17,6 +17,7 @@ #include "WebEnginePluginsDeployer.h" #include "XcbglIntegrationPluginsDeployer.h" #include "TlsBackendsDeployer.h" +#include "WaylandcompositorPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::appdir; @@ -103,6 +104,10 @@ std::vector> PluginsDeployerFactory::getDeploye return {getInstance(moduleName)}; } + if (moduleName == "waylandcompositor") { + return {getInstance(moduleName)}; + } + // fallback return {getInstance(moduleName)}; } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.cpp b/src/deployers/WaylandcompositorPluginsDeployer.cpp new file mode 100644 index 0000000..3a0e667 --- /dev/null +++ b/src/deployers/WaylandcompositorPluginsDeployer.cpp @@ -0,0 +1,38 @@ +// system headers +#include + +// library headers +#include + +// local headers +#include "WaylandcompositorPluginsDeployer.h" + +using namespace linuxdeploy::plugin::qt; +using namespace linuxdeploy::core::log; + +namespace fs = std::filesystem; + +bool WaylandcompositorPluginsDeployer::deploy() { + // calling the default code is optional, but it won't hurt for now + if (!BasicPluginsDeployer::deploy()) + return false; + + ldLog() << "Deploying waylandcompositor plugin" << std::endl; + + for (fs::directory_iterator i(qtPluginsPath / "wayland-decoration-client"); i != fs::directory_iterator(); ++i) { + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-decoration-client/")) + return false; + } + + for (fs::directory_iterator i(qtPluginsPath / "wayland-graphics-integration-client"); i != fs::directory_iterator(); ++i) { + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-graphics-integration-client/")) + return false; + } + + for (fs::directory_iterator i(qtPluginsPath / "wayland-shell-integration"); i != fs::directory_iterator(); ++i) { + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-shell-integration/")) + return false; + } + + return true; +} diff --git a/src/deployers/WaylandcompositorPluginsDeployer.h b/src/deployers/WaylandcompositorPluginsDeployer.h new file mode 100644 index 0000000..3840002 --- /dev/null +++ b/src/deployers/WaylandcompositorPluginsDeployer.h @@ -0,0 +1,17 @@ +#pragma once + +#include "BasicPluginsDeployer.h" + +namespace linuxdeploy { + namespace plugin { + namespace qt { + class WaylandcompositorPluginsDeployer : public BasicPluginsDeployer { + public: + // we can just use the base class's constructor + using BasicPluginsDeployer::BasicPluginsDeployer; + + bool deploy() override; + }; + } + } +} From 254471528b5a3bc3d853f25dbd2807bb3aa0ad40 Mon Sep 17 00:00:00 2001 From: Slawomir Grabowski Date: Wed, 24 Apr 2024 12:28:27 +0200 Subject: [PATCH 02/33] Adding missing include for CMake FetchContent_Declare command --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 108ef11..c17bf52 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ find_package(nlohmann_json) if(NOT nlohmann_json_FOUND) message(STATUS "nlohmann_json not found on system, fetching from GitHub") + include(FetchContent) FetchContent_Declare( nlohmann_json GIT_REPOSITORY https://github.com/nlohmann/json From 0e7e8ce889c1105373e88e409ea555058673bb1e Mon Sep 17 00:00:00 2001 From: Live session user Date: Wed, 24 Apr 2024 19:39:11 -0700 Subject: [PATCH 03/33] static build --- .github/workflows/main.yml | 28 +++++++++++++++++++++------- ci/build-in-docker.sh | 3 ++- ci/build.sh | 13 ++++++++++++- 3 files changed, 35 insertions(+), 9 deletions(-) mode change 100644 => 100755 ci/build-in-docker.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1bba99e..eac8bd4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,20 +7,34 @@ jobs: strategy: matrix: ARCH: [x86_64, i386, aarch64, armhf] + USE_STATIC_RUNTIME: [""] UPDATE: ["1"] + + include: + # test build + - ARCH: x86_64 + DOCKER_ARCH: amd64 + BUILD_TYPE: coverage + + # experimental build + - ARCH: x86_64 + BUILD_TYPE: appimage + USE_STATIC_RUNTIME: -static + fail-fast: false - name: ${{ matrix.ARCH }} + name: ${{ matrix.ARCH }}${{ matrix.USE_STATIC_RUNTIME }} runs-on: ubuntu-latest env: ARCH: ${{ matrix.ARCH }} BUILD_TYPE: ${{ matrix.BUILD_TYPE }} DEBIAN_FRONTEND: interactive + USE_STATIC_RUNTIME: ${{ matrix.USE_STATIC_RUNTIME }} steps: # check out once git command is available - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -31,10 +45,10 @@ jobs: run: bash ci/build-in-docker.sh - name: Archive artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: AppImage ${{ matrix.ARCH }} - path: linuxdeploy-plugin-qt-${{ matrix.ARCH }}.AppImage* + name: AppImage ${{ matrix.ARCH }}${{ matrix.USE_STATIC_RUNTIME}} + path: linuxdeploy-plugin-qt${{ matrix.USE_STATIC_RUNTIME}}-${{ matrix.ARCH }}.AppImage* upload: name: Create release and upload artifacts @@ -43,7 +57,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Download artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 - name: Inspect directory after downloading artifacts run: ls -alFR - name: Create release and upload artifacts @@ -52,4 +66,4 @@ jobs: run: | wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage chmod +x pyuploadtool-x86_64.AppImage - ./pyuploadtool-x86_64.AppImage **/linuxdeploy-plugin-qt*.AppImage* + ./pyuploadtool-x86_64.AppImage **/linuxdeploy*.AppImage* diff --git a/ci/build-in-docker.sh b/ci/build-in-docker.sh old mode 100644 new mode 100755 index a7f7d9f..3024c5f --- a/ci/build-in-docker.sh +++ b/ci/build-in-docker.sh @@ -107,6 +107,7 @@ run_in_docker() { -i \ --init \ -e GITHUB_RUN_NUMBER \ + -e USE_STATIC_RUNTIME \ -e ARCH \ -e CI \ --user "$uid" \ @@ -118,4 +119,4 @@ run_in_docker() { } run_in_docker bash ci/build.sh -run_in_docker bash ci/test.sh linuxdeploy-plugin-qt-"$ARCH".AppImage +run_in_docker bash ci/test.sh linuxdeploy-plugin-qt"$USE_STATIC_RUNTIME"-"$ARCH".AppImage diff --git a/ci/build.sh b/ci/build.sh index c29edf8..103d555 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -43,6 +43,17 @@ patchelf_path="$(which patchelf)" strip_path="$(which strip)" export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy-plugin-qt|continuous|linuxdeploy-plugin-qt-$ARCH.AppImage" +export OUTPUT="linuxdeploy-plugin-qt-$ARCH.AppImage" + +# special set of builds using a different experimental runtime, used for testing purposes +if [[ "${USE_STATIC_RUNTIME:-}" != "" ]]; then + custom_runtime_url="https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-$ARCH" + wget "$custom_runtime_url" + runtime_filename="$(echo "$custom_runtime_url" | rev | cut -d/ -f1 | rev)" + LDAI_RUNTIME_FILE="$(readlink -f "$runtime_filename")" + export LDAI_RUNTIME_FILE + export OUTPUT="linuxdeploy-plugin-qt-static-$ARCH.AppImage" +fi wget "https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-$ARCH.AppImage" # qemu is not happy about the AppImage type 2 magic bytes, so we need to "fix" that @@ -56,4 +67,4 @@ chmod +x linuxdeploy*.AppImage -e "$strip_path" \ --output appimage -mv linuxdeploy-plugin-qt-"$ARCH".AppImage* "$OLD_CWD"/ +mv "$OUTPUT"* "$OLD_CWD"/ From babb58d052d42e09f34af116e4d7279bb5488b5c Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Thu, 16 May 2024 00:13:28 +0200 Subject: [PATCH 04/33] Return exit code 0 for --help Fixes #170. --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 78b0655..5076d6a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,6 +34,8 @@ int main(const int argc, const char *const *const argv) { args::ArgumentParser parser("linuxdeploy Qt plugin", "Bundles Qt resources. For use with an existing AppDir, created by linuxdeploy."); + args::HelpFlag help(parser, "help", "Display this help text", {'h', "help"}); + args::ValueFlag appDirPath(parser, "appdir path", "Path to an existing AppDir", {"appdir"}); args::ValueFlagList extraPlugins(parser, "plugin", "Extra Qt plugin to deploy (specified by name, filename or path)", @@ -46,6 +48,9 @@ int main(const int argc, const char *const *const argv) { try { parser.ParseCLI(argc, argv); + } catch (const args::Help &) { + std::cerr << parser; + return 0; } catch (const args::ParseError &) { std::cerr << parser; return 1; From bcd597c817336eac688c1e316def1d20d3dec352 Mon Sep 17 00:00:00 2001 From: Rihards Skuja Date: Wed, 22 May 2024 10:40:04 +0300 Subject: [PATCH 05/33] Add missing Qt5 Wayland modules Fixes ignored "export EXTRA_QT_PLUGINS="waylandcompositor"" --- src/qt-modules.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qt-modules.h b/src/qt-modules.h index 2741bb6..36246f7 100644 --- a/src/qt-modules.h +++ b/src/qt-modules.h @@ -70,6 +70,8 @@ static const std::vector Qt5Modules = { {"svg", "libQt5Svg", ""}, {"test", "libQt5Test", "qtbase"}, {"texttospeech", "libQt5TextToSpeech", ""}, + {"waylandclient", "libQt5WaylandClient", ""}, + {"waylandcompositor", "libQt5WaylandCompositor", ""}, {"webchannel", "libQt5WebChannel", ""}, {"webenginecore", "libQt5WebEngineCore", ""}, {"webengine", "libQt5WebEngine", "qtwebengine"}, From d23999a64ec75936c7829f143948f7825fd9ffe7 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Wed, 12 Jun 2024 10:48:05 -0300 Subject: [PATCH 06/33] Rename EXTRA_QT_PLUGINS to EXTRA_QT_MODULES Fixes: #121 --- README.md | 4 ++-- src/main.cpp | 31 ++++++++++++++++++++----------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 9780f80..bd11994 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,8 @@ Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured so **Qt specific:** - `$QMAKE=/path/to/my/qmake`: use another `qmake` binary to detect paths of plugins and other resources (usually doesn't need to be set manually, most Qt environments ship scripts changing `$PATH`) -- `$EXTRA_QT_PLUGINS=pluginA;pluginB`: Plugins to deploy even if not found automatically by linuxdeploy-plugin-qt - - example: `EXTRA_QT_PLUGINS=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html) +- `$EXTRA_QT_MODULES=moduleA;moduleB`: Modules to deploy even if not found automatically by linuxdeploy-plugin-qt + - example: `EXTRA_QT_MODULES=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html) - `$EXTRA_PLATFORM_PLUGINS=platformA;platformB`: Platforms to deploy in addition to `libqxcb.so`. Platform must be available from `QT_INSTALL_PLUGINS/platforms`. QML related: diff --git a/src/main.cpp b/src/main.cpp index 5076d6a..9f0ca45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,9 +37,9 @@ int main(const int argc, const char *const *const argv) { args::HelpFlag help(parser, "help", "Display this help text", {'h', "help"}); args::ValueFlag appDirPath(parser, "appdir path", "Path to an existing AppDir", {"appdir"}); - args::ValueFlagList extraPlugins(parser, "plugin", - "Extra Qt plugin to deploy (specified by name, filename or path)", - {'p', "extra-plugin"}); + args::ValueFlagList extraModules(parser, "module", + "Extra Qt module to deploy (specified by name, filename or path)", + {'m', "extra-module"}); args::Flag pluginType(parser, "", "Print plugin type and exit", {"plugin-type"}); args::Flag pluginApiVersion(parser, "", "Print plugin API version and exit", {"plugin-api-version"}); @@ -199,18 +199,27 @@ int main(const int argc, const char *const *const argv) { }) != libraryNames.end(); }); - std::vector extraPluginsFromEnv; - const auto* const extraPluginsFromEnvData = getenv("EXTRA_QT_PLUGINS"); - if (extraPluginsFromEnvData != nullptr) - extraPluginsFromEnv = linuxdeploy::util::split(std::string(extraPluginsFromEnvData), ';'); + std::vector extraModulesFromEnv; + const auto* const extraModulesFromEnvData = []() -> char* { + auto* ret = getenv("EXTRA_QT_MODULES"); + if (ret == nullptr) { + ret = getenv("EXTRA_QT_PLUGINS"); + if (ret) { + ldLog() << std::endl << LD_WARNING << "Using deprecated EXTRA_QT_PLUGINS env var" << std::endl; + } + } + return ret; + }(); + if (extraModulesFromEnvData != nullptr) + extraModulesFromEnv = linuxdeploy::util::split(std::string(extraModulesFromEnvData), ';'); - for (const auto& pluginsList : {static_cast>(extraPlugins.Get()), extraPluginsFromEnv}) { + for (const auto& modulesList : {static_cast>(extraModules.Get()), extraModulesFromEnv}) { std::copy_if(qtModules.begin(), qtModules.end(), std::back_inserter(extraQtModules), - [&matchesQtModule, &libraryNames, &pluginsList](const QtModule &module) { - return std::find_if(pluginsList.begin(), pluginsList.end(), + [&matchesQtModule, &libraryNames, &modulesList](const QtModule &module) { + return std::find_if(modulesList.begin(), modulesList.end(), [&matchesQtModule, &module](const std::string &libraryName) { return matchesQtModule(libraryName, module); - }) != pluginsList.end(); + }) != modulesList.end(); } ); } From 342a5b1aba275e5dc330401a8ac277531666fd50 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 3 Aug 2024 01:54:49 +0200 Subject: [PATCH 07/33] Fix static build test --- ci/build-in-docker.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/build-in-docker.sh b/ci/build-in-docker.sh index 3024c5f..ee0038e 100755 --- a/ci/build-in-docker.sh +++ b/ci/build-in-docker.sh @@ -118,5 +118,10 @@ run_in_docker() { "$@" } +filename_suffix= +if [[ "$USE_STATIC_RUNTIME" != "" ]]; then + filename_suffix="-static" +fi + run_in_docker bash ci/build.sh -run_in_docker bash ci/test.sh linuxdeploy-plugin-qt"$USE_STATIC_RUNTIME"-"$ARCH".AppImage +run_in_docker bash ci/test.sh linuxdeploy-plugin-qt"$filename_suffix"-"$ARCH".AppImage From ecc4a9d19ddc7c10fc4ae6f272ef6e9dfeadf7bd Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Sat, 3 Aug 2024 01:54:59 +0200 Subject: [PATCH 08/33] Fix static build's runtime URL --- ci/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build.sh b/ci/build.sh index 103d555..4420154 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -47,7 +47,7 @@ export OUTPUT="linuxdeploy-plugin-qt-$ARCH.AppImage" # special set of builds using a different experimental runtime, used for testing purposes if [[ "${USE_STATIC_RUNTIME:-}" != "" ]]; then - custom_runtime_url="https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-$ARCH" + custom_runtime_url="https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-fuse3-$ARCH" wget "$custom_runtime_url" runtime_filename="$(echo "$custom_runtime_url" | rev | cut -d/ -f1 | rev)" LDAI_RUNTIME_FILE="$(readlink -f "$runtime_filename")" From 2826ee58bed014a6328d4f80257248b5830ef4d4 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Wed, 12 Jun 2024 22:01:25 -0300 Subject: [PATCH 09/33] Deduplicate Qt plugins deployment --- src/deployers/BasicPluginsDeployer.cpp | 18 ++++++++++-- src/deployers/BasicPluginsDeployer.h | 20 ++++++++++++- src/deployers/BearerPluginsDeployer.cpp | 17 ++--------- src/deployers/BearerPluginsDeployer.h | 2 +- src/deployers/GamepadPluginsDeployer.cpp | 17 ++--------- src/deployers/GamepadPluginsDeployer.h | 2 +- src/deployers/LocationPluginsDeployer.cpp | 17 ++--------- src/deployers/LocationPluginsDeployer.h | 2 +- src/deployers/Multimedia5PluginsDeployer.cpp | 24 ++------------- src/deployers/Multimedia5PluginsDeployer.h | 2 +- src/deployers/Multimedia6PluginsDeployer.cpp | 16 ++-------- src/deployers/Multimedia6PluginsDeployer.h | 2 +- src/deployers/PlatformPluginsDeployer.cpp | 20 ++++--------- src/deployers/PlatformPluginsDeployer.h | 3 +- src/deployers/PluginsDeployerFactory.cpp | 4 +-- src/deployers/PositioningPluginsDeployer.cpp | 17 ++--------- src/deployers/PositioningPluginsDeployer.h | 2 +- src/deployers/PrintSupportPluginsDeployer.cpp | 17 ++--------- src/deployers/PrintSupportPluginsDeployer.h | 2 +- src/deployers/QmlPluginsDeployer.cpp | 6 +--- src/deployers/QmlPluginsDeployer.h | 2 +- src/deployers/Qt3DPluginsDeployer.cpp | 22 ++------------ src/deployers/Qt3DPluginsDeployer.h | 2 +- src/deployers/SqlPluginsDeployer.cpp | 17 ++--------- src/deployers/SqlPluginsDeployer.h | 2 +- src/deployers/SvgPluginsDeployer.cpp | 6 +--- src/deployers/SvgPluginsDeployer.h | 2 +- src/deployers/TextToSpeechPluginsDeployer.cpp | 2 +- src/deployers/TextToSpeechPluginsDeployer.h | 2 +- src/deployers/TlsBackendsDeployer.cpp | 17 ++--------- src/deployers/TlsBackendsDeployer.h | 2 +- .../WaylandcompositorPluginsDeployer.cpp | 29 +++---------------- .../WaylandcompositorPluginsDeployer.h | 2 +- src/deployers/WebEnginePluginsDeployer.cpp | 2 +- src/deployers/WebEnginePluginsDeployer.h | 2 +- .../XcbglIntegrationPluginsDeployer.cpp | 6 +--- .../XcbglIntegrationPluginsDeployer.h | 2 +- 37 files changed, 90 insertions(+), 239 deletions(-) diff --git a/src/deployers/BasicPluginsDeployer.cpp b/src/deployers/BasicPluginsDeployer.cpp index ba927c1..5de1aca 100644 --- a/src/deployers/BasicPluginsDeployer.cpp +++ b/src/deployers/BasicPluginsDeployer.cpp @@ -29,7 +29,21 @@ BasicPluginsDeployer::BasicPluginsDeployer(std::string moduleName, qtDataPath(std::move(qtDataPath)) {} bool BasicPluginsDeployer::deploy() { - // currently this is a no-op, but we might add more functionality later on, such as some kinds of default - // attempts to copy data based on the moduleName + for (const auto &pluginName : qtPluginsToBeDeployed()) { + ldLog() << "Deploying" << pluginName << "plugins" << std::endl; + for (fs::directory_iterator i(qtPluginsPath / pluginName); i != fs::directory_iterator(); ++i) { + if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins" / pluginName)) + return false; + } + } + + return customDeploy(); +} + +bool BasicPluginsDeployer::customDeploy() { return true; } + +std::vector BasicPluginsDeployer::qtPluginsToBeDeployed() const { + return {}; +} diff --git a/src/deployers/BasicPluginsDeployer.h b/src/deployers/BasicPluginsDeployer.h index 1394f53..c6df18c 100644 --- a/src/deployers/BasicPluginsDeployer.h +++ b/src/deployers/BasicPluginsDeployer.h @@ -49,7 +49,25 @@ namespace linuxdeploy { virtual ~BasicPluginsDeployer() = default; public: - bool deploy() override; + /** + * This method deploys the plugins returned by \sa qtPluginsToBeDeployed() + * and call \sa customDeploy() to finalize the deployment. + */ + bool deploy() override final; + + protected: + /** + * The \sa deploy() method can deploy Qt plugins that follow the default + * name and path scheme, but some modules are special so + * they should write custom deployment code. + */ + virtual bool customDeploy(); + + /** + * Returns a list of Qt plugin names that should be deployed and + * follow the default name and path scheme. + */ + virtual std::vector qtPluginsToBeDeployed() const; }; } } diff --git a/src/deployers/BearerPluginsDeployer.cpp b/src/deployers/BearerPluginsDeployer.cpp index 5784060..9aee6dc 100644 --- a/src/deployers/BearerPluginsDeployer.cpp +++ b/src/deployers/BearerPluginsDeployer.cpp @@ -10,19 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool BearerPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying bearer plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "bearer"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/bearer/")) - return false; - } - - return true; +std::vector BearerPluginsDeployer::qtPluginsToBeDeployed() const { + return {"bearer"}; } diff --git a/src/deployers/BearerPluginsDeployer.h b/src/deployers/BearerPluginsDeployer.h index 91a8c77..fb87dd4 100644 --- a/src/deployers/BearerPluginsDeployer.h +++ b/src/deployers/BearerPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/GamepadPluginsDeployer.cpp b/src/deployers/GamepadPluginsDeployer.cpp index 6ebedb7..ae99fcb 100644 --- a/src/deployers/GamepadPluginsDeployer.cpp +++ b/src/deployers/GamepadPluginsDeployer.cpp @@ -10,19 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool GamepadPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying Gamepad plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "gamepads"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/gamepads/")) - return false; - } - - return true; +std::vector GamepadPluginsDeployer::qtPluginsToBeDeployed() const { + return {"gamepads"}; } diff --git a/src/deployers/GamepadPluginsDeployer.h b/src/deployers/GamepadPluginsDeployer.h index a0d28fa..44fd36c 100644 --- a/src/deployers/GamepadPluginsDeployer.h +++ b/src/deployers/GamepadPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/LocationPluginsDeployer.cpp b/src/deployers/LocationPluginsDeployer.cpp index 689f2c8..3948ab5 100644 --- a/src/deployers/LocationPluginsDeployer.cpp +++ b/src/deployers/LocationPluginsDeployer.cpp @@ -10,19 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool LocationPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying Location plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "geoservices"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/geoservices/")) - return false; - } - - return true; +std::vector LocationPluginsDeployer::qtPluginsToBeDeployed() const { + return {"geoservices"}; } diff --git a/src/deployers/LocationPluginsDeployer.h b/src/deployers/LocationPluginsDeployer.h index 645f32c..606dd06 100644 --- a/src/deployers/LocationPluginsDeployer.h +++ b/src/deployers/LocationPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/Multimedia5PluginsDeployer.cpp b/src/deployers/Multimedia5PluginsDeployer.cpp index 0718328..94be8ec 100644 --- a/src/deployers/Multimedia5PluginsDeployer.cpp +++ b/src/deployers/Multimedia5PluginsDeployer.cpp @@ -10,26 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool Multimedia5PluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying mediaservice plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "mediaservice"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/mediaservice/")) - return false; - } - - ldLog() << "Deploying audio plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "audio"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/audio/")) - return false; - } - - return true; +std::vector Multimedia5PluginsDeployer::qtPluginsToBeDeployed() const { + return {"mediaservice", "audio"}; } diff --git a/src/deployers/Multimedia5PluginsDeployer.h b/src/deployers/Multimedia5PluginsDeployer.h index b674ace..89f6908 100644 --- a/src/deployers/Multimedia5PluginsDeployer.h +++ b/src/deployers/Multimedia5PluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/Multimedia6PluginsDeployer.cpp b/src/deployers/Multimedia6PluginsDeployer.cpp index 2ea8fee..b23c1bd 100644 --- a/src/deployers/Multimedia6PluginsDeployer.cpp +++ b/src/deployers/Multimedia6PluginsDeployer.cpp @@ -12,21 +12,11 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool Multimedia6PluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +std::vector Multimedia6PluginsDeployer::qtPluginsToBeDeployed() const { if (fs::exists(qtPluginsPath / "multimedia")) { - ldLog() << "Deploying multimedia plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "multimedia"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/multimedia/")) - return false; - } + return {"multimedia"}; } else { ldLog() << LD_WARNING << "Missing Qt 6 multimedia plugins, skipping." << std::endl; + return {}; } - - return true; } diff --git a/src/deployers/Multimedia6PluginsDeployer.h b/src/deployers/Multimedia6PluginsDeployer.h index 60d61cc..a0e045d 100644 --- a/src/deployers/Multimedia6PluginsDeployer.h +++ b/src/deployers/Multimedia6PluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/PlatformPluginsDeployer.cpp b/src/deployers/PlatformPluginsDeployer.cpp index 5d5076b..abe32c0 100644 --- a/src/deployers/PlatformPluginsDeployer.cpp +++ b/src/deployers/PlatformPluginsDeployer.cpp @@ -13,11 +13,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool PlatformPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool PlatformPluginsDeployer::customDeploy() { ldLog() << "Deploying platform plugins" << std::endl; // always deploy default platform @@ -32,16 +28,6 @@ bool PlatformPluginsDeployer::deploy() { if (!appDir.deployLibrary(qtPluginsPath / "platforms" / platformToDeploy, appDir.path() / "usr/plugins/platforms/")) return false; } - } - - for (fs::directory_iterator i(qtPluginsPath / "platforminputcontexts"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/platforminputcontexts/")) - return false; - } - - for (fs::directory_iterator i(qtPluginsPath / "imageformats"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/imageformats/")) - return false; } // TODO: platform themes -- https://github.com/probonopd/linuxdeployqt/issues/236 @@ -82,3 +68,7 @@ bool PlatformPluginsDeployer::deploy() { return true; } + +std::vector PlatformPluginsDeployer::qtPluginsToBeDeployed() const { + return {"platforminputcontexts", "imageformats"}; +} diff --git a/src/deployers/PlatformPluginsDeployer.h b/src/deployers/PlatformPluginsDeployer.h index 20379f8..c235894 100644 --- a/src/deployers/PlatformPluginsDeployer.h +++ b/src/deployers/PlatformPluginsDeployer.h @@ -10,7 +10,8 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + bool customDeploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/PluginsDeployerFactory.cpp b/src/deployers/PluginsDeployerFactory.cpp index ea88ec2..18a9130 100644 --- a/src/deployers/PluginsDeployerFactory.cpp +++ b/src/deployers/PluginsDeployerFactory.cpp @@ -73,9 +73,9 @@ std::vector> PluginsDeployerFactory::getDeploye } if (moduleName == "multimedia") { - if (qtMajorVersion < 6) { + if (qtMajorVersion < 6) { return {getInstance(moduleName)}; - } else { + } else { return {getInstance(moduleName)}; } } diff --git a/src/deployers/PositioningPluginsDeployer.cpp b/src/deployers/PositioningPluginsDeployer.cpp index 5c95e7f..3056e06 100644 --- a/src/deployers/PositioningPluginsDeployer.cpp +++ b/src/deployers/PositioningPluginsDeployer.cpp @@ -10,19 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool PositioningPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying positioning plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "position"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/position/")) - return false; - } - - return true; +std::vector PositioningPluginsDeployer::qtPluginsToBeDeployed() const { + return {"position"}; } diff --git a/src/deployers/PositioningPluginsDeployer.h b/src/deployers/PositioningPluginsDeployer.h index c60e221..af5ae0a 100644 --- a/src/deployers/PositioningPluginsDeployer.h +++ b/src/deployers/PositioningPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/PrintSupportPluginsDeployer.cpp b/src/deployers/PrintSupportPluginsDeployer.cpp index 15c1d86..eb7a8af 100644 --- a/src/deployers/PrintSupportPluginsDeployer.cpp +++ b/src/deployers/PrintSupportPluginsDeployer.cpp @@ -10,19 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool PrintSupportPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying printsupport plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "printsupport"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/printsupport/")) - return false; - } - - return true; +std::vector PrintSupportPluginsDeployer::qtPluginsToBeDeployed() const { + return {"printsupport"}; } diff --git a/src/deployers/PrintSupportPluginsDeployer.h b/src/deployers/PrintSupportPluginsDeployer.h index 6780d06..9b502c9 100644 --- a/src/deployers/PrintSupportPluginsDeployer.h +++ b/src/deployers/PrintSupportPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/QmlPluginsDeployer.cpp b/src/deployers/QmlPluginsDeployer.cpp index e538ea1..c072ce7 100644 --- a/src/deployers/QmlPluginsDeployer.cpp +++ b/src/deployers/QmlPluginsDeployer.cpp @@ -8,11 +8,7 @@ using namespace linuxdeploy::plugin::qt; namespace fs = std::filesystem; -bool QmlPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool QmlPluginsDeployer::customDeploy() { try { deployQml(appDir, qtInstallQmlPath); } catch (const QmlImportScannerError &) { diff --git a/src/deployers/QmlPluginsDeployer.h b/src/deployers/QmlPluginsDeployer.h index 28ddc0d..54e20e3 100644 --- a/src/deployers/QmlPluginsDeployer.h +++ b/src/deployers/QmlPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + bool customDeploy() override; }; } } diff --git a/src/deployers/Qt3DPluginsDeployer.cpp b/src/deployers/Qt3DPluginsDeployer.cpp index 635ea04..d431dba 100644 --- a/src/deployers/Qt3DPluginsDeployer.cpp +++ b/src/deployers/Qt3DPluginsDeployer.cpp @@ -10,24 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool Qt3DPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying Qt 3D plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "geometryloaders"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/geometryloaders/")) - return false; - } - - for (fs::directory_iterator i(qtPluginsPath / "sceneparsers"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/sceneparsers/")) - return false; - } - - return true; +std::vector Qt3DPluginsDeployer::qtPluginsToBeDeployed() const { + return {"geometryloaders", "sceneparsers"}; } diff --git a/src/deployers/Qt3DPluginsDeployer.h b/src/deployers/Qt3DPluginsDeployer.h index 5810a34..56610f2 100644 --- a/src/deployers/Qt3DPluginsDeployer.h +++ b/src/deployers/Qt3DPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/SqlPluginsDeployer.cpp b/src/deployers/SqlPluginsDeployer.cpp index 6d0111b..a9a7d2a 100644 --- a/src/deployers/SqlPluginsDeployer.cpp +++ b/src/deployers/SqlPluginsDeployer.cpp @@ -10,19 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool SqlPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying SQL plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "sqldrivers"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/sqldrivers/")) - return false; - } - - return true; +std::vector SqlPluginsDeployer::qtPluginsToBeDeployed() const { + return {"sqldrivers"}; } diff --git a/src/deployers/SqlPluginsDeployer.h b/src/deployers/SqlPluginsDeployer.h index 9329aef..0a88cd4 100644 --- a/src/deployers/SqlPluginsDeployer.h +++ b/src/deployers/SqlPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/SvgPluginsDeployer.cpp b/src/deployers/SvgPluginsDeployer.cpp index 90a628d..8b59c5d 100644 --- a/src/deployers/SvgPluginsDeployer.cpp +++ b/src/deployers/SvgPluginsDeployer.cpp @@ -12,11 +12,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool SvgPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool SvgPluginsDeployer::customDeploy() { ldLog() << "Deploying svg icon engine" << std::endl; if (!appDir.deployLibrary(qtPluginsPath / "iconengines/libqsvgicon.so", appDir.path() / "usr/plugins/iconengines/")) diff --git a/src/deployers/SvgPluginsDeployer.h b/src/deployers/SvgPluginsDeployer.h index 18466b6..bd5cb2f 100644 --- a/src/deployers/SvgPluginsDeployer.h +++ b/src/deployers/SvgPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + bool customDeploy() override; }; } } diff --git a/src/deployers/TextToSpeechPluginsDeployer.cpp b/src/deployers/TextToSpeechPluginsDeployer.cpp index a0124d6..c2939d8 100644 --- a/src/deployers/TextToSpeechPluginsDeployer.cpp +++ b/src/deployers/TextToSpeechPluginsDeployer.cpp @@ -12,7 +12,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool TextToSpeechPluginsDeployer::deploy() { +bool TextToSpeechPluginsDeployer::customDeploy() { // calling the default code is optional, but it won't hurt for now if (!BasicPluginsDeployer::deploy()) return false; diff --git a/src/deployers/TextToSpeechPluginsDeployer.h b/src/deployers/TextToSpeechPluginsDeployer.h index 2138723..2a07fd0 100644 --- a/src/deployers/TextToSpeechPluginsDeployer.h +++ b/src/deployers/TextToSpeechPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + bool customDeploy() override; }; } } diff --git a/src/deployers/TlsBackendsDeployer.cpp b/src/deployers/TlsBackendsDeployer.cpp index e6c84b9..10badc1 100644 --- a/src/deployers/TlsBackendsDeployer.cpp +++ b/src/deployers/TlsBackendsDeployer.cpp @@ -10,19 +10,6 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool TlsBackendsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying TLS backends" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "tls"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/tls/")) - return false; - } - - return true; +std::vector TlsBackendsDeployer::qtPluginsToBeDeployed() const { + return {"tls"}; } diff --git a/src/deployers/TlsBackendsDeployer.h b/src/deployers/TlsBackendsDeployer.h index e3aa3a2..2a2364d 100644 --- a/src/deployers/TlsBackendsDeployer.h +++ b/src/deployers/TlsBackendsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.cpp b/src/deployers/WaylandcompositorPluginsDeployer.cpp index 3a0e667..489301f 100644 --- a/src/deployers/WaylandcompositorPluginsDeployer.cpp +++ b/src/deployers/WaylandcompositorPluginsDeployer.cpp @@ -10,29 +10,8 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -namespace fs = std::filesystem; - -bool WaylandcompositorPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - ldLog() << "Deploying waylandcompositor plugin" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / "wayland-decoration-client"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-decoration-client/")) - return false; - } - - for (fs::directory_iterator i(qtPluginsPath / "wayland-graphics-integration-client"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-graphics-integration-client/")) - return false; - } - - for (fs::directory_iterator i(qtPluginsPath / "wayland-shell-integration"); i != fs::directory_iterator(); ++i) { - if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/wayland-shell-integration/")) - return false; - } - - return true; +std::vector WaylandcompositorPluginsDeployer::qtPluginsToBeDeployed() const { + return {"wayland-decoration-client", + "wayland-graphics-integration-client", + "wayland-shell-integration",}; } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.h b/src/deployers/WaylandcompositorPluginsDeployer.h index 3840002..0f9d552 100644 --- a/src/deployers/WaylandcompositorPluginsDeployer.h +++ b/src/deployers/WaylandcompositorPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + std::vector qtPluginsToBeDeployed() const override; }; } } diff --git a/src/deployers/WebEnginePluginsDeployer.cpp b/src/deployers/WebEnginePluginsDeployer.cpp index f93ed1f..a02be57 100644 --- a/src/deployers/WebEnginePluginsDeployer.cpp +++ b/src/deployers/WebEnginePluginsDeployer.cpp @@ -14,7 +14,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool WebEnginePluginsDeployer::deploy() { +bool WebEnginePluginsDeployer::customDeploy() { // calling the default code is optional, but it won't hurt for now if (!BasicPluginsDeployer::deploy()) return false; diff --git a/src/deployers/WebEnginePluginsDeployer.h b/src/deployers/WebEnginePluginsDeployer.h index 64ba8bd..a0cf050 100644 --- a/src/deployers/WebEnginePluginsDeployer.h +++ b/src/deployers/WebEnginePluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + bool customDeploy() override; }; } } diff --git a/src/deployers/XcbglIntegrationPluginsDeployer.cpp b/src/deployers/XcbglIntegrationPluginsDeployer.cpp index 21c54a4..a8d1e18 100644 --- a/src/deployers/XcbglIntegrationPluginsDeployer.cpp +++ b/src/deployers/XcbglIntegrationPluginsDeployer.cpp @@ -8,11 +8,7 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -bool XcbglIntegrationPluginsDeployer::deploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool XcbglIntegrationPluginsDeployer::customDeploy() { ldLog() << "Deploying xcb-gl integrations" << std::endl; return deployIntegrationPlugins(appDir, qtPluginsPath, {"xcbglintegrations/"}); diff --git a/src/deployers/XcbglIntegrationPluginsDeployer.h b/src/deployers/XcbglIntegrationPluginsDeployer.h index 23d1db5..6523393 100644 --- a/src/deployers/XcbglIntegrationPluginsDeployer.h +++ b/src/deployers/XcbglIntegrationPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool deploy() override; + bool customDeploy() override; }; } } From 0a29e02bc763fd50b4723db0c82d5eedc60918b6 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Wed, 19 Jun 2024 09:15:48 -0300 Subject: [PATCH 10/33] Deploy Qt plugins with default deployStandardQtPlugins() function --- src/deployers/BasicPluginsDeployer.cpp | 20 ++++++++++--------- src/deployers/BasicPluginsDeployer.h | 15 +++++++------- src/deployers/BearerPluginsDeployer.cpp | 8 ++------ src/deployers/BearerPluginsDeployer.h | 2 +- src/deployers/GamepadPluginsDeployer.cpp | 8 ++------ src/deployers/GamepadPluginsDeployer.h | 2 +- src/deployers/LocationPluginsDeployer.cpp | 8 ++------ src/deployers/LocationPluginsDeployer.h | 2 +- src/deployers/Multimedia5PluginsDeployer.cpp | 8 ++------ src/deployers/Multimedia5PluginsDeployer.h | 2 +- src/deployers/Multimedia6PluginsDeployer.cpp | 6 +++--- src/deployers/Multimedia6PluginsDeployer.h | 2 +- src/deployers/PlatformPluginsDeployer.cpp | 10 +++++----- src/deployers/PlatformPluginsDeployer.h | 3 +-- src/deployers/PositioningPluginsDeployer.cpp | 8 ++------ src/deployers/PositioningPluginsDeployer.h | 2 +- src/deployers/PrintSupportPluginsDeployer.cpp | 8 ++------ src/deployers/PrintSupportPluginsDeployer.h | 2 +- src/deployers/QmlPluginsDeployer.cpp | 2 +- src/deployers/QmlPluginsDeployer.h | 2 +- src/deployers/Qt3DPluginsDeployer.cpp | 8 ++------ src/deployers/Qt3DPluginsDeployer.h | 2 +- src/deployers/SqlPluginsDeployer.cpp | 8 ++------ src/deployers/SqlPluginsDeployer.h | 2 +- src/deployers/SvgPluginsDeployer.cpp | 2 +- src/deployers/SvgPluginsDeployer.h | 2 +- src/deployers/TextToSpeechPluginsDeployer.cpp | 2 +- src/deployers/TextToSpeechPluginsDeployer.h | 2 +- src/deployers/TlsBackendsDeployer.cpp | 8 ++------ src/deployers/TlsBackendsDeployer.h | 2 +- .../WaylandcompositorPluginsDeployer.cpp | 12 ++++------- .../WaylandcompositorPluginsDeployer.h | 2 +- src/deployers/WebEnginePluginsDeployer.cpp | 6 +----- src/deployers/WebEnginePluginsDeployer.h | 2 +- .../XcbglIntegrationPluginsDeployer.cpp | 2 +- .../XcbglIntegrationPluginsDeployer.h | 2 +- 36 files changed, 70 insertions(+), 114 deletions(-) diff --git a/src/deployers/BasicPluginsDeployer.cpp b/src/deployers/BasicPluginsDeployer.cpp index 5de1aca..444dfbe 100644 --- a/src/deployers/BasicPluginsDeployer.cpp +++ b/src/deployers/BasicPluginsDeployer.cpp @@ -29,21 +29,23 @@ BasicPluginsDeployer::BasicPluginsDeployer(std::string moduleName, qtDataPath(std::move(qtDataPath)) {} bool BasicPluginsDeployer::deploy() { - for (const auto &pluginName : qtPluginsToBeDeployed()) { - ldLog() << "Deploying" << pluginName << "plugins" << std::endl; + // currently this is a no-op, but we might add more functionality later on, such as some kinds of default + // attempts to copy data based on the moduleName + return doDeploy(); +} + +bool BasicPluginsDeployer::deployStandardQtPlugins(const std::vector& plugins) +{ + for (const auto &pluginName : plugins) { + ldLog() << "Deploying Qt" << pluginName << "plugins" << std::endl; for (fs::directory_iterator i(qtPluginsPath / pluginName); i != fs::directory_iterator(); ++i) { if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins" / pluginName)) return false; } } - - return customDeploy(); -} - -bool BasicPluginsDeployer::customDeploy() { return true; } -std::vector BasicPluginsDeployer::qtPluginsToBeDeployed() const { - return {}; +bool BasicPluginsDeployer::doDeploy() { + return true; } diff --git a/src/deployers/BasicPluginsDeployer.h b/src/deployers/BasicPluginsDeployer.h index c6df18c..0eaca0c 100644 --- a/src/deployers/BasicPluginsDeployer.h +++ b/src/deployers/BasicPluginsDeployer.h @@ -50,24 +50,23 @@ namespace linuxdeploy { public: /** - * This method deploys the plugins returned by \sa qtPluginsToBeDeployed() - * and call \sa customDeploy() to finalize the deployment. + * This method might make some deployment preparation and calls \sa doDeploy() to finalize the deployment. */ bool deploy() override final; protected: /** - * The \sa deploy() method can deploy Qt plugins that follow the default - * name and path scheme, but some modules are special so - * they should write custom deployment code. + * This method does the actual moduleName deployment, where any special case should be handled and + * \sa deployStandardQtPlugins () method should be called to deploy Qt plugins that follow the default + * name and path scheme. */ - virtual bool customDeploy(); + virtual bool doDeploy(); /** - * Returns a list of Qt plugin names that should be deployed and + * Deploys a list of Qt plugin that should be deployed and * follow the default name and path scheme. */ - virtual std::vector qtPluginsToBeDeployed() const; + bool deployStandardQtPlugins(const std::vector& plugins); }; } } diff --git a/src/deployers/BearerPluginsDeployer.cpp b/src/deployers/BearerPluginsDeployer.cpp index 9aee6dc..96ffd14 100644 --- a/src/deployers/BearerPluginsDeployer.cpp +++ b/src/deployers/BearerPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "BearerPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector BearerPluginsDeployer::qtPluginsToBeDeployed() const { - return {"bearer"}; +bool BearerPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"bearer"}); } diff --git a/src/deployers/BearerPluginsDeployer.h b/src/deployers/BearerPluginsDeployer.h index fb87dd4..f7e25d8 100644 --- a/src/deployers/BearerPluginsDeployer.h +++ b/src/deployers/BearerPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/GamepadPluginsDeployer.cpp b/src/deployers/GamepadPluginsDeployer.cpp index ae99fcb..4a2c8ee 100644 --- a/src/deployers/GamepadPluginsDeployer.cpp +++ b/src/deployers/GamepadPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "GamepadPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector GamepadPluginsDeployer::qtPluginsToBeDeployed() const { - return {"gamepads"}; +bool GamepadPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"gamepads"}); } diff --git a/src/deployers/GamepadPluginsDeployer.h b/src/deployers/GamepadPluginsDeployer.h index 44fd36c..f11c775 100644 --- a/src/deployers/GamepadPluginsDeployer.h +++ b/src/deployers/GamepadPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/LocationPluginsDeployer.cpp b/src/deployers/LocationPluginsDeployer.cpp index 3948ab5..95c4bb0 100644 --- a/src/deployers/LocationPluginsDeployer.cpp +++ b/src/deployers/LocationPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "LocationPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector LocationPluginsDeployer::qtPluginsToBeDeployed() const { - return {"geoservices"}; +bool LocationPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"geoservices"}); } diff --git a/src/deployers/LocationPluginsDeployer.h b/src/deployers/LocationPluginsDeployer.h index 606dd06..b4bb4e8 100644 --- a/src/deployers/LocationPluginsDeployer.h +++ b/src/deployers/LocationPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Multimedia5PluginsDeployer.cpp b/src/deployers/Multimedia5PluginsDeployer.cpp index 94be8ec..136ae71 100644 --- a/src/deployers/Multimedia5PluginsDeployer.cpp +++ b/src/deployers/Multimedia5PluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "Multimedia5PluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector Multimedia5PluginsDeployer::qtPluginsToBeDeployed() const { - return {"mediaservice", "audio"}; +bool Multimedia5PluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"mediaservice", "audio"}); } diff --git a/src/deployers/Multimedia5PluginsDeployer.h b/src/deployers/Multimedia5PluginsDeployer.h index 89f6908..7e14150 100644 --- a/src/deployers/Multimedia5PluginsDeployer.h +++ b/src/deployers/Multimedia5PluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Multimedia6PluginsDeployer.cpp b/src/deployers/Multimedia6PluginsDeployer.cpp index b23c1bd..709c81b 100644 --- a/src/deployers/Multimedia6PluginsDeployer.cpp +++ b/src/deployers/Multimedia6PluginsDeployer.cpp @@ -12,11 +12,11 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -std::vector Multimedia6PluginsDeployer::qtPluginsToBeDeployed() const { +bool Multimedia6PluginsDeployer::doDeploy() { if (fs::exists(qtPluginsPath / "multimedia")) { - return {"multimedia"}; + return deployStandardQtPlugins({"multimedia"}); } else { ldLog() << LD_WARNING << "Missing Qt 6 multimedia plugins, skipping." << std::endl; - return {}; + return true; } } diff --git a/src/deployers/Multimedia6PluginsDeployer.h b/src/deployers/Multimedia6PluginsDeployer.h index a0e045d..f4d2795 100644 --- a/src/deployers/Multimedia6PluginsDeployer.h +++ b/src/deployers/Multimedia6PluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PlatformPluginsDeployer.cpp b/src/deployers/PlatformPluginsDeployer.cpp index abe32c0..04f8e37 100644 --- a/src/deployers/PlatformPluginsDeployer.cpp +++ b/src/deployers/PlatformPluginsDeployer.cpp @@ -13,7 +13,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool PlatformPluginsDeployer::customDeploy() { +bool PlatformPluginsDeployer::doDeploy() { ldLog() << "Deploying platform plugins" << std::endl; // always deploy default platform @@ -30,6 +30,10 @@ bool PlatformPluginsDeployer::customDeploy() { } } + if (!deployStandardQtPlugins({"platforminputcontexts", "imageformats"})) { + return false; + } + // TODO: platform themes -- https://github.com/probonopd/linuxdeployqt/issues/236 const fs::path platformThemesPath = qtPluginsPath / "platformthemes"; @@ -68,7 +72,3 @@ bool PlatformPluginsDeployer::customDeploy() { return true; } - -std::vector PlatformPluginsDeployer::qtPluginsToBeDeployed() const { - return {"platforminputcontexts", "imageformats"}; -} diff --git a/src/deployers/PlatformPluginsDeployer.h b/src/deployers/PlatformPluginsDeployer.h index c235894..ca4c9b6 100644 --- a/src/deployers/PlatformPluginsDeployer.h +++ b/src/deployers/PlatformPluginsDeployer.h @@ -10,8 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PositioningPluginsDeployer.cpp b/src/deployers/PositioningPluginsDeployer.cpp index 3056e06..02d7459 100644 --- a/src/deployers/PositioningPluginsDeployer.cpp +++ b/src/deployers/PositioningPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "PositioningPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector PositioningPluginsDeployer::qtPluginsToBeDeployed() const { - return {"position"}; +bool PositioningPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"position"}); } diff --git a/src/deployers/PositioningPluginsDeployer.h b/src/deployers/PositioningPluginsDeployer.h index af5ae0a..b39eb7c 100644 --- a/src/deployers/PositioningPluginsDeployer.h +++ b/src/deployers/PositioningPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/PrintSupportPluginsDeployer.cpp b/src/deployers/PrintSupportPluginsDeployer.cpp index eb7a8af..d1b8ef5 100644 --- a/src/deployers/PrintSupportPluginsDeployer.cpp +++ b/src/deployers/PrintSupportPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "PrintSupportPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector PrintSupportPluginsDeployer::qtPluginsToBeDeployed() const { - return {"printsupport"}; +bool PrintSupportPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"printsupport"}); } diff --git a/src/deployers/PrintSupportPluginsDeployer.h b/src/deployers/PrintSupportPluginsDeployer.h index 9b502c9..797f4ed 100644 --- a/src/deployers/PrintSupportPluginsDeployer.h +++ b/src/deployers/PrintSupportPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/QmlPluginsDeployer.cpp b/src/deployers/QmlPluginsDeployer.cpp index c072ce7..1b8c488 100644 --- a/src/deployers/QmlPluginsDeployer.cpp +++ b/src/deployers/QmlPluginsDeployer.cpp @@ -8,7 +8,7 @@ using namespace linuxdeploy::plugin::qt; namespace fs = std::filesystem; -bool QmlPluginsDeployer::customDeploy() { +bool QmlPluginsDeployer::doDeploy() { try { deployQml(appDir, qtInstallQmlPath); } catch (const QmlImportScannerError &) { diff --git a/src/deployers/QmlPluginsDeployer.h b/src/deployers/QmlPluginsDeployer.h index 54e20e3..6c4e897 100644 --- a/src/deployers/QmlPluginsDeployer.h +++ b/src/deployers/QmlPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/Qt3DPluginsDeployer.cpp b/src/deployers/Qt3DPluginsDeployer.cpp index d431dba..4eaad20 100644 --- a/src/deployers/Qt3DPluginsDeployer.cpp +++ b/src/deployers/Qt3DPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "Qt3DPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector Qt3DPluginsDeployer::qtPluginsToBeDeployed() const { - return {"geometryloaders", "sceneparsers"}; +bool Qt3DPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"geometryloaders", "sceneparsers"}); } diff --git a/src/deployers/Qt3DPluginsDeployer.h b/src/deployers/Qt3DPluginsDeployer.h index 56610f2..96ed8c8 100644 --- a/src/deployers/Qt3DPluginsDeployer.h +++ b/src/deployers/Qt3DPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/SqlPluginsDeployer.cpp b/src/deployers/SqlPluginsDeployer.cpp index a9a7d2a..b7d241a 100644 --- a/src/deployers/SqlPluginsDeployer.cpp +++ b/src/deployers/SqlPluginsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "SqlPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector SqlPluginsDeployer::qtPluginsToBeDeployed() const { - return {"sqldrivers"}; +bool SqlPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"sqldrivers"}); } diff --git a/src/deployers/SqlPluginsDeployer.h b/src/deployers/SqlPluginsDeployer.h index 0a88cd4..bad131f 100644 --- a/src/deployers/SqlPluginsDeployer.h +++ b/src/deployers/SqlPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/SvgPluginsDeployer.cpp b/src/deployers/SvgPluginsDeployer.cpp index 8b59c5d..36f452a 100644 --- a/src/deployers/SvgPluginsDeployer.cpp +++ b/src/deployers/SvgPluginsDeployer.cpp @@ -12,7 +12,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool SvgPluginsDeployer::customDeploy() { +bool SvgPluginsDeployer::doDeploy() { ldLog() << "Deploying svg icon engine" << std::endl; if (!appDir.deployLibrary(qtPluginsPath / "iconengines/libqsvgicon.so", appDir.path() / "usr/plugins/iconengines/")) diff --git a/src/deployers/SvgPluginsDeployer.h b/src/deployers/SvgPluginsDeployer.h index bd5cb2f..5394c1f 100644 --- a/src/deployers/SvgPluginsDeployer.h +++ b/src/deployers/SvgPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/TextToSpeechPluginsDeployer.cpp b/src/deployers/TextToSpeechPluginsDeployer.cpp index c2939d8..8b8e2c2 100644 --- a/src/deployers/TextToSpeechPluginsDeployer.cpp +++ b/src/deployers/TextToSpeechPluginsDeployer.cpp @@ -12,7 +12,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool TextToSpeechPluginsDeployer::customDeploy() { +bool TextToSpeechPluginsDeployer::doDeploy() { // calling the default code is optional, but it won't hurt for now if (!BasicPluginsDeployer::deploy()) return false; diff --git a/src/deployers/TextToSpeechPluginsDeployer.h b/src/deployers/TextToSpeechPluginsDeployer.h index 2a07fd0..9c540fd 100644 --- a/src/deployers/TextToSpeechPluginsDeployer.h +++ b/src/deployers/TextToSpeechPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/TlsBackendsDeployer.cpp b/src/deployers/TlsBackendsDeployer.cpp index 10badc1..aae471f 100644 --- a/src/deployers/TlsBackendsDeployer.cpp +++ b/src/deployers/TlsBackendsDeployer.cpp @@ -1,15 +1,11 @@ // system headers #include -// library headers -#include - // local headers #include "TlsBackendsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector TlsBackendsDeployer::qtPluginsToBeDeployed() const { - return {"tls"}; +bool TlsBackendsDeployer::doDeploy() { + return deployStandardQtPlugins({"tls"}); } diff --git a/src/deployers/TlsBackendsDeployer.h b/src/deployers/TlsBackendsDeployer.h index 2a2364d..460532b 100644 --- a/src/deployers/TlsBackendsDeployer.h +++ b/src/deployers/TlsBackendsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.cpp b/src/deployers/WaylandcompositorPluginsDeployer.cpp index 489301f..55cfdc2 100644 --- a/src/deployers/WaylandcompositorPluginsDeployer.cpp +++ b/src/deployers/WaylandcompositorPluginsDeployer.cpp @@ -1,17 +1,13 @@ // system headers #include -// library headers -#include - // local headers #include "WaylandcompositorPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; -std::vector WaylandcompositorPluginsDeployer::qtPluginsToBeDeployed() const { - return {"wayland-decoration-client", - "wayland-graphics-integration-client", - "wayland-shell-integration",}; +bool WaylandcompositorPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"wayland-decoration-client", + "wayland-graphics-integration-client", + "wayland-shell-integration",}); } diff --git a/src/deployers/WaylandcompositorPluginsDeployer.h b/src/deployers/WaylandcompositorPluginsDeployer.h index 0f9d552..f27a5fb 100644 --- a/src/deployers/WaylandcompositorPluginsDeployer.h +++ b/src/deployers/WaylandcompositorPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - std::vector qtPluginsToBeDeployed() const override; + bool doDeploy() override; }; } } diff --git a/src/deployers/WebEnginePluginsDeployer.cpp b/src/deployers/WebEnginePluginsDeployer.cpp index a02be57..7ca70bc 100644 --- a/src/deployers/WebEnginePluginsDeployer.cpp +++ b/src/deployers/WebEnginePluginsDeployer.cpp @@ -14,11 +14,7 @@ using namespace linuxdeploy::core::log; namespace fs = std::filesystem; -bool WebEnginePluginsDeployer::customDeploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - +bool WebEnginePluginsDeployer::doDeploy() { ldLog() << "Deploying web engine plugins" << std::endl; const auto newLibexecPath = appDir.path() / "usr/libexec/"; diff --git a/src/deployers/WebEnginePluginsDeployer.h b/src/deployers/WebEnginePluginsDeployer.h index a0cf050..a76997b 100644 --- a/src/deployers/WebEnginePluginsDeployer.h +++ b/src/deployers/WebEnginePluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } diff --git a/src/deployers/XcbglIntegrationPluginsDeployer.cpp b/src/deployers/XcbglIntegrationPluginsDeployer.cpp index a8d1e18..be24abb 100644 --- a/src/deployers/XcbglIntegrationPluginsDeployer.cpp +++ b/src/deployers/XcbglIntegrationPluginsDeployer.cpp @@ -8,7 +8,7 @@ using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::log; -bool XcbglIntegrationPluginsDeployer::customDeploy() { +bool XcbglIntegrationPluginsDeployer::doDeploy() { ldLog() << "Deploying xcb-gl integrations" << std::endl; return deployIntegrationPlugins(appDir, qtPluginsPath, {"xcbglintegrations/"}); diff --git a/src/deployers/XcbglIntegrationPluginsDeployer.h b/src/deployers/XcbglIntegrationPluginsDeployer.h index 6523393..eade482 100644 --- a/src/deployers/XcbglIntegrationPluginsDeployer.h +++ b/src/deployers/XcbglIntegrationPluginsDeployer.h @@ -10,7 +10,7 @@ namespace linuxdeploy { // we can just use the base class's constructor using BasicPluginsDeployer::BasicPluginsDeployer; - bool customDeploy() override; + bool doDeploy() override; }; } } From 24f169aee8567f9fb1ebaf1916e6444a392d1f6d Mon Sep 17 00:00:00 2001 From: Kjell Morgenstern Date: Sun, 4 Aug 2024 23:43:18 +0200 Subject: [PATCH 11/33] Make sure destination is used as a directory. Fixes #184 --- src/deployers/BasicPluginsDeployer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/deployers/BasicPluginsDeployer.cpp b/src/deployers/BasicPluginsDeployer.cpp index 444dfbe..f636fed 100644 --- a/src/deployers/BasicPluginsDeployer.cpp +++ b/src/deployers/BasicPluginsDeployer.cpp @@ -39,7 +39,8 @@ bool BasicPluginsDeployer::deployStandardQtPlugins(const std::vector Date: Thu, 19 Sep 2024 15:56:36 +0200 Subject: [PATCH 12/33] Copy v8_context_snapshot.bin to resources when deploying Qt WebEngine. This file was added in Qt6. --- src/deployers/WebEnginePluginsDeployer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/deployers/WebEnginePluginsDeployer.cpp b/src/deployers/WebEnginePluginsDeployer.cpp index 7ca70bc..32e6dde 100644 --- a/src/deployers/WebEnginePluginsDeployer.cpp +++ b/src/deployers/WebEnginePluginsDeployer.cpp @@ -39,7 +39,9 @@ bool WebEnginePluginsDeployer::doDeploy() { for (const auto &fileName : {"qtwebengine_resources.pak", "qtwebengine_devtools_resources.pak", "qtwebengine_resources_100p.pak", - "qtwebengine_resources_200p.pak", "icudtl.dat"}) { + "qtwebengine_resources_200p.pak", + "icudtl.dat", + "v8_context_snapshot.bin"}) { auto path = qtDataPath / "resources" / fileName; if (fs::is_regular_file(path)) From d9061bf53c02bde50234b3ed772d9f2763b5460b Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Wed, 6 Nov 2024 17:47:53 +0100 Subject: [PATCH 13/33] Revert "Fix static build's runtime URL" This reverts commit ecc4a9d19ddc7c10fc4ae6f272ef6e9dfeadf7bd. --- ci/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/build.sh b/ci/build.sh index 4420154..103d555 100755 --- a/ci/build.sh +++ b/ci/build.sh @@ -47,7 +47,7 @@ export OUTPUT="linuxdeploy-plugin-qt-$ARCH.AppImage" # special set of builds using a different experimental runtime, used for testing purposes if [[ "${USE_STATIC_RUNTIME:-}" != "" ]]; then - custom_runtime_url="https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-fuse3-$ARCH" + custom_runtime_url="https://github.com/AppImage/type2-runtime/releases/download/continuous/runtime-$ARCH" wget "$custom_runtime_url" runtime_filename="$(echo "$custom_runtime_url" | rev | cut -d/ -f1 | rev)" LDAI_RUNTIME_FILE="$(readlink -f "$runtime_filename")" From c2707284e0dcfef8c705174c0c83aa23e6913936 Mon Sep 17 00:00:00 2001 From: Servall4 <101184344+Servall4@users.noreply.github.com> Date: Tue, 5 Nov 2024 13:26:16 +0300 Subject: [PATCH 14/33] Added qmake6 to findQmake --- src/util.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/util.cpp b/src/util.cpp index 3bd0d87..90b1a4d 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -68,6 +68,9 @@ std::filesystem::path findQmake() { if (qmakePath.empty()) qmakePath = linuxdeploy::util::which("qmake"); + + if (qmakePath.empty()) + qmakePath = linuxdeploy::util::which("qmake6"); } return qmakePath; From 01fd7732c5262676220a657eecbabc9dffd814fe Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Mon, 23 Dec 2024 02:25:48 +0100 Subject: [PATCH 15/33] Switch to Docker --platform --- ci/build-in-docker.sh | 21 +++++++++++---------- ci/docker/Dockerfile | 8 +------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/ci/build-in-docker.sh b/ci/build-in-docker.sh index ee0038e..ae36b55 100755 --- a/ci/build-in-docker.sh +++ b/ci/build-in-docker.sh @@ -18,7 +18,7 @@ error() { log_message 1 "[error] $*" } -if [[ "$ARCH" == "" ]]; then +if [[ "${ARCH:-}" == "" ]]; then error "Usage: env ARCH=... bash $0" exit 2 fi @@ -29,16 +29,16 @@ this_dir="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")" case "$ARCH" in x86_64) - docker_arch=amd64 + docker_platform=linux/amd64 ;; i386) - docker_arch=i386 + docker_platform=linux/386 ;; armhf) - docker_arch=arm32v7 + docker_platform=linux/arm/v7 ;; aarch64) - docker_arch=arm64v8 + docker_platform=linux/arm64/v8 ;; *) echo "Unsupported \$ARCH: $ARCH" @@ -49,7 +49,7 @@ esac # first, we need to build the image # we always attempt to build it, it will only be rebuilt if Docker detects changes # optionally, we'll pull the base image beforehand -info "Building Docker image for $ARCH (Docker arch: $docker_arch)" +info "Building Docker image for $ARCH (Docker platform: $docker_platform)" build_args=() if [[ "${UPDATE:-}" == "" ]]; then @@ -58,11 +58,11 @@ else build_args+=("--pull") fi -docker_image=linuxdeploy-plugin-qt-build:"$ARCH" +docker_image=linuxdeploy-plugin-qt-build docker build \ + --platform "$docker_platform" \ --build-arg ARCH="$ARCH" \ - --build-arg docker_arch="$docker_arch" \ "${build_args[@]}" \ -t "$docker_image" \ "$this_dir"/docker @@ -104,11 +104,12 @@ run_in_docker() { # b) allow the build scripts to "mv" the binaries into the /out directory docker run \ --rm \ + --platform "$docker_platform" \ -i \ --init \ + -e ARCH \ -e GITHUB_RUN_NUMBER \ -e USE_STATIC_RUNTIME \ - -e ARCH \ -e CI \ --user "$uid" \ "${docker_args[@]}" \ @@ -119,7 +120,7 @@ run_in_docker() { } filename_suffix= -if [[ "$USE_STATIC_RUNTIME" != "" ]]; then +if [[ "${USE_STATIC_RUNTIME:-}" != "" ]]; then filename_suffix="-static" fi diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index 143dfcf..0cc86b4 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -3,18 +3,12 @@ # needs to be re-run in CI every time as we cannot store auto-built Docker images due to GitHub's strict quota # it will save a lot of time in local development environments, though -ARG docker_arch - # we'll just use Debian as a base image for now, mainly because it produces less headache than Ubuntu with arm # a big pro is that they ship an up to date CMake in their stable distribution # also, they still provide IA-32 builds for some reason... # some people in the AppImage community do not (want to) realize i386 is dead for good # we are going to drop i686 in the future! -FROM ${docker_arch}/debian:stable - -# variables that need to be availabe during build and runtime must(!) be repeated after FROM -ARG ARCH - +FROM debian:stable SHELL ["bash", "-x", "-c"] From 3b6e451e3e6733b4f0980398481b5ec5a577d070 Mon Sep 17 00:00:00 2001 From: Tom Dewey Date: Thu, 25 Jul 2024 15:27:01 +0100 Subject: [PATCH 16/33] multiple deployers: Ignore .debug files This commit replicates a pattern from the TextToSpeechPluginsDeployer into the BasicPluginsDeployer - to affect all standard deployers. Essentially - it's extremely unlikely that composing an AppImage with debug symbols is what a user actually wants to do. I'm also not aware of a good story for connecting debug symbols to an AppImage at all. As a result, let's make a sensible choice - and not package them. Trust that developers will use their underlying build system for Debug, and that release tracking will allow developers to tie an AppImage back to a source control revision. Finally, note that this works around an interesting aarch64 bug - where the .debug files that are created are marked as x86_64 ELF binaries - even when you are _building on an aarch64 host_. --- src/deployers/BasicPluginsDeployer.cpp | 4 ++++ src/deployment.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/deployers/BasicPluginsDeployer.cpp b/src/deployers/BasicPluginsDeployer.cpp index f636fed..36d1299 100644 --- a/src/deployers/BasicPluginsDeployer.cpp +++ b/src/deployers/BasicPluginsDeployer.cpp @@ -39,6 +39,10 @@ bool BasicPluginsDeployer::deployStandardQtPlugins(const std::vectorpath().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } // add a trailing slash, so pluginName is used as a destination directory, not a file. if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins" / pluginName / "")) return false; diff --git a/src/deployment.h b/src/deployment.h index 04df3a1..047941a 100644 --- a/src/deployment.h +++ b/src/deployment.h @@ -37,6 +37,10 @@ inline bool deployIntegrationPlugins(appdir::AppDir& appDir, const fs::path& qtP // otherwise, when the directory doesn't exist, it might just copy all files to files called like // destinationDir auto destinationDir = appDir.path() / "usr/plugins" / subDir / ""; + if (i->path().extension() == ".debug") { + ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; + continue; + } if (!appDir.deployLibrary(*i, destinationDir)) return false; From 2d9e23f79631bdce0038643a4d313859fe0f5cd8 Mon Sep 17 00:00:00 2001 From: Tom Dewey Date: Mon, 2 Sep 2024 15:38:17 +0100 Subject: [PATCH 17/33] deployers: Simplify TextToSpeechPluginsDeployer With the refactor of BasicPluginsDeployer, we can collapse the contents of the TextToSpeechPluginsDeployer to just a call into the base class, with the appropriate argument. --- src/deployers/TextToSpeechPluginsDeployer.cpp | 32 +------------------ 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/src/deployers/TextToSpeechPluginsDeployer.cpp b/src/deployers/TextToSpeechPluginsDeployer.cpp index 8b8e2c2..ddf5a3d 100644 --- a/src/deployers/TextToSpeechPluginsDeployer.cpp +++ b/src/deployers/TextToSpeechPluginsDeployer.cpp @@ -1,38 +1,8 @@ -// system headers -#include - -// library headers -#include - // local headers #include "TextToSpeechPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; - -namespace fs = std::filesystem; bool TextToSpeechPluginsDeployer::doDeploy() { - // calling the default code is optional, but it won't hurt for now - if (!BasicPluginsDeployer::deploy()) - return false; - - const std::string pluginsName = "texttospeech"; - - ldLog() << "Deploying" << pluginsName << "plugins" << std::endl; - - for (fs::directory_iterator i(qtPluginsPath / pluginsName); i != fs::directory_iterator(); ++i) { - if (i->path().extension() == ".debug") { - ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; - continue; - } - - // terminate with a "/" to make sure the deployer will deploy the file into the target directory properly - // has to be cast to string, unfortunately, as std::filesystem doesn't allow for adding a terminating / - const auto targetPath = (appDir.path() / "usr/plugins/" / pluginsName).string() + "/"; - if (!appDir.deployLibrary(*i, targetPath)) - return false; - } - - return true; + return deployStandardQtPlugins({"texttospeech"}); } From ce5291e25979d7d6417551d787f308b88c1b8d76 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Thu, 13 Feb 2025 21:47:52 +0100 Subject: [PATCH 18/33] Make static runtime default and build with native ARM runners --- .github/workflows/main.yml | 39 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eac8bd4..38153c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,31 +6,35 @@ jobs: build-and-test: strategy: matrix: - ARCH: [x86_64, i386, aarch64, armhf] - USE_STATIC_RUNTIME: [""] - UPDATE: ["1"] - include: - # test build + # regular builds: - ARCH: x86_64 - DOCKER_ARCH: amd64 - BUILD_TYPE: coverage + BUILD_TYPE: appimage + RUNS_ON: ubuntu-24.04 + - ARCH: i386 + BUILD_TYPE: appimage + RUNS_ON: ubuntu-24.04 + - ARCH: aarch64 + BUILD_TYPE: appimage + RUNS_ON: ubuntu-24.04-arm + - ARCH: armhf + BUILD_TYPE: appimage + RUNS_ON: ubuntu-24.04-arm - # experimental build + # test build - ARCH: x86_64 - BUILD_TYPE: appimage - USE_STATIC_RUNTIME: -static + BUILD_TYPE: coverage + RUNS_ON: ubuntu-24.04 fail-fast: false - name: ${{ matrix.ARCH }}${{ matrix.USE_STATIC_RUNTIME }} - runs-on: ubuntu-latest + name: ${{ matrix.ARCH }} ${{ matrix.BUILD_TYPE }} + runs-on: ${{ matrix.RUNS_ON }} env: ARCH: ${{ matrix.ARCH }} BUILD_TYPE: ${{ matrix.BUILD_TYPE }} DEBIAN_FRONTEND: interactive - USE_STATIC_RUNTIME: ${{ matrix.USE_STATIC_RUNTIME }} steps: # check out once git command is available @@ -38,23 +42,20 @@ jobs: with: submodules: recursive - - name: Set up QEMU integration for Docker - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - - name: Build and test AppImage run: bash ci/build-in-docker.sh - name: Archive artifacts uses: actions/upload-artifact@v4 with: - name: AppImage ${{ matrix.ARCH }}${{ matrix.USE_STATIC_RUNTIME}} - path: linuxdeploy-plugin-qt${{ matrix.USE_STATIC_RUNTIME}}-${{ matrix.ARCH }}.AppImage* + name: AppImage ${{ matrix.ARCH }}${{ matrix.BUILD_TYPE }} + path: linuxdeploy-plugin-qt-${{ matrix.ARCH }}.AppImage* upload: name: Create release and upload artifacts needs: - build-and-test - runs-on: ubuntu-20.04 + runs-on: ubuntu-24.04 steps: - name: Download artifacts uses: actions/download-artifact@v4 From 594db2c346aba3a6d73cab98699cb3bf1f08d013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Fri, 28 Feb 2025 10:02:24 +0100 Subject: [PATCH 19/33] Mention that files in QML_SOURCES_PATHS are checked for imported modules, and that those modules weill be included in AppDir. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bd11994..718e2a2 100644 --- a/README.md +++ b/README.md @@ -61,5 +61,5 @@ Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured so - `$EXTRA_PLATFORM_PLUGINS=platformA;platformB`: Platforms to deploy in addition to `libqxcb.so`. Platform must be available from `QT_INSTALL_PLUGINS/platforms`. QML related: -- `$QML_SOURCES_PATHS`: directory containing the application's QML files — useful/needed if QML files are "baked" into the binaries. `$QT_INSTALL_QML` is prepended to this list internally. +- `$QML_SOURCES_PATHS`: directory containing the application's QML files — useful/needed if QML files are "baked" into the binaries. linuxdeploy-plugin-qt will look for all imported QML modules and include them. `$QT_INSTALL_QML` is prepended to this list internally. - `$QML_MODULES_PATHS`: extra directories containing imported QML files (normally doesn't need to be specified). From 5492837dd8b02764461a8cbca7873f54e651d670 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Thu, 17 Jul 2025 16:06:10 -0300 Subject: [PATCH 20/33] Deploy Wayland Shell integration and decoration When EXTRA_PLATFORM_PLUGINS has libqwayland-* we should also deploy the shell and decoration plugins. --- src/deployers/PlatformPluginsDeployer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/deployers/PlatformPluginsDeployer.cpp b/src/deployers/PlatformPluginsDeployer.cpp index 04f8e37..4b7adae 100644 --- a/src/deployers/PlatformPluginsDeployer.cpp +++ b/src/deployers/PlatformPluginsDeployer.cpp @@ -27,6 +27,13 @@ bool PlatformPluginsDeployer::doDeploy() { ldLog() << "Deploying extra platform plugin: " << platformToDeploy << std::endl; if (!appDir.deployLibrary(qtPluginsPath / "platforms" / platformToDeploy, appDir.path() / "usr/plugins/platforms/")) return false; + + using namespace linuxdeploy::util::misc; + if (stringStartsWith(platformToDeploy, "libqwayland")) { + if (!deployStandardQtPlugins({"wayland-decoration-client", "wayland-shell-integration"})) { + return false; + } + } } } From fe22eb05389a0db936a455fc1c8f305a1c04189a Mon Sep 17 00:00:00 2001 From: Adel KARA SLIMANE Date: Tue, 12 Aug 2025 22:56:41 +0300 Subject: [PATCH 21/33] readme: Qt: add info for adding Wayland support Found the information in #157 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 718e2a2..0dcb14e 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,10 @@ Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured so - `$QMAKE=/path/to/my/qmake`: use another `qmake` binary to detect paths of plugins and other resources (usually doesn't need to be set manually, most Qt environments ship scripts changing `$PATH`) - `$EXTRA_QT_MODULES=moduleA;moduleB`: Modules to deploy even if not found automatically by linuxdeploy-plugin-qt - example: `EXTRA_QT_MODULES=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html) +- `$EXTRA_QT_PLUGINS=pluginA;pluginB`: extra Qt plugins to deploy + - To support Wayland, add `waylandcompositor` to this variable - `$EXTRA_PLATFORM_PLUGINS=platformA;platformB`: Platforms to deploy in addition to `libqxcb.so`. Platform must be available from `QT_INSTALL_PLUGINS/platforms`. + - To support Wayland, add `libqwayland-egl.so;libqwayland-generic.so` QML related: - `$QML_SOURCES_PATHS`: directory containing the application's QML files — useful/needed if QML files are "baked" into the binaries. linuxdeploy-plugin-qt will look for all imported QML modules and include them. `$QT_INSTALL_QML` is prepended to this list internally. From b41aac64c5eaf82b2f7a606e6790822d333d063f Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Tue, 18 Jun 2024 17:18:33 -0300 Subject: [PATCH 22/33] Fix linuxdeploy log directory rename --- lib/linuxdeploy | 2 +- src/deployers/BasicPluginsDeployer.cpp | 4 ++-- src/deployers/Multimedia6PluginsDeployer.cpp | 4 ++-- src/deployers/PlatformPluginsDeployer.cpp | 4 ++-- src/deployers/SvgPluginsDeployer.cpp | 4 ++-- src/deployers/WebEnginePluginsDeployer.cpp | 4 ++-- src/deployers/XcbglIntegrationPluginsDeployer.cpp | 4 ++-- src/deployment.h | 4 ++-- src/main.cpp | 4 ++-- src/qml.cpp | 4 ++-- src/util.cpp | 5 +++-- src/util.h | 1 - 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/linuxdeploy b/lib/linuxdeploy index 76ec4f2..a29b9a4 160000 --- a/lib/linuxdeploy +++ b/lib/linuxdeploy @@ -1 +1 @@ -Subproject commit 76ec4f2c6a7bc9be3ddce41f7f4b4e31ead6d95e +Subproject commit a29b9a48d7f0f8d0f404743274368327edcb5428 diff --git a/src/deployers/BasicPluginsDeployer.cpp b/src/deployers/BasicPluginsDeployer.cpp index 36d1299..9014bb3 100644 --- a/src/deployers/BasicPluginsDeployer.cpp +++ b/src/deployers/BasicPluginsDeployer.cpp @@ -3,12 +3,12 @@ #include // library headers -#include +#include // local headers #include "BasicPluginsDeployer.h" -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; using namespace linuxdeploy::core::appdir; using namespace linuxdeploy::plugin::qt; diff --git a/src/deployers/Multimedia6PluginsDeployer.cpp b/src/deployers/Multimedia6PluginsDeployer.cpp index 709c81b..4004828 100644 --- a/src/deployers/Multimedia6PluginsDeployer.cpp +++ b/src/deployers/Multimedia6PluginsDeployer.cpp @@ -2,13 +2,13 @@ #include // library headers -#include +#include // local headers #include "Multimedia6PluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; namespace fs = std::filesystem; diff --git a/src/deployers/PlatformPluginsDeployer.cpp b/src/deployers/PlatformPluginsDeployer.cpp index 4b7adae..378d727 100644 --- a/src/deployers/PlatformPluginsDeployer.cpp +++ b/src/deployers/PlatformPluginsDeployer.cpp @@ -2,14 +2,14 @@ #include // library headers -#include +#include #include // local headers #include "PlatformPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; namespace fs = std::filesystem; diff --git a/src/deployers/SvgPluginsDeployer.cpp b/src/deployers/SvgPluginsDeployer.cpp index 36f452a..5e38cea 100644 --- a/src/deployers/SvgPluginsDeployer.cpp +++ b/src/deployers/SvgPluginsDeployer.cpp @@ -2,13 +2,13 @@ #include // library headers -#include +#include // local headers #include "SvgPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; namespace fs = std::filesystem; diff --git a/src/deployers/WebEnginePluginsDeployer.cpp b/src/deployers/WebEnginePluginsDeployer.cpp index 32e6dde..939b3c9 100644 --- a/src/deployers/WebEnginePluginsDeployer.cpp +++ b/src/deployers/WebEnginePluginsDeployer.cpp @@ -3,14 +3,14 @@ #include // library headers -#include +#include #include // local headers #include "WebEnginePluginsDeployer.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; namespace fs = std::filesystem; diff --git a/src/deployers/XcbglIntegrationPluginsDeployer.cpp b/src/deployers/XcbglIntegrationPluginsDeployer.cpp index be24abb..6e2c390 100644 --- a/src/deployers/XcbglIntegrationPluginsDeployer.cpp +++ b/src/deployers/XcbglIntegrationPluginsDeployer.cpp @@ -1,12 +1,12 @@ // library headers -#include +#include // local headers #include "XcbglIntegrationPluginsDeployer.h" #include "deployment.h" using namespace linuxdeploy::plugin::qt; -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; bool XcbglIntegrationPluginsDeployer::doDeploy() { ldLog() << "Deploying xcb-gl integrations" << std::endl; diff --git a/src/deployment.h b/src/deployment.h index 047941a..5bac39a 100644 --- a/src/deployment.h +++ b/src/deployment.h @@ -7,7 +7,7 @@ // library includes #include #include -#include +#include #include // local includes @@ -19,7 +19,7 @@ namespace fs = std::filesystem; using namespace linuxdeploy::core; using namespace linuxdeploy::util::misc; -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; // little helper called by other integration plugins inline bool deployIntegrationPlugins(appdir::AppDir& appDir, const fs::path& qtPluginsPath, const std::initializer_list& subDirs) { diff --git a/src/main.cpp b/src/main.cpp index 9f0ca45..3d61c59 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -9,7 +9,7 @@ // library includes #include #include -#include +#include #include // local includes @@ -22,7 +22,7 @@ namespace fs = std::filesystem; using namespace linuxdeploy::core; using namespace linuxdeploy::util::misc; -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; using namespace linuxdeploy::plugin::qt; diff --git a/src/qml.cpp b/src/qml.cpp index 6bdf4ce..3d588e5 100644 --- a/src/qml.cpp +++ b/src/qml.cpp @@ -4,7 +4,7 @@ // library includes #include #include -#include +#include #include #include #include @@ -14,7 +14,7 @@ #include "qml.h" using namespace linuxdeploy::core; -using namespace linuxdeploy::core::log; +using namespace linuxdeploy::log; using namespace linuxdeploy::subprocess; using namespace linuxdeploy::util; using namespace nlohmann; diff --git a/src/util.cpp b/src/util.cpp index 90b1a4d..6dd662b 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2,6 +2,7 @@ #include // library headers +#include #include #include @@ -13,7 +14,7 @@ using namespace linuxdeploy::subprocess; std::map queryQmake(const std::filesystem::path& qmakePath) { auto qmakeCall = subprocess({qmakePath.string(), "-query"}).run(); - using namespace linuxdeploy::core::log; + using namespace linuxdeploy::log; if (qmakeCall.exit_code() != 0) { ldLog() << LD_ERROR << "Call to qmake failed:" << qmakeCall.stderr_string() << std::endl; @@ -54,7 +55,7 @@ std::map queryQmake(const std::filesystem::path& qmake }; std::filesystem::path findQmake() { - using namespace linuxdeploy::core::log; + using namespace linuxdeploy::log; std::filesystem::path qmakePath; diff --git a/src/util.h b/src/util.h index 3d48755..f384662 100644 --- a/src/util.h +++ b/src/util.h @@ -10,7 +10,6 @@ // library includes #include -#include typedef struct { bool success; From e29e66d6e39896e470fe8b6d513c96c1b3cf7a7a Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Wed, 19 Jun 2024 09:31:01 -0300 Subject: [PATCH 23/33] Add --exclude-library option to standalone version It would be useful to have the standalone version also able to exclude-libraries, this helps with issues: #153 #150 #110 #108 --- src/main.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 3d61c59..04683d9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -37,6 +37,9 @@ int main(const int argc, const char *const *const argv) { args::HelpFlag help(parser, "help", "Display this help text", {'h', "help"}); args::ValueFlag appDirPath(parser, "appdir path", "Path to an existing AppDir", {"appdir"}); + args::ValueFlagList excludeLibraryPatterns(parser, "pattern", + "Shared library to exclude from deployment (glob pattern)", + {"exclude-library"}); args::ValueFlagList extraModules(parser, "module", "Extra Qt module to deploy (specified by name, filename or path)", {'m', "extra-module"}); @@ -135,6 +138,9 @@ int main(const int argc, const char *const *const argv) { ldLog() << std::endl << "Using Qt version: " << qtVersion << " (" << qtMajorVersion << ")" << std::endl; appdir::AppDir appDir(appDirPath.Get()); + if (const auto patterns = excludeLibraryPatterns.Get(); !patterns.empty()) { + appDir.setExcludeLibraryPatterns(patterns); + } // allow disabling copyright files deployment via environment variable if (getenv("DISABLE_COPYRIGHT_FILES_DEPLOYMENT") != nullptr) { From b0cb921a656c5630919d63f68953ee79fdeb0903 Mon Sep 17 00:00:00 2001 From: Daniel Nicoletti Date: Fri, 22 Aug 2025 16:02:41 -0300 Subject: [PATCH 24/33] Update linuxdeploy submodule This pulls the fix to allow to exclude libraries with LINUXDEPLOY_EXCLUDED_LIBRARIES env var Issue: #283 --- lib/linuxdeploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linuxdeploy b/lib/linuxdeploy index a29b9a4..160c700 160000 --- a/lib/linuxdeploy +++ b/lib/linuxdeploy @@ -1 +1 @@ -Subproject commit a29b9a48d7f0f8d0f404743274368327edcb5428 +Subproject commit 160c7007137c54cd6c5d6af3f7f951f18cda08af From 4e4d51c98fbc56cf5b048856b6313c78c6ad60cb Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Fri, 7 Nov 2025 20:08:35 +0100 Subject: [PATCH 25/33] Skip AppRun hook creation on Qt >= 6 --- src/main.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 04683d9..8092a05 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -308,10 +308,14 @@ int main(const int argc, const char *const *const argv) { return 1; } - ldLog() << std::endl << "-- Creating AppRun hook --" << std::endl; - if (!createAppRunHook(appDir)) { - ldLog() << LD_ERROR << "Failed to create AppRun hook in AppDir" << std::endl; - return 1; + if (qtMajorVersion >= 6) { + ldLog() << std::endl << "-- Note: skipping AppRun hook creation on Qt " << qtMajorVersion << " --" << std::endl; + } else { + ldLog() << std::endl << "-- Creating AppRun hook --" << std::endl; + if (!createAppRunHook(appDir)) { + ldLog() << LD_ERROR << "Failed to create AppRun hook in AppDir" << std::endl; + return 1; + } } ldLog() << std::endl << "Done!" << std::endl; From d1f624ad636edbb31b3f87ae52537213796edb30 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Fri, 7 Nov 2025 20:10:10 +0100 Subject: [PATCH 26/33] Update cmake-scripts --- lib/cmake-scripts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cmake-scripts b/lib/cmake-scripts index 21bd317..df32987 160000 --- a/lib/cmake-scripts +++ b/lib/cmake-scripts @@ -1 +1 @@ -Subproject commit 21bd317812e44f7ed925f3f3bffcb7136c30ae74 +Subproject commit df329871d82b9bbce76419aea59f595078dee024 From d15373bdd30c6a14ff2e06aa7a09866f190965c3 Mon Sep 17 00:00:00 2001 From: TheAssassin Date: Fri, 7 Nov 2025 20:48:58 +0100 Subject: [PATCH 27/33] Update linuxdeploy --- lib/linuxdeploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/linuxdeploy b/lib/linuxdeploy index 160c700..cc7b864 160000 --- a/lib/linuxdeploy +++ b/lib/linuxdeploy @@ -1 +1 @@ -Subproject commit 160c7007137c54cd6c5d6af3f7f951f18cda08af +Subproject commit cc7b86472c3caa3fd729b9dc502fd2aa78394257 From 511d51d066f632dfdfbcf0bf7284ec38090812d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Gro=C3=9F?= Date: Thu, 26 Feb 2026 21:51:33 +0100 Subject: [PATCH 28/33] Don't fail on non-existent plugins directory. When no plugins are available, Qt doesn't create a folder for them. For example, Qt might build with printsupport, but not create the printsupport plugins directory, because CUPS isn't installed and no libcupsprintersupport.so plugin was built. --- src/deployers/BasicPluginsDeployer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/deployers/BasicPluginsDeployer.cpp b/src/deployers/BasicPluginsDeployer.cpp index 9014bb3..0aadbce 100644 --- a/src/deployers/BasicPluginsDeployer.cpp +++ b/src/deployers/BasicPluginsDeployer.cpp @@ -38,6 +38,10 @@ bool BasicPluginsDeployer::deployStandardQtPlugins(const std::vectorpath().extension() == ".debug") { ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl; From 4b890f7f3009cb199a076d6b3b50e27b117b14e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Tue, 10 Mar 2026 17:47:17 +0100 Subject: [PATCH 29/33] Remove redundant nlohmann_json alias Fixes CMake error: CMake Error at CMakeLists.txt:31 (add_library): add_library cannot create ALIAS target "nlohmann_json::nlohmann_json" because another target with the same name already exists. --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c17bf52..1294ab1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,6 @@ if(NOT nlohmann_json_FOUND) ) FetchContent_MakeAvailable(nlohmann_json) - - add_library(nlohmann_json::nlohmann_json ALIAS nlohmann_json) endif() add_subdirectory(lib) From 6ffc34d96799cc71efc31dffac6233f6cc5499e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Mon, 2 Feb 2026 11:25:40 +0100 Subject: [PATCH 30/33] Clarify deprecation of EXTRA_QT_PLUGINS and update README.md Closes #197 --- README.md | 3 +-- src/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0dcb14e..7d1a67c 100644 --- a/README.md +++ b/README.md @@ -57,8 +57,7 @@ Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured so **Qt specific:** - `$QMAKE=/path/to/my/qmake`: use another `qmake` binary to detect paths of plugins and other resources (usually doesn't need to be set manually, most Qt environments ship scripts changing `$PATH`) - `$EXTRA_QT_MODULES=moduleA;moduleB`: Modules to deploy even if not found automatically by linuxdeploy-plugin-qt - - example: `EXTRA_QT_MODULES=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html) -- `$EXTRA_QT_PLUGINS=pluginA;pluginB`: extra Qt plugins to deploy + - Example: `EXTRA_QT_MODULES=svg;` if you want to use the module [QtSvg](https://doc.qt.io/qt-5/qtsvg-index.html) - To support Wayland, add `waylandcompositor` to this variable - `$EXTRA_PLATFORM_PLUGINS=platformA;platformB`: Platforms to deploy in addition to `libqxcb.so`. Platform must be available from `QT_INSTALL_PLUGINS/platforms`. - To support Wayland, add `libqwayland-egl.so;libqwayland-generic.so` diff --git a/src/main.cpp b/src/main.cpp index 8092a05..db89e05 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,7 +100,7 @@ int main(const int argc, const char *const *const argv) { ldLog() << LD_ERROR << "No such file or directory:" << qmakePath << std::endl; return 1; } - + ldLog() << "Using qmake:" << qmakePath << std::endl; auto qmakeVars = queryQmake(qmakePath); @@ -211,7 +211,7 @@ int main(const int argc, const char *const *const argv) { if (ret == nullptr) { ret = getenv("EXTRA_QT_PLUGINS"); if (ret) { - ldLog() << std::endl << LD_WARNING << "Using deprecated EXTRA_QT_PLUGINS env var" << std::endl; + ldLog() << std::endl << LD_WARNING << "Using deprecated EXTRA_QT_PLUGINS env var (renamed to EXTRA_QT_MODULES)" << std::endl; } } return ret; From e156c8a9c245d8be722b74f176cb1aa32a746b07 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 6 Apr 2026 11:57:29 +0100 Subject: [PATCH 31/33] Support for deploying Network Information plugins Issue-Id: https://github.com/linuxdeploy/linuxdeploy-plugin-qt/issues/154 --- src/deployers/CMakeLists.txt | 1 + .../NetworkInformationPluginsDeployer.cpp | 11 ++++++++++ .../NetworkInformationPluginsDeployer.h | 17 +++++++++++++++ src/deployers/PluginsDeployerFactory.cpp | 21 +++++++++++++------ 4 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 src/deployers/NetworkInformationPluginsDeployer.cpp create mode 100644 src/deployers/NetworkInformationPluginsDeployer.h diff --git a/src/deployers/CMakeLists.txt b/src/deployers/CMakeLists.txt index 0833e05..b9b069d 100644 --- a/src/deployers/CMakeLists.txt +++ b/src/deployers/CMakeLists.txt @@ -14,6 +14,7 @@ set(CLASSES LocationPluginsDeployer Multimedia5PluginsDeployer Multimedia6PluginsDeployer + NetworkInformationPluginsDeployer WebEnginePluginsDeployer QmlPluginsDeployer Qt3DPluginsDeployer diff --git a/src/deployers/NetworkInformationPluginsDeployer.cpp b/src/deployers/NetworkInformationPluginsDeployer.cpp new file mode 100644 index 0000000..e922331 --- /dev/null +++ b/src/deployers/NetworkInformationPluginsDeployer.cpp @@ -0,0 +1,11 @@ +#include "NetworkInformationPluginsDeployer.h" + +namespace linuxdeploy { +namespace plugin { +namespace qt { +bool NetworkInformationPluginsDeployer::doDeploy() { + return deployStandardQtPlugins({"networkinformation"}); +} +} // namespace qt +} // namespace plugin +} // namespace linuxdeploy diff --git a/src/deployers/NetworkInformationPluginsDeployer.h b/src/deployers/NetworkInformationPluginsDeployer.h new file mode 100644 index 0000000..1c6c766 --- /dev/null +++ b/src/deployers/NetworkInformationPluginsDeployer.h @@ -0,0 +1,17 @@ +#pragma once + +#include "BasicPluginsDeployer.h" + +namespace linuxdeploy { +namespace plugin { +namespace qt { +class NetworkInformationPluginsDeployer : public BasicPluginsDeployer { +public: + // we can just use the base class's constructor + using BasicPluginsDeployer::BasicPluginsDeployer; + + bool doDeploy() override; +}; +} // namespace qt +} // namespace plugin +} // namespace linuxdeploy diff --git a/src/deployers/PluginsDeployerFactory.cpp b/src/deployers/PluginsDeployerFactory.cpp index 18a9130..b3aa124 100644 --- a/src/deployers/PluginsDeployerFactory.cpp +++ b/src/deployers/PluginsDeployerFactory.cpp @@ -1,23 +1,24 @@ // local headers #include "PluginsDeployerFactory.h" #include "BasicPluginsDeployer.h" -#include "PlatformPluginsDeployer.h" #include "BearerPluginsDeployer.h" #include "GamepadPluginsDeployer.h" #include "LocationPluginsDeployer.h" #include "Multimedia5PluginsDeployer.h" #include "Multimedia6PluginsDeployer.h" -#include "PrintSupportPluginsDeployer.h" +#include "NetworkInformationPluginsDeployer.h" +#include "PlatformPluginsDeployer.h" #include "PositioningPluginsDeployer.h" +#include "PrintSupportPluginsDeployer.h" #include "QmlPluginsDeployer.h" #include "Qt3DPluginsDeployer.h" #include "SqlPluginsDeployer.h" #include "SvgPluginsDeployer.h" #include "TextToSpeechPluginsDeployer.h" -#include "WebEnginePluginsDeployer.h" -#include "XcbglIntegrationPluginsDeployer.h" #include "TlsBackendsDeployer.h" #include "WaylandcompositorPluginsDeployer.h" +#include "WebEnginePluginsDeployer.h" +#include "XcbglIntegrationPluginsDeployer.h" using namespace linuxdeploy::plugin::qt; using namespace linuxdeploy::core::appdir; @@ -51,8 +52,16 @@ std::vector> PluginsDeployerFactory::getDeploye if (moduleName == "network") { if (qtMajorVersion < 6) { return {getInstance(moduleName)}; - } else if (qtMinorVersion >= 2) { - return {getInstance(moduleName)}; + } else { + std::vector> deployers; + if (qtMinorVersion >= 1) { + deployers.push_back( + getInstance(moduleName)); + } + if (qtMinorVersion >= 2) { + deployers.push_back(getInstance(moduleName)); + } + return deployers; } } From af6a1df91020be69ed9ee648ca83ec82bdc0447d Mon Sep 17 00:00:00 2001 From: Gleb Popov <6yearold@gmail.com> Date: Sun, 3 May 2026 21:18:06 +0300 Subject: [PATCH 32/33] Fix findQmlImportScanner() on FreeBSD We don't install the qmlimportscanner executable into public location, so add a bit of extra logic to locate it. --- src/qml.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/qml.cpp b/src/qml.cpp index 3d588e5..6f997c1 100644 --- a/src/qml.cpp +++ b/src/qml.cpp @@ -1,6 +1,10 @@ // system headers #include +#ifdef __FreeBSD__ +#include +#endif + // library includes #include #include @@ -22,7 +26,18 @@ using namespace nlohmann; namespace fs = std::filesystem; fs::path findQmlImportScanner() { - return which("qmlimportscanner"); + auto path = which("qmlimportscanner"); + if (path.empty()) { + // at least on FreeBSD the qmlimportscanner binary is installed under + // QT_INSTALL_LIBEXECS for Qt 6 and QT_INSTALL_BINS for Qt5, + // so is not locatable via $PATH + auto qmakeVars = queryQmake(findQmake()); + path = which(qmakeVars["QT_INSTALL_LIBEXECS"] + "/qmlimportscanner"); + if (path.empty()) + path = which(qmakeVars["QT_INSTALL_BINS"] + "/qmlimportscanner"); + } + + return path; } std::string runQmlImportScanner(const std::vector &sourcesPaths, const std::vector &qmlImportPaths) { From 409307dd1614ff2120e748fdc3442601432c9c3f Mon Sep 17 00:00:00 2001 From: Gleb Popov <6yearold@gmail.com> Date: Fri, 15 May 2026 11:09:55 +0300 Subject: [PATCH 33/33] Fix the find_qmlimporter_path test on FreeBSD The qmlimportscanner executable is not necessarily located in /usr/bin across all OSes, so only check that we located an executable with a fitting name. --- lib/linuxdeploy | 2 +- tests/test_deploy_qml.cpp | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/linuxdeploy b/lib/linuxdeploy index cc7b864..3fdc95e 160000 --- a/lib/linuxdeploy +++ b/lib/linuxdeploy @@ -1 +1 @@ -Subproject commit cc7b86472c3caa3fd729b9dc502fd2aa78394257 +Subproject commit 3fdc95e75b6512430c59d4db12b28fa9bf0559c0 diff --git a/tests/test_deploy_qml.cpp b/tests/test_deploy_qml.cpp index 4ec945e..c6af3d1 100644 --- a/tests/test_deploy_qml.cpp +++ b/tests/test_deploy_qml.cpp @@ -52,10 +52,9 @@ namespace linuxdeploy { TEST_F(TestDeployQml, find_qmlimporter_path) { auto result = findQmlImportScanner(); - std::filesystem::path expected = "/usr/bin/qmlimportscanner"; ASSERT_FALSE(result.empty()); - ASSERT_EQ(result.string(), expected.string()); + ASSERT_EQ(result.filename().string(), "qmlimportscanner"); } TEST_F(TestDeployQml, runQmlImportScanner) {