mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-20 11:53:51 +00:00
qt6Packages.qttools: fix tool path
This commit is contained in:
parent
091e6d7c69
commit
dc7783ece2
@ -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"}\""
|
||||
];
|
||||
}
|
||||
|
27
pkgs/development/libraries/qt-6/patches/qttools-paths.patch
Normal file
27
pkgs/development/libraries/qt-6/patches/qttools-paths.patch
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user