From 871e855cb78c43651b993264a539d28aa03c810e Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 17:48:28 +0200 Subject: [PATCH 01/15] gnome.nautilus: add dev output So that propagatedBuildInputs do not pull gnome-autoar.dev into the out closure. --- pkgs/desktops/gnome/core/nautilus/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/desktops/gnome/core/nautilus/default.nix b/pkgs/desktops/gnome/core/nautilus/default.nix index a65eb44eed01..2a964964a09e 100644 --- a/pkgs/desktops/gnome/core/nautilus/default.nix +++ b/pkgs/desktops/gnome/core/nautilus/default.nix @@ -36,6 +36,8 @@ stdenv.mkDerivation rec { pname = "nautilus"; version = "41.0"; + outputs = [ "out" "dev" ]; + src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz"; sha256 = "+blBrcEEcAxn6kB2YiMV8fa3fc7BVMN/PUwLKDlQoeU="; From 7ae3ae5aabe660cb727d3e14cb247ac1509c7705 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 17:49:11 +0200 Subject: [PATCH 02/15] libgxps: add dev output So that propagatedBuildInputs do not pull libarchive.dev into the out closure. --- pkgs/development/libraries/libgxps/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/libgxps/default.nix b/pkgs/development/libraries/libgxps/default.nix index df05754da589..397939103400 100644 --- a/pkgs/development/libraries/libgxps/default.nix +++ b/pkgs/development/libraries/libgxps/default.nix @@ -6,6 +6,8 @@ stdenv.mkDerivation rec { pname = "libgxps"; version = "0.3.2"; + outputs = [ "out" "dev" ]; + src = fetchurl { url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; sha256 = "bSeGclajXM+baSU+sqiKMrrKO5fV9O9/guNmf6Q1JRw="; From dc6d7cd3f0bbde277b96fffa3da0c9ccb06fb60f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 18:24:14 +0200 Subject: [PATCH 03/15] adwaita-qt: add dev output So that gtk3.dev is not included in the closure through CMake files. --- pkgs/data/themes/adwaita-qt/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/data/themes/adwaita-qt/default.nix b/pkgs/data/themes/adwaita-qt/default.nix index 3e72d8a74b8a..f1424b15ad1a 100644 --- a/pkgs/data/themes/adwaita-qt/default.nix +++ b/pkgs/data/themes/adwaita-qt/default.nix @@ -14,6 +14,8 @@ mkDerivation rec { pname = "adwaita-qt"; version = "1.4.0"; + outputs = [ "out" "dev" ]; + src = fetchFromGitHub { owner = "FedoraQt"; repo = pname; From 758fa38581f8c2b62b46ebf2c044c9ed9b234862 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 18:26:22 +0200 Subject: [PATCH 04/15] python3.pkgs.dogtail: add dev output So that propagatedBuildInputs do not pull gtk3.dev into the out closure. --- pkgs/development/python-modules/dogtail/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/dogtail/default.nix b/pkgs/development/python-modules/dogtail/default.nix index 808c2916ddd9..fb513a20c654 100644 --- a/pkgs/development/python-modules/dogtail/default.nix +++ b/pkgs/development/python-modules/dogtail/default.nix @@ -19,6 +19,8 @@ buildPythonPackage { pname = "dogtail"; version = "0.9.11"; + outputs = [ "out" "dev" ]; + # https://gitlab.com/dogtail/dogtail/issues/1 # src = fetchPypi { # inherit pname version; From 050a1d0a6e7b40d67742c3870f00bac05ac859f1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 18:40:00 +0200 Subject: [PATCH 05/15] python3.pkgs.dogtail: add dev output So that propagatedBuildInputs do not pull gupnp.dev into the out closure. --- pkgs/development/libraries/dleyna-core/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/dleyna-core/default.nix b/pkgs/development/libraries/dleyna-core/default.nix index 4a4eecfdc0f2..e8e384ac2a00 100644 --- a/pkgs/development/libraries/dleyna-core/default.nix +++ b/pkgs/development/libraries/dleyna-core/default.nix @@ -10,6 +10,8 @@ stdenv.mkDerivation rec { pname = "dleyna-core"; version = "0.6.0"; + outputs = [ "out" "dev" ]; + setupHook = ./setup-hook.sh; src = fetchFromGitHub { From 22ab849288cabab48edcbfeb85271570ad9bffe1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 18:53:50 +0200 Subject: [PATCH 06/15] gnome.gnome-user-share: fix apache module path Also potentially reduces the number of dev dependencies in closure. --- pkgs/desktops/gnome/core/gnome-user-share/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome/core/gnome-user-share/default.nix b/pkgs/desktops/gnome/core/gnome-user-share/default.nix index 211326cfcdbd..bab13a6ccd19 100644 --- a/pkgs/desktops/gnome/core/gnome-user-share/default.nix +++ b/pkgs/desktops/gnome/core/gnome-user-share/default.nix @@ -50,7 +50,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dhttpd=${apacheHttpd.out}/bin/httpd" - "-Dmodules_path=${apacheHttpd.dev}/modules" + "-Dmodules_path=${apacheHttpd}/modules" "-Dsystemduserunitdir=${placeholder "out"}/etc/systemd/user" # In 3.34.0 it defaults to false but it is silently ignored and always installed. # Let’s add it anyway in case they decide to make build respect the option in the future. From b479d8e6a5ca1b6359ad687bcf3555592ff34545 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 18:54:21 +0200 Subject: [PATCH 07/15] mate.mate-user-share: fix apache module path Also potentially reduces the number of dev dependencies in closure. --- pkgs/desktops/mate/mate-user-share/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/mate/mate-user-share/default.nix b/pkgs/desktops/mate/mate-user-share/default.nix index 3e0062c7a793..264389a68836 100644 --- a/pkgs/desktops/mate/mate-user-share/default.nix +++ b/pkgs/desktops/mate/mate-user-share/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-httpd=${apacheHttpd.out}/bin/httpd" - "--with-modules-path=${apacheHttpd.dev}/modules" + "--with-modules-path=${apacheHttpd}/modules" "--with-cajadir=$(out)/lib/caja/extensions-2.0" ]; From ce639ad2d5cdd76cdd7dac77bc9c81a31e71943f Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 19:07:51 +0200 Subject: [PATCH 08/15] gnome.gnome-music: move python dependencies to pythonPath It is deprecated but otherwise wrapPython adds everything that is propagated, including dev outputs, to program_PATH, which ends up in the wrapper. --- pkgs/desktops/gnome/apps/gnome-music/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/desktops/gnome/apps/gnome-music/default.nix b/pkgs/desktops/gnome/apps/gnome-music/default.nix index ef0931e273c9..1468c1bde169 100644 --- a/pkgs/desktops/gnome/apps/gnome-music/default.nix +++ b/pkgs/desktops/gnome/apps/gnome-music/default.nix @@ -79,13 +79,12 @@ python3.pkgs.buildPythonApplication rec { gst-plugins-ugly ]); - propagatedBuildInputs = with python3.pkgs; [ + pythonPath = with python3.pkgs; [ pycairo dbus-python pygobject3 ]; - postPatch = '' for f in meson_post_conf.py meson_post_install.py; do chmod +x $f From c70f4c843d31e20d6673e4d63fdd40f4f9b7132c Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 20:11:08 +0200 Subject: [PATCH 09/15] gnome.gnome-music: fix double wrapping --- pkgs/desktops/gnome/apps/gnome-music/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/desktops/gnome/apps/gnome-music/default.nix b/pkgs/desktops/gnome/apps/gnome-music/default.nix index 1468c1bde169..96ec321fa4a9 100644 --- a/pkgs/desktops/gnome/apps/gnome-music/default.nix +++ b/pkgs/desktops/gnome/apps/gnome-music/default.nix @@ -92,6 +92,13 @@ python3.pkgs.buildPythonApplication rec { done ''; + # Prevent double wrapping, let the Python wrapper use the args in preFixup. + dontWrapGApps = true; + + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + doCheck = false; # handle setup hooks better From 9922d6335511cdc9404a425f904b68a3063eda17 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 21:03:41 +0200 Subject: [PATCH 10/15] mod_dnssd: run {pre,post}Install hooks --- pkgs/servers/http/apache-modules/mod_dnssd/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/servers/http/apache-modules/mod_dnssd/default.nix b/pkgs/servers/http/apache-modules/mod_dnssd/default.nix index a0a6235ace50..df8c046d7e31 100644 --- a/pkgs/servers/http/apache-modules/mod_dnssd/default.nix +++ b/pkgs/servers/http/apache-modules/mod_dnssd/default.nix @@ -20,8 +20,12 @@ stdenv.mkDerivation rec { }) ]; installPhase = '' + runHook preInstall + mkdir -p $out/modules cp src/.libs/mod_dnssd.so $out/modules + + runHook postInstall ''; meta = with lib; { From 345736016811b4109e92dd9802ccccc191e99356 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 21:04:15 +0200 Subject: [PATCH 11/15] mod_dnssd: strip debugging symbols Otherwise gnome-user-share and thus the whole GNOME will pull in apacheHttpd.dev & co. --- pkgs/servers/http/apache-modules/mod_dnssd/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/servers/http/apache-modules/mod_dnssd/default.nix b/pkgs/servers/http/apache-modules/mod_dnssd/default.nix index df8c046d7e31..4f4236e91b58 100644 --- a/pkgs/servers/http/apache-modules/mod_dnssd/default.nix +++ b/pkgs/servers/http/apache-modules/mod_dnssd/default.nix @@ -28,6 +28,12 @@ stdenv.mkDerivation rec { runHook postInstall ''; + preFixup = '' + # TODO: Packages in non-standard directories not stripped. + # https://github.com/NixOS/nixpkgs/issues/141554 + stripDebugList=modules + ''; + meta = with lib; { homepage = "http://0pointer.de/lennart/projects/mod_dnssd"; description = "Provide Zeroconf support via DNS-SD using Avahi"; From 45bf279eaa46a923eef23258db5ae8af4ad555b1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 21:14:11 +0200 Subject: [PATCH 12/15] gnome.gnome-tweaks: move python dependencies to pythonPath It is deprecated but otherwise wrapPython adds everything that is propagated, including dev outputs, to program_PATH, which ends up in the wrapper. --- pkgs/desktops/gnome/misc/gnome-tweaks/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/desktops/gnome/misc/gnome-tweaks/default.nix b/pkgs/desktops/gnome/misc/gnome-tweaks/default.nix index c220e7eeccd1..6a9f4f19385d 100644 --- a/pkgs/desktops/gnome/misc/gnome-tweaks/default.nix +++ b/pkgs/desktops/gnome/misc/gnome-tweaks/default.nix @@ -56,7 +56,7 @@ python3Packages.buildPythonApplication rec { libsoup ]; - propagatedBuildInputs = with python3Packages; [ + pythonPath = with python3Packages; [ pygobject3 ]; From ab9bbad9ea45608591a431301fe3bdc603fe2874 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 21:22:37 +0200 Subject: [PATCH 13/15] orca: move python dependencies to pythonPath It is deprecated but otherwise wrapPython adds everything that is propagated, including dev outputs, to program_PATH, which ends up in the wrapper. --- pkgs/applications/misc/orca/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/orca/default.nix b/pkgs/applications/misc/orca/default.nix index f8facbe01fa0..fe739cb581a3 100644 --- a/pkgs/applications/misc/orca/default.nix +++ b/pkgs/applications/misc/orca/default.nix @@ -65,7 +65,7 @@ buildPythonApplication rec { gobject-introspection ]; - propagatedBuildInputs = [ + pythonPath = [ pygobject3 pyatspi dbus-python From 1a8fc0bb5245d190dad9823d6c19badc1b3bbfa1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 22:53:14 +0200 Subject: [PATCH 14/15] gst_all_1.gst-plugins-bad: disable asserts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `lib/gstreamer-1.0/libgstdvbsubenc.so` and `lib/libgstcodecparsers-1.0.so` include `${gstreamer.dev}/include/gstreamer-1.0/gst/base/gstbitwriter.h` in their .rodata section, increasing the runtime closure unnecessarily. This happens because `gstbitwriter.h` header uses GLib’s `g_assert` macro, which wants to print `__FILE__` on assertion failure. The assertions can and should be disabled on stable releases (https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/7b8d74c15bb817c65c06c63580dae3633a914841) so let’s do that. --- pkgs/development/libraries/gstreamer/bad/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index aa89d947a012..de6ccd153780 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -233,6 +233,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dexamples=disabled" # requires many dependencies and probably not useful for our users "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing + "-Dglib-asserts=disabled" # asserts should be disabled on stable releases "-Davtp=disabled" "-Ddts=disabled" # required `libdca` library not packaged in nixpkgs as of writing, and marked as "BIG FAT WARNING: libdca is still in early development" From 800ceaf1bdba85525015c967eb9921977a35090a Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 13 Oct 2021 23:01:47 +0200 Subject: [PATCH 15/15] gst_all_1.gst-plugins-good: disable asserts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `lib/gstreamer-1.0/libgstrtpmanager.so` includes `${gstreamer.dev}/include/gstreamer-1.0/gst/base/gstbitwriter.h` in their .rodata section, increasing the runtime closure unnecessarily. This happens because `gstbitwriter.h` header uses GLib’s `g_assert` macro, which wants to print `__FILE__` on assertion failure. The assertions can and should be disabled on stable releases (https://gitlab.freedesktop.org/gstreamer/gstreamer/-/commit/ce64f0e0e0d4e692c8d99f9744d38b9676b3d720) so let’s do that. --- pkgs/development/libraries/gstreamer/good/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/libraries/gstreamer/good/default.nix b/pkgs/development/libraries/gstreamer/good/default.nix index 86684893efd3..bc1656c191a4 100644 --- a/pkgs/development/libraries/gstreamer/good/default.nix +++ b/pkgs/development/libraries/gstreamer/good/default.nix @@ -120,6 +120,7 @@ stdenv.mkDerivation rec { mesonFlags = [ "-Dexamples=disabled" # requires many dependencies and probably not useful for our users "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing + "-Dglib-asserts=disabled" # asserts should be disabled on stable releases ] ++ lib.optionals (!qt5Support) [ "-Dqt5=disabled" ] ++ lib.optionals (!gtkSupport) [