From d84e2bf05653e277c74afc1077f3126d403bf720 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 13 Apr 2023 21:11:49 +0800 Subject: [PATCH] qt6: do not move devTools to dev output --- .../libraries/qt-6/hooks/move-qt-dev-tools.sh | 34 ------------------- .../libraries/qt-6/modules/qtbase.nix | 27 ++------------- pkgs/development/libraries/qt-6/qtModule.nix | 9 ----- 3 files changed, 2 insertions(+), 68 deletions(-) delete mode 100644 pkgs/development/libraries/qt-6/hooks/move-qt-dev-tools.sh diff --git a/pkgs/development/libraries/qt-6/hooks/move-qt-dev-tools.sh b/pkgs/development/libraries/qt-6/hooks/move-qt-dev-tools.sh deleted file mode 100644 index 85489c85105b..000000000000 --- a/pkgs/development/libraries/qt-6/hooks/move-qt-dev-tools.sh +++ /dev/null @@ -1,34 +0,0 @@ -updateToolPath() { - local tool="$1" - local target="$2" - local original="${!outputBin}/$tool" - local actual="${!outputDev}/$tool" - if grep -q "$original" "$target"; then - echo "updateToolPath: Updating \`$original' in \`$target\'..." - sed -i "$target" -e "s|$original|$actual|" - fi -} - -moveQtDevTools() { - if [ -n "$devTools" ]; then - for tool in $devTools; do - moveToOutput "$tool" "${!outputDev}" - done - - if [ -d "${!outputDev}/mkspecs" ]; then - find "${!outputDev}/mkspecs" -name '*.pr?' | while read pr_; do - for tool in $devTools; do - updateToolPath "$tool" "$pr_" - done - done - fi - - if [ -d "${!outputDev}/lib/cmake" ]; then - find "${!outputDev}/lib/cmake" -name '*.cmake' | while read cmake; do - for tool in $devTools; do - updateToolPath "$tool" "$cmake" - done - done - fi - fi -} diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index 0babdbc6094c..b529bd7b9684 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -204,7 +204,6 @@ stdenv.mkDerivation rec { preHook = '' . "$fix_qt_builtin_paths" . "$fix_qt_module_paths" - . ${../hooks/move-qt-dev-tools.sh} . ${../hooks/fix-qmake-libtool.sh} ''; @@ -263,30 +262,8 @@ stdenv.mkDerivation rec { moveToDev = false; postFixup = '' - moveToOutput "mkspecs" "$dev" - moveToOutput "modules" "$dev" - moveToOutput "lib/*.prl" "$dev" - - fixQtModulePaths "$dev/mkspecs/modules" - fixQtBuiltinPaths "$dev" '*.pr?' - - # Move development tools to $dev - moveQtDevTools - moveToOutput libexec "$dev" - - # fixup .pc file (where to find 'moc' etc.) - if [ -f "$dev/lib/pkgconfig/Qt6Core.pc" ]; then - sed -i "$dev/lib/pkgconfig/Qt6Core.pc" \ - -e "/^bindir=/ c bindir=$dev/bin" \ - -e "/^libexecdir=/ c libexecdir=$dev/libexec" - fi - - patchShebangs $out $dev - - # QTEST_ASSERT and other macros keeps runtime reference to qtbase.dev - if [ -f "$dev/include/QtTest/qtestassert.h" ]; then - substituteInPlace "$dev/include/QtTest/qtestassert.h" --replace "__FILE__" "__BASE_FILE__" - fi + fixQtModulePaths "$out/mkspecs/modules" + fixQtBuiltinPaths "$out" '*.pr?' ''; dontStrip = debugSymbols; diff --git a/pkgs/development/libraries/qt-6/qtModule.nix b/pkgs/development/libraries/qt-6/qtModule.nix index d7952db753e7..2f7de7502379 100644 --- a/pkgs/development/libraries/qt-6/qtModule.nix +++ b/pkgs/development/libraries/qt-6/qtModule.nix @@ -18,10 +18,6 @@ stdenv.mkDerivation (args // { inherit pname version src; patches = args.patches or patches.${pname} or [ ]; - preHook = '' - . ${./hooks/move-qt-dev-tools.sh} - ''; - buildInputs = args.buildInputs or [ ]; nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [ cmake ninja perl ]; propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or [ ]); @@ -32,11 +28,6 @@ stdenv.mkDerivation (args // { dontWrapQtApps = args.dontWrapQtApps or true; - postFixup = '' - moveToOutput "libexec" "''${!outputDev}" - moveQtDevTools - '' + args.postFixup or ""; - meta = with lib; { homepage = "https://www.qt.io/"; description = "A cross-platform application framework for C++";