about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2022-11-22 14:07:03 +0800
committerPeter Hoeg <peter@hoeg.com>2022-11-23 09:27:49 +0800
commitdc7783ece2224cc38b725551e903af65633fa6b3 (patch)
treef1bd1589ccb0a4bc8a306f34ddb4fa7f01ed85ed /pkgs
parent091e6d7c69f3101501b91cecd35b0d200d9bd9f6 (diff)
qt6Packages.qttools: fix tool path
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/qt-6/modules/qttools.nix7
-rw-r--r--pkgs/development/libraries/qt-6/patches/qttools-paths.patch27
2 files changed, 34 insertions, 0 deletions
diff --git a/pkgs/development/libraries/qt-6/modules/qttools.nix b/pkgs/development/libraries/qt-6/modules/qttools.nix
index b1cf5dd2c146d..06ce64424d557 100644
--- a/pkgs/development/libraries/qt-6/modules/qttools.nix
+++ b/pkgs/development/libraries/qt-6/modules/qttools.nix
@@ -3,9 +3,16 @@
 , lib
 , qtbase
 , qtdeclarative
+, substituteAll
 }:
 
 qtModule {
   pname = "qttools";
   qtInputs = [ qtbase qtdeclarative ];
+  patches = [
+    ../patches/qttools-paths.patch
+  ];
+  NIX_CFLAGS_COMPILE = [
+    "-DNIX_OUTPUT_DEV=\"${placeholder "dev"}\""
+  ];
 }
diff --git a/pkgs/development/libraries/qt-6/patches/qttools-paths.patch b/pkgs/development/libraries/qt-6/patches/qttools-paths.patch
new file mode 100644
index 0000000000000..9a0acb70b0f4a
--- /dev/null
+++ b/pkgs/development/libraries/qt-6/patches/qttools-paths.patch
@@ -0,0 +1,27 @@
+diff --git a/src/linguist/shared/runqttool.cpp b/src/linguist/shared/runqttool.cpp
+index d355b9dc..94fef33f 100644
+--- a/src/linguist/shared/runqttool.cpp
++++ b/src/linguist/shared/runqttool.cpp
+@@ -20,9 +20,21 @@ class FMT {
+     Q_DECLARE_TR_FUNCTIONS(Linguist)
+ };
+
++static QString qtBasePath(QLibraryInfo::LibraryPath location)
++{
++  switch (location) {
++    case QLibraryInfo::BinariesPath:
++      return QLatin1String(NIX_OUTPUT_DEV) + QLatin1String("/bin");
++    case QLibraryInfo::LibraryExecutablesPath:
++      return QLatin1String(NIX_OUTPUT_DEV) + QLatin1String("/libexec");
++    default:
++      return QLibraryInfo::path(location);
++  }
++}
++
+ static QString qtToolFilePath(const QString &toolName, QLibraryInfo::LibraryPath location)
+ {
+-    QString filePath = QLibraryInfo::path(location) + QLatin1Char('/') + toolName;
++    QString filePath = qtBasePath(location) + QLatin1Char('/') + toolName;
+ #ifdef Q_OS_WIN
+     filePath.append(QLatin1String(".exe"));
+ #endif