From b8685ddf68e0b17ee7767856454b94d355007887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 12 Mar 2017 15:50:26 +0100 Subject: [PATCH 1/3] cups: 2.1.4 -> 2.2.2 The changelog seems safe, test succeeds on x86_64-linux. --- pkgs/misc/cups/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix index 38a22a01d955..457e6ad53b1a 100644 --- a/pkgs/misc/cups/default.nix +++ b/pkgs/misc/cups/default.nix @@ -9,13 +9,13 @@ with stdenv.lib; stdenv.mkDerivation rec { name = "cups-${version}"; - version = "2.1.4"; + version = "2.2.2"; passthru = { inherit version; }; src = fetchurl { - url = "https://github.com/apple/cups/releases/download/release-${version}/cups-${version}-source.tar.gz"; - sha256 = "13bjxw256wd1nff22vj2z25mdhllj2h6d9xypsg55b40661zs52b"; + url = "https://github.com/apple/cups/releases/download/v${version}/cups-${version}-source.tar.gz"; + sha256 = "1xp4ji4rz3xffsz6w6nd60ajxvvihn02pkyp2l4smhqxbmyvp2gm"; }; # FIXME: the cups libraries contains some $out/share strings so can't be split. From 2e4c5711a29ccf47bab1a16efc2743bf31b1874f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 12 Mar 2017 15:52:00 +0100 Subject: [PATCH 2/3] cups: minor expression refactoring --- pkgs/misc/cups/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix index 457e6ad53b1a..51f518867abb 100644 --- a/pkgs/misc/cups/default.nix +++ b/pkgs/misc/cups/default.nix @@ -71,11 +71,10 @@ stdenv.mkDerivation rec { # Delete obsolete stuff that conflicts with cups-filters. rm -rf $out/share/cups/banners $out/share/cups/data/testprint - mkdir $dev/bin - mv $out/bin/cups-config $dev/bin/ + moveToOutput bin/cups-config "$dev" # Rename systemd files provided by CUPS - for f in $out/lib/systemd/system/*; do + for f in "$out"/lib/systemd/system/*; do substituteInPlace "$f" \ --replace "org.cups.cupsd" "cups" \ --replace "org.cups." "" @@ -88,7 +87,7 @@ stdenv.mkDerivation rec { done '' + optionalString stdenv.isLinux '' # Use xdg-open when on Linux - substituteInPlace $out/share/applications/cups.desktop \ + substituteInPlace "$out"/share/applications/cups.desktop \ --replace "Exec=htmlview" "Exec=xdg-open" ''; From 50fadc8b18fb3da6bda2f3710009a15f6ac45567 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Sun, 12 Mar 2017 18:09:39 +0100 Subject: [PATCH 3/3] cups: split the $lib output This saves > 10 MB from most closures. Printing test succeeds on x86_64-linux. --- nixos/modules/services/printing/cupsd.nix | 1 + .../networking/browsers/opera/default.nix | 2 +- pkgs/development/libraries/qt-4.x/4.8/default.nix | 2 +- pkgs/misc/cups/default.nix | 12 ++++++++++-- pkgs/misc/cups/drivers/samsung/4.00.39/default.nix | 2 +- pkgs/misc/cups/drivers/samsung/default.nix | 4 ++-- 6 files changed, 16 insertions(+), 7 deletions(-) diff --git a/nixos/modules/services/printing/cupsd.nix b/nixos/modules/services/printing/cupsd.nix index 3041dccfd154..7ce2ae38fb36 100644 --- a/nixos/modules/services/printing/cupsd.nix +++ b/nixos/modules/services/printing/cupsd.nix @@ -52,6 +52,7 @@ let ServerBin ${bindir}/lib/cups DataDir ${bindir}/share/cups + DocumentRoot ${cups.out}/share/doc/cups AccessLog syslog ErrorLog syslog diff --git a/pkgs/applications/networking/browsers/opera/default.nix b/pkgs/applications/networking/browsers/opera/default.nix index 47e82d06e0eb..30e8af85b2ae 100644 --- a/pkgs/applications/networking/browsers/opera/default.nix +++ b/pkgs/applications/networking/browsers/opera/default.nix @@ -46,7 +46,7 @@ let alsaLib.out atk.out cairo.out - cups.out + cups curl.out dbus.lib expat.out diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix index 0860a90192f0..d4b85e0dfe43 100644 --- a/pkgs/development/libraries/qt-4.x/4.8/default.nix +++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix @@ -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; diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix index 51f518867abb..f47ba022c352 100644 --- a/pkgs/misc/cups/default.nix +++ b/pkgs/misc/cups/default.nix @@ -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 diff --git a/pkgs/misc/cups/drivers/samsung/4.00.39/default.nix b/pkgs/misc/cups/drivers/samsung/4.00.39/default.nix index 0569eabe8f14..16b40798a5da 100644 --- a/pkgs/misc/cups/drivers/samsung/4.00.39/default.nix +++ b/pkgs/misc/cups/drivers/samsung/4.00.39/default.nix @@ -16,7 +16,7 @@ # Do not bump lightly! Visit # 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"; diff --git a/pkgs/misc/cups/drivers/samsung/default.nix b/pkgs/misc/cups/drivers/samsung/default.nix index 8ef788df66fb..26bd771e023a 100644 --- a/pkgs/misc/cups/drivers/samsung/default.nix +++ b/pkgs/misc/cups/drivers/samsung/default.nix @@ -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/