From 020b5d723eabf1c7bbdce40d54dc336c0fb81354 Mon Sep 17 00:00:00 2001 From: Gleb Popov <6yearold@gmail.com> Date: Sun, 3 May 2026 21:18:06 +0300 Subject: [PATCH 1/2] 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 327b6cc785769c465dec6d3ff5ab70ca8a81e62e Mon Sep 17 00:00:00 2001 From: Gleb Popov <6yearold@gmail.com> Date: Fri, 15 May 2026 11:09:55 +0300 Subject: [PATCH 2/2] 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) {