From 496a2f43b4455959a7a7aece0bece913003c5bf5 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 31 Dec 2022 18:29:44 +0800 Subject: [PATCH] qt6.qtbase: patch QTEST_ASSERT and other macros to remove reference to qtbase.dev via __FILE__ macro This is safe because they are only used for printing debug messages, alternatives are setting -fmacro-prefix-map=${qtbase.dev}=qtbase.dev in NIX_CFLAGS_COMPILE or injecting #line directives in all header files, but they would interfere with other usages of __FILE__ macro that might depend on the the path to actually point to a file. --- pkgs/development/libraries/qt-6/modules/qtbase.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index dc40394a471..a9c8ddc83a8 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -271,6 +271,9 @@ stdenv.mkDerivation rec { -e "/^bindir=/ c bindir=$dev/bin" patchShebangs $out $dev + + # QTEST_ASSERT and other macros keeps runtime reference to qtbase.dev + substituteInPlace "$dev/include/QtTest/qtestassert.h" --replace "__FILE__" "__BASE_FILE__" ''; dontStrip = debugSymbols;