From 54452b041dde6ead47ca13616d1e45f0056703db Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Sun, 15 Jan 2023 03:38:03 +0100 Subject: [PATCH] qt6.qtbase: detect if file exists --- pkgs/development/libraries/qt-6/modules/qtbase.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index d539abff5130..ae89c223d2df 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -269,7 +269,7 @@ stdenv.mkDerivation rec { moveToOutput libexec "$dev" # fixup .pc file (where to find 'moc' etc.) - if [ -d "$dev/lib/pkgconfig" ]; then + if [ -f "$dev/lib/pkgconfig/Qt6Core.pc" ]; then sed -i "$dev/lib/pkgconfig/Qt6Core.pc" \ -e "/^bindir=/ c bindir=$dev/bin" fi @@ -277,7 +277,9 @@ stdenv.mkDerivation rec { patchShebangs $out $dev # QTEST_ASSERT and other macros keeps runtime reference to qtbase.dev - substituteInPlace "$dev/include/QtTest/qtestassert.h" --replace "__FILE__" "__BASE_FILE__" + if [ -f "$dev/include/QtTest/qtestassert.h" ]; then + substituteInPlace "$dev/include/QtTest/qtestassert.h" --replace "__FILE__" "__BASE_FILE__" + fi ''; dontStrip = debugSymbols;