qt6: do not move devTools to dev output

This commit is contained in:
Nick Cao 2023-04-13 21:11:49 +08:00
parent 5aa78f89f0
commit d84e2bf056
No known key found for this signature in database
3 changed files with 2 additions and 68 deletions

View file

@ -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
}

View file

@ -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;

View file

@ -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++";