cups: split the $lib output

This saves > 10 MB from most closures.
Printing test succeeds on x86_64-linux.
This commit is contained in:
Vladimír Čunát 2017-03-12 18:09:39 +01:00
parent 2e4c5711a2
commit 50fadc8b18
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
6 changed files with 16 additions and 7 deletions

View File

@ -52,6 +52,7 @@ let
ServerBin ${bindir}/lib/cups
DataDir ${bindir}/share/cups
DocumentRoot ${cups.out}/share/doc/cups
AccessLog syslog
ErrorLog syslog

View File

@ -46,7 +46,7 @@ let
alsaLib.out
atk.out
cairo.out
cups.out
cups
curl.out
dbus.lib
expat.out

View File

@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
./libressl.patch
(substituteAll {
src = ./dlopen-absolute-paths.diff;
cups = if cups != null then cups.out else null;
cups = if cups != null then stdenv.lib.getLib cups else null;
icu = icu.out;
libXfixes = libXfixes.out;
glibc = stdenv.cc.libc.out;

View File

@ -18,8 +18,7 @@ stdenv.mkDerivation rec {
sha256 = "1xp4ji4rz3xffsz6w6nd60ajxvvihn02pkyp2l4smhqxbmyvp2gm";
};
# FIXME: the cups libraries contains some $out/share strings so can't be split.
outputs = [ "out" "dev" "man" ]; # TODO: above
outputs = [ "out" "lib" "dev" "man" ];
buildInputs = [ pkgconfig zlib libjpeg libpng libtiff libusb gnutls libpaper ]
++ optionals stdenv.isLinux [ avahi pam dbus systemd acl ]
@ -30,6 +29,13 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ gmp ];
configureFlags = [
# Put just lib/* and locale into $lib; this didn't work directly.
# lib/cups is moved back to $out in postInstall.
# Beware: some parts of cups probably don't fully respect these.
"--prefix=$(lib)"
"--datadir=$(out)/share"
"--localedir=$(lib)/share/locale"
"--localstatedir=/var"
"--sysconfdir=/etc"
"--with-systemd=\${out}/lib/systemd/system"
@ -68,6 +74,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
postInstall = ''
moveToOutput lib/cups "$out"
# Delete obsolete stuff that conflicts with cups-filters.
rm -rf $out/share/cups/banners $out/share/cups/data/testprint

View File

@ -16,7 +16,7 @@
# Do not bump lightly! Visit <http://www.bchemnet.com/suldr/supported.html>
# to see what will break when upgrading. Consider a new versioned attribute.
let
cups' = cups.out;
cups' = stdenv.lib.getLib cups;
in stdenv.mkDerivation rec {
name = "samsung-UnifiedLinuxDriver-${version}";
version = "4.00.39";

View File

@ -72,10 +72,10 @@ in stdenv.mkDerivation rec {
for bin in $out/bin/*; do
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$bin"
patchelf --set-rpath "$out/lib:${cups.out}/lib" "$bin"
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$bin"
done
patchelf --set-rpath "$out/lib:${cups.out}/lib" "$out/lib/libscmssc.so"
patchelf --set-rpath "$out/lib:${stdenv.lib.getLib cups}/lib" "$out/lib/libscmssc.so"
ln -s ${stdenv.cc.cc.lib}/lib/libstdc++.so.6 $out/lib/