Merge pull request #202625 from NickCao/qt6-paths

fixes https://github.com/NixOS/nixpkgs/issues/202622
This commit is contained in:
Artturi 2022-12-30 14:26:16 +02:00 committed by GitHub
commit bb0949f4e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 36 additions and 19 deletions

View file

@ -266,7 +266,6 @@ stdenv.mkDerivation rec {
# Move development tools to $dev
moveQtDevTools
moveToOutput bin "$dev"
moveToOutput libexec "$dev"
# fixup .pc file (where to find 'moc' etc.)

View file

@ -17,4 +17,28 @@ qtModule {
NIX_CFLAGS_COMPILE = [
"-DNIX_OUTPUT_DEV=\"${placeholder "dev"}\""
];
devTools = [
"bin/qcollectiongenerator"
"bin/linguist"
"bin/assistant"
"bin/qdoc"
"bin/lconvert"
"bin/designer"
"bin/qtattributionsscanner"
"bin/lrelease"
"bin/lrelease-pro"
"bin/pixeltool"
"bin/lupdate"
"bin/lupdate-pro"
"bin/qtdiag"
"bin/qhelpgenerator"
"bin/qtplugininfo"
"bin/qthelpconverter"
"bin/lprodump"
"bin/qdistancefieldgenerator"
] ++ lib.optionals stdenv.isDarwin [
"bin/macdeployqt"
];
}

View file

@ -1,4 +1,4 @@
commit 4f497c358e0386b65df1c1d636aadf72f8647134
commit bd8f6ecea0663bdd150aa48941cbd47d25874396
Author: Nick Cao <nickcao@nichi.co>
Date: Tue Apr 19 13:49:59 2022 +0800
@ -13,10 +13,10 @@ Date: Tue Apr 19 13:49:59 2022 +0800
generated cmake files to point to the corrected pathes.
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 8b0f64e23b..03291e2ee2 100644
index 5a33349b19..677a6084d6 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -6,6 +6,7 @@
@@ -7,6 +7,7 @@
#include <cstring>
#include <sstream>
#include <utility>
@ -24,7 +24,7 @@ index 8b0f64e23b..03291e2ee2 100644
#include <cm/memory>
@@ -325,9 +326,23 @@ static void prefixItems(std::string& exportDirs)
@@ -330,9 +331,21 @@ static void prefixItems(std::string& exportDirs)
for (std::string const& e : entries) {
exportDirs += sep;
sep = ";";
@ -35,8 +35,6 @@ index 8b0f64e23b..03291e2ee2 100644
+ if (std::getenv("dev")) {
+ if (cmHasLiteralPrefix(e, "include") || cmHasLiteralPrefix(e, "./include")) {
+ exportDirs += std::getenv("dev");
+ } else if (cmHasLiteralPrefix(e, "bin") || cmHasLiteralPrefix(e, "./bin")) {
+ exportDirs += std::getenv("dev");
+ } else if (cmHasLiteralPrefix(e, "mkspecs") || cmHasLiteralPrefix(e, "./mkspecs")) {
+ exportDirs += std::getenv("dev");
+ } else if (cmHasLiteralPrefix(e, "libexec") || cmHasLiteralPrefix(e, "./libexec")) {
@ -52,18 +50,18 @@ index 8b0f64e23b..03291e2ee2 100644
exportDirs += e;
}
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index 4a3c565bce..5afa9e5e50 100644
index adccdfeece..ba248305bd 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -5,6 +5,7 @@
@@ -6,6 +6,7 @@
#include <memory>
#include <sstream>
#include <utility>
+#include <cstdlib>
#include "cmExportSet.h"
#include "cmGeneratedFileStream.h"
@@ -263,7 +264,7 @@ void cmExportInstallFileGenerator::LoadConfigFiles(std::ostream& os)
#include "cmFileSet.h"
@@ -266,7 +267,7 @@ void cmExportInstallFileGenerator::LoadConfigFiles(std::ostream& os)
void cmExportInstallFileGenerator::ReplaceInstallPrefix(std::string& input)
{
@ -72,7 +70,7 @@ index 4a3c565bce..5afa9e5e50 100644
}
bool cmExportInstallFileGenerator::GenerateImportFileConfig(
@@ -381,9 +382,24 @@ void cmExportInstallFileGenerator::SetImportLocationProperty(
@@ -382,9 +383,22 @@ void cmExportInstallFileGenerator::SetImportLocationProperty(
// Construct the installed location of the target.
std::string dest = itgen->GetDestination(config);
std::string value;
@ -83,8 +81,6 @@ index 4a3c565bce..5afa9e5e50 100644
+ if (std::getenv("dev")) {
+ if (cmHasLiteralPrefix(dest, "include") || cmHasLiteralPrefix(dest, "./include")) {
+ value = std::getenv("dev");
+ } else if (cmHasLiteralPrefix(dest, "bin") || cmHasLiteralPrefix(dest, "./bin")) {
+ value = std::getenv("dev");
+ } else if (cmHasLiteralPrefix(dest, "mkspecs") || cmHasLiteralPrefix(dest, "./mkspecs")) {
+ value = std::getenv("dev");
+ } else if (cmHasLiteralPrefix(dest, "libexec") || cmHasLiteralPrefix(dest, "./libexec")) {
@ -100,10 +96,10 @@ index 4a3c565bce..5afa9e5e50 100644
value += dest;
value += "/";
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 840f5112d6..7bb4ab41aa 100644
index f988e54a19..cc5c7ac9fd 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -197,7 +197,22 @@ static void prefixItems(const std::string& content, std::string& result,
@@ -192,7 +192,20 @@ static void prefixItems(const std::string& content, std::string& result,
sep = ";";
if (!cmSystemTools::FileIsFullPath(e) &&
cmGeneratorExpression::Find(e) != 0) {
@ -111,8 +107,6 @@ index 840f5112d6..7bb4ab41aa 100644
+ if (std::getenv("dev")) {
+ if (cmHasLiteralPrefix(e, "include") || cmHasLiteralPrefix(e, "./include")) {
+ result += std::getenv("dev");
+ } else if (cmHasLiteralPrefix(e, "bin") || cmHasLiteralPrefix(e, "./bin")) {
+ result += std::getenv("dev");
+ } else if (cmHasLiteralPrefix(e, "mkspecs") || cmHasLiteralPrefix(e, "./mkspecs")) {
+ result += std::getenv("dev");
+ } else if (cmHasLiteralPrefix(e, "libexec") || cmHasLiteralPrefix(e, "./libexec")) {

View file

@ -33,7 +33,7 @@ stdenv.mkDerivation (args // {
postInstall = ''
if [ ! -z "$dev" ]; then
mkdir "$dev"
for dir in bin libexec mkspecs
for dir in libexec mkspecs
do
moveToOutput "$dir" "$dev"
done