From 9cd155f1e26a2513e22c3b8a1893ea4d326a4048 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Sun, 9 Dec 2018 00:13:04 +0000 Subject: [PATCH 1/5] pruneLibtoolFiles: more permissive regex for detecting libtool files --- pkgs/build-support/setup-hooks/prune-libtool-files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-hooks/prune-libtool-files.sh b/pkgs/build-support/setup-hooks/prune-libtool-files.sh index d75812e05b60..2413624124f3 100644 --- a/pkgs/build-support/setup-hooks/prune-libtool-files.sh +++ b/pkgs/build-support/setup-hooks/prune-libtool-files.sh @@ -16,7 +16,7 @@ _pruneLibtoolFiles() { # the "old_library" field for static libraries. We are processing only # those .la files that do not describe static libraries. find "$prefix" -type f -name '*.la' \ - -exec grep -q '^# Generated by libtool' {} \; \ + -exec grep -q '^# Generated by .*libtool' {} \; \ -exec grep -q "^old_library=''" {} \; \ -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; } From 93545a891035aab130e4aee227015aaabe916212 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Sun, 9 Dec 2018 22:44:29 +0000 Subject: [PATCH 2/5] pruneLibtoolFiles: check if prefix exists --- pkgs/build-support/setup-hooks/prune-libtool-files.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/setup-hooks/prune-libtool-files.sh b/pkgs/build-support/setup-hooks/prune-libtool-files.sh index 2413624124f3..5d7432e8f09a 100644 --- a/pkgs/build-support/setup-hooks/prune-libtool-files.sh +++ b/pkgs/build-support/setup-hooks/prune-libtool-files.sh @@ -8,7 +8,7 @@ fixupOutputHooks+=(_pruneLibtoolFiles) _pruneLibtoolFiles() { - if [ "$dontPruneLibtoolFiles" ]; then + if [ "$dontPruneLibtoolFiles" ] || [ ! -e "$prefix" ]; then return fi From 44c9c27d545c171356860580307696f47b2076fc Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Sun, 9 Dec 2018 22:45:15 +0000 Subject: [PATCH 3/5] stdenv: prune libtool files by default --- pkgs/stdenv/generic/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index be9d38f9780a..5d2c851fe1b5 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -47,6 +47,7 @@ let ../../build-support/setup-hooks/compress-man-pages.sh ../../build-support/setup-hooks/strip.sh ../../build-support/setup-hooks/patch-shebangs.sh + ../../build-support/setup-hooks/prune-libtool-files.sh ] # FIXME this on Darwin; see # https://github.com/NixOS/nixpkgs/commit/94d164dd7#commitcomment-22030369 From 743d03bafc7650aa3ac8a7291158bb835fd861e1 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Sun, 9 Dec 2018 23:16:12 +0000 Subject: [PATCH 4/5] doc/stdenv: document dontPruneLibtoolFiles --- doc/stdenv.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/stdenv.xml b/doc/stdenv.xml index 4ef89991d2f2..f7e7b924f41e 100644 --- a/doc/stdenv.xml +++ b/doc/stdenv.xml @@ -1662,6 +1662,18 @@ installTargets = "install-bin install-doc"; + + + dontPruneLibtoolFiles + + + + If set, libtool .la files associated with shared + libraries won't have their dependency_libs field + cleared. + + + forceShare From d121dd5222274234a420d1c31732b9049a734d73 Mon Sep 17 00:00:00 2001 From: Piotr Bogdan Date: Sun, 9 Dec 2018 22:55:10 +0000 Subject: [PATCH 5/5] treewide: remove references to pruneLibtoolFiles, now included by default --- pkgs/applications/misc/digitalbitbox/default.nix | 2 -- pkgs/development/libraries/SDL2/default.nix | 4 ++-- pkgs/development/libraries/libheif/default.nix | 4 ++-- pkgs/development/libraries/webkitgtk/2.4.nix | 4 ++-- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/misc/digitalbitbox/default.nix b/pkgs/applications/misc/digitalbitbox/default.nix index 3e6a6ab53f77..dd7fe7b355a3 100644 --- a/pkgs/applications/misc/digitalbitbox/default.nix +++ b/pkgs/applications/misc/digitalbitbox/default.nix @@ -68,8 +68,6 @@ in stdenv.mkDerivation rec { ]; buildInputs = [ - # TODO: remove libcap when pruneLibtoolFiles applies to pulseaudio. - libcap libevent libtool udev diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix index e009204133ef..4a418c134262 100644 --- a/pkgs/development/libraries/SDL2/default.nix +++ b/pkgs/development/libraries/SDL2/default.nix @@ -1,4 +1,4 @@ -{ stdenv, config, libGLSupported, fetchurl, pkgconfig, pruneLibtoolFiles +{ stdenv, config, libGLSupported, fetchurl, pkgconfig , openglSupport ? libGLSupported, libGL , alsaSupport ? stdenv.isLinux, alsaLib , x11Support ? !stdenv.isCygwin, libX11, xproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { patches = [ ./find-headers.patch ]; - nativeBuildInputs = [ pkgconfig pruneLibtoolFiles ]; + nativeBuildInputs = [ pkgconfig ]; propagatedBuildInputs = dlopenPropagatedBuildInputs; diff --git a/pkgs/development/libraries/libheif/default.nix b/pkgs/development/libraries/libheif/default.nix index cdc03c01a022..25cee4ef8daa 100644 --- a/pkgs/development/libraries/libheif/default.nix +++ b/pkgs/development/libraries/libheif/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, pruneLibtoolFiles, libde265, x265, libpng, libjpeg }: +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libde265, x265, libpng, libjpeg }: stdenv.mkDerivation rec { version = "1.3.2"; @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0hk8mzig2kp5f94j4jwqxzjrm7ffk16ffvxl92rf0afsh6vgnz7w"; }; - nativeBuildInputs = [ autoreconfHook pkgconfig pruneLibtoolFiles ]; + nativeBuildInputs = [ autoreconfHook pkgconfig ]; buildInputs = [ libde265 x265 libpng libjpeg ]; enableParallelBuilding = true; diff --git a/pkgs/development/libraries/webkitgtk/2.4.nix b/pkgs/development/libraries/webkitgtk/2.4.nix index 9030149fc8ad..04758ace7fa4 100644 --- a/pkgs/development/libraries/webkitgtk/2.4.nix +++ b/pkgs/development/libraries/webkitgtk/2.4.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, fetchpatch, perl, python, ruby, bison, gperf, flex -, pkgconfig, which, gettext, gobject-introspection, pruneLibtoolFiles +, pkgconfig, which, gettext, gobject-introspection , gtk2, gtk3, wayland, libwebp, enchant, sqlite , libxml2, libsoup, libsecret, libxslt, harfbuzz, xorg , gst-plugins-base, libobjc @@ -86,7 +86,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ perl python ruby bison gperf flex - pkgconfig which gettext gobject-introspection pruneLibtoolFiles + pkgconfig which gettext gobject-introspection ]; buildInputs = [