stdenv: prune libtool files by default (#51767)

See the motivation in fd97db43bc (#41819).
This commit is contained in:
Orivej Desh (NixOS) 2019-01-11 13:20:46 +00:00 committed by GitHub
commit 9a21967f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 10 deletions

View File

@ -1662,6 +1662,18 @@ installTargets = "install-bin install-doc";</programlisting>
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<varname>dontPruneLibtoolFiles</varname>
</term>
<listitem>
<para>
If set, libtool <literal>.la</literal> files associated with shared
libraries won't have their <literal>dependency_libs</literal> field
cleared.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<varname>forceShare</varname> <varname>forceShare</varname>

View File

@ -68,8 +68,6 @@ in stdenv.mkDerivation rec {
]; ];
buildInputs = [ buildInputs = [
# TODO: remove libcap when pruneLibtoolFiles applies to pulseaudio.
libcap
libevent libevent
libtool libtool
udev udev

View File

@ -8,7 +8,7 @@
fixupOutputHooks+=(_pruneLibtoolFiles) fixupOutputHooks+=(_pruneLibtoolFiles)
_pruneLibtoolFiles() { _pruneLibtoolFiles() {
if [ "$dontPruneLibtoolFiles" ]; then if [ "$dontPruneLibtoolFiles" ] || [ ! -e "$prefix" ]; then
return return
fi fi
@ -16,7 +16,7 @@ _pruneLibtoolFiles() {
# the "old_library" field for static libraries. We are processing only # the "old_library" field for static libraries. We are processing only
# those .la files that do not describe static libraries. # those .la files that do not describe static libraries.
find "$prefix" -type f -name '*.la' \ find "$prefix" -type f -name '*.la' \
-exec grep -q '^# Generated by libtool' {} \; \ -exec grep -q '^# Generated by .*libtool' {} \; \
-exec grep -q "^old_library=''" {} \; \ -exec grep -q "^old_library=''" {} \; \
-exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \;
} }

View File

@ -1,4 +1,4 @@
{ stdenv, config, libGLSupported, fetchurl, pkgconfig, pruneLibtoolFiles { stdenv, config, libGLSupported, fetchurl, pkgconfig
, openglSupport ? libGLSupported, libGL , openglSupport ? libGLSupported, libGL
, alsaSupport ? stdenv.isLinux, alsaLib , alsaSupport ? stdenv.isLinux, alsaLib
, x11Support ? !stdenv.isCygwin, libX11, xorgproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr , x11Support ? !stdenv.isCygwin, libX11, xorgproto, libICE, libXi, libXScrnSaver, libXcursor, libXinerama, libXext, libXxf86vm, libXrandr
@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
patches = [ ./find-headers.patch ]; patches = [ ./find-headers.patch ];
nativeBuildInputs = [ pkgconfig pruneLibtoolFiles ]; nativeBuildInputs = [ pkgconfig ];
propagatedBuildInputs = dlopenPropagatedBuildInputs; propagatedBuildInputs = dlopenPropagatedBuildInputs;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, pruneLibtoolFiles, libde265, x265, libpng, libjpeg }: { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libde265, x265, libpng, libjpeg }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "1.3.2"; version = "1.3.2";
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "0hk8mzig2kp5f94j4jwqxzjrm7ffk16ffvxl92rf0afsh6vgnz7w"; sha256 = "0hk8mzig2kp5f94j4jwqxzjrm7ffk16ffvxl92rf0afsh6vgnz7w";
}; };
nativeBuildInputs = [ autoreconfHook pkgconfig pruneLibtoolFiles ]; nativeBuildInputs = [ autoreconfHook pkgconfig ];
buildInputs = [ libde265 x265 libpng libjpeg ]; buildInputs = [ libde265 x265 libpng libjpeg ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, fetchpatch, perl, python, ruby, bison, gperf, flex { 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 , gtk2, gtk3, wayland, libwebp, enchant, sqlite
, libxml2, libsoup, libsecret, libxslt, harfbuzz, xorg , libxml2, libsoup, libsecret, libxslt, harfbuzz, xorg
, gst-plugins-base, libobjc , gst-plugins-base, libobjc
@ -86,7 +86,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ nativeBuildInputs = [
perl python ruby bison gperf flex perl python ruby bison gperf flex
pkgconfig which gettext gobject-introspection pruneLibtoolFiles pkgconfig which gettext gobject-introspection
]; ];
buildInputs = [ buildInputs = [

View File

@ -47,6 +47,7 @@ let
../../build-support/setup-hooks/compress-man-pages.sh ../../build-support/setup-hooks/compress-man-pages.sh
../../build-support/setup-hooks/strip.sh ../../build-support/setup-hooks/strip.sh
../../build-support/setup-hooks/patch-shebangs.sh ../../build-support/setup-hooks/patch-shebangs.sh
../../build-support/setup-hooks/prune-libtool-files.sh
] ]
# FIXME this on Darwin; see # FIXME this on Darwin; see
# https://github.com/NixOS/nixpkgs/commit/94d164dd7#commitcomment-22030369 # https://github.com/NixOS/nixpkgs/commit/94d164dd7#commitcomment-22030369