3
0
Fork 0
forked from mirrors/nixpkgs

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>
</listitem>
</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>
<term>
<varname>forceShare</varname>

View file

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

View file

@ -8,7 +8,7 @@
fixupOutputHooks+=(_pruneLibtoolFiles)
_pruneLibtoolFiles() {
if [ "$dontPruneLibtoolFiles" ]; then
if [ "$dontPruneLibtoolFiles" ] || [ ! -e "$prefix" ]; then
return
fi
@ -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" \;
}

View file

@ -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, xorgproto, 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;

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 {
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;

View file

@ -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 = [

View file

@ -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