From 60f6a46bbd29b6a9f7e7a0ae8b42ddc1b02f2b40 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 31 Dec 2022 09:35:16 +0800 Subject: [PATCH 1/7] qt6.qtbase: remove valgrind from propagatedBuildInputs reduces the build-time closure and the runtime closure of packages accidentally referencing qtbase.dev by nearly 600M --- pkgs/development/libraries/qt-6/modules/qtbase.nix | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkgs/development/libraries/qt-6/modules/qtbase.nix b/pkgs/development/libraries/qt-6/modules/qtbase.nix index 5bbed5cb51e..dc40394a471 100644 --- a/pkgs/development/libraries/qt-6/modules/qtbase.nix +++ b/pkgs/development/libraries/qt-6/modules/qtbase.nix @@ -31,7 +31,6 @@ , libsepol , vulkan-headers , vulkan-loader -, valgrind , libthai , libdrm , libdatrie @@ -140,7 +139,6 @@ stdenv.mkDerivation rec { libthai libdrm libdatrie - valgrind udev # Text rendering fontconfig From 753da128bd2ce4a5e8108fb0617e31a87e458fac Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 31 Dec 2022 08:51:56 +0800 Subject: [PATCH 2/7] qt6.qtvirtualkeyboard: add dev output --- pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix b/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix index bb868dc6182..9c53f11e1a3 100644 --- a/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix +++ b/pkgs/development/libraries/qt-6/modules/qtvirtualkeyboard.nix @@ -11,5 +11,4 @@ qtModule { qtInputs = [ qtbase qtdeclarative qtsvg ]; propagatedBuildInputs = [ hunspell ]; nativeBuildInputs = [ pkg-config ]; - outputs = [ "out" ]; } From 650f51f373f2fea2ace997ad29390d679abbbc2e Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 31 Dec 2022 09:29:49 +0800 Subject: [PATCH 3/7] qt6Packages.quazip: add dev output --- pkgs/development/libraries/quazip/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/quazip/default.nix b/pkgs/development/libraries/quazip/default.nix index 610f408e441..31bcdc374d7 100644 --- a/pkgs/development/libraries/quazip/default.nix +++ b/pkgs/development/libraries/quazip/default.nix @@ -18,6 +18,8 @@ stdenv.mkDerivation rec { dontWrapQtApps = true; + outputs = [ "out" "dev" ]; + meta = with lib; { description = "Provides access to ZIP archives from Qt programs"; license = licenses.lgpl21Plus; From bffa10ffa3db5aaaa9f505de2c34879faaed06cd Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 31 Dec 2022 10:17:58 +0800 Subject: [PATCH 4/7] openboard: fix build --- pkgs/applications/graphics/openboard/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/graphics/openboard/default.nix b/pkgs/applications/graphics/openboard/default.nix index b0d59d4a7f5..3178c50c933 100644 --- a/pkgs/applications/graphics/openboard/default.nix +++ b/pkgs/applications/graphics/openboard/default.nix @@ -23,7 +23,7 @@ let install -Dm755 OpenBoardImporter $out/bin/OpenBoardImporter ''; }; -in stdenv.mkDerivation rec { +in stdenv.mkDerivation { pname = "openboard"; version = "unstable-2022-11-28"; @@ -36,9 +36,9 @@ in stdenv.mkDerivation rec { postPatch = '' substituteInPlace OpenBoard.pro \ - --replace '/usr/include/quazip5' '${quazip}/include/QuaZip-Qt5-${quazip.version}/quazip' \ + --replace '/usr/include/quazip5' '${lib.getDev quazip}/include/QuaZip-Qt5-${quazip.version}/quazip' \ --replace '-lquazip5' '-lquazip1-qt5' \ - --replace '/usr/include/poppler' '${poppler.dev}/include/poppler' + --replace '/usr/include/poppler' '${lib.getDev poppler}/include/poppler' ''; nativeBuildInputs = [ qmake copyDesktopItems wrapQtAppsHook ]; From 443560c8312c5dd8a9f97f61998a5072b5383be3 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 31 Dec 2022 10:20:48 +0800 Subject: [PATCH 5/7] fritzing: fix build --- pkgs/applications/science/electronics/fritzing/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/electronics/fritzing/default.nix b/pkgs/applications/science/electronics/fritzing/default.nix index ca2b2e5175b..22b65f2da31 100644 --- a/pkgs/applications/science/electronics/fritzing/default.nix +++ b/pkgs/applications/science/electronics/fritzing/default.nix @@ -61,7 +61,7 @@ stdenv.mkDerivation rec { cp -a ${parts}/* parts/ ''; - NIX_CFLAGS_COMPILE = "-I${quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}/quazip"; + NIX_CFLAGS_COMPILE = "-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}/quazip"; qmakeFlags = [ "phoenix.pro" From 01c8e3d8bbada41a0caeb7b48292aad1fa3d7838 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 31 Dec 2022 18:30:28 +0800 Subject: [PATCH 6/7] Revert "qt6.qtdeclarative: reduce closure size by removing reference to qtbase.dev" This reverts commit cec6862940c2deb71b599536dc31c5d10a43b5d6. --- pkgs/development/libraries/qt-6/modules/qtdeclarative.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix index 76231f866ef..fcb699298fe 100644 --- a/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix +++ b/pkgs/development/libraries/qt-6/modules/qtdeclarative.nix @@ -36,8 +36,4 @@ qtModule { "bin/qmlscene" "bin/qmltestrunner" ]; - - NIX_CFLAGS_COMPILE = [ - "-fmacro-prefix-map=${qtbase.dev}=qtbase.dev" - ]; } From 496a2f43b4455959a7a7aece0bece913003c5bf5 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Sat, 31 Dec 2022 18:29:44 +0800 Subject: [PATCH 7/7] 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;