libtool: Separate libltdl from the main package
Some packages have a runtime dependency on libltdl, but shouldn't depend on the rest of libtool (which in turn depends on binutils and other stdenv tools). For example, splitting off libltdl cuts about 35 MiB from the closure of PulseAudio.
This commit is contained in:
parent
3a35ba350f
commit
28ad91098d
pkgs
build-support
development/tools/misc/libtool
top-level
@ -9,12 +9,16 @@ stdenv.mkDerivation (args // {
|
||||
configureFlags =
|
||||
optionals (elem "bin" outputs)
|
||||
[ "--bindir=$(bin)/bin" "--mandir=$(bin)/share/man" ]
|
||||
++ optionals (elem "lib" outputs)
|
||||
[ "--libdir=$(lib)/lib" ]
|
||||
++ optional (elem "dev" outputs)
|
||||
"--includedir=$(dev)/include";
|
||||
"--includedir=$(dev)/include"
|
||||
++ args.configureFlags or [];
|
||||
|
||||
installFlags =
|
||||
optionals (elem "dev" outputs)
|
||||
[ "pkgconfigdir=$(dev)/lib/pkgconfig" "m4datadir=$(dev)/share/aclocal" ];
|
||||
[ "pkgconfigdir=$(dev)/lib/pkgconfig" "m4datadir=$(dev)/share/aclocal" "aclocaldir=$(dev)/share/aclocal" ]
|
||||
++ args.installFlags or [];
|
||||
|
||||
postInstall =
|
||||
''
|
||||
@ -31,15 +35,17 @@ stdenv.mkDerivation (args // {
|
||||
echo "$propagatedBuildInputs" > "$dev/nix-support/propagated-build-inputs"
|
||||
propagatedBuildInputs=
|
||||
fi
|
||||
echo "$propagatedBuildNativeInputs $out" > "$dev/nix-support/propagated-build-native-inputs"
|
||||
echo "$out $lib $propagatedBuildNativeInputs" > "$dev/nix-support/propagated-build-native-inputs"
|
||||
propagatedBuildNativeInputs=
|
||||
elif [ -n "$out" ]; then
|
||||
propagatedBuildNativeInputs="$lib $propagatedBuildNativeInputs"
|
||||
fi
|
||||
|
||||
if [ -n "$bin" ]; then
|
||||
prefix="$bin" stripDirs "bin sbin" "${stripDebugFlags:--S}"
|
||||
prefix="$bin" patchELF
|
||||
patchShebangs "$bin"
|
||||
fi
|
||||
for i in $bin $lib; do
|
||||
prefix="$i" stripDirs "lib lib64 libexec bin sbin" "${stripDebugFlags:--S}"
|
||||
prefix="$i" patchELF
|
||||
patchShebangs "$i"
|
||||
done
|
||||
''; # */
|
||||
|
||||
})
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ stdenv, fetchurl, m4, perl, lzma }:
|
||||
|
||||
stdenv.mkDerivation (rec {
|
||||
stdenv.mkDerivation rec {
|
||||
name = "libtool-2.4.2";
|
||||
|
||||
src = fetchurl {
|
||||
@ -10,6 +10,8 @@ stdenv.mkDerivation (rec {
|
||||
|
||||
buildNativeInputs = [ lzma m4 perl ];
|
||||
|
||||
outputs = [ "out" "lib" ];
|
||||
|
||||
# Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
|
||||
# "fixed" path in generated files!
|
||||
dontPatchShebangs = true;
|
||||
@ -18,6 +20,10 @@ stdenv.mkDerivation (rec {
|
||||
# leads to the failure of a number of tests.
|
||||
doCheck = false;
|
||||
|
||||
# Don't run the native `strip' when cross-compiling. This breaks at least
|
||||
# with `.a' files for MinGW.
|
||||
dontStrip = stdenv ? cross;
|
||||
|
||||
meta = {
|
||||
description = "GNU Libtool, a generic library support script";
|
||||
|
||||
@ -38,11 +44,3 @@ stdenv.mkDerivation (rec {
|
||||
maintainers = [ stdenv.lib.maintainers.ludo ];
|
||||
};
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
# Don't run the native `strip' when cross-compiling. This breaks at least
|
||||
# with `.a' files for MinGW.
|
||||
(if (stdenv ? cross)
|
||||
then { dontStrip = true; }
|
||||
else { }))
|
||||
|
@ -3111,7 +3111,9 @@ let
|
||||
|
||||
libtool_1_5 = callPackage ../development/tools/misc/libtool { };
|
||||
|
||||
libtool_2 = callPackage ../development/tools/misc/libtool/libtool2.nix { };
|
||||
libtool_2 = callPackage ../development/tools/misc/libtool/libtool2.nix {
|
||||
stdenv = stdenvMulti;
|
||||
};
|
||||
|
||||
lsof = callPackage ../development/tools/misc/lsof { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user