Merge: cups improvements (update, split $lib)

Fixes #23793.  /cc maintainer @jgeerds.
This commit is contained in:
Vladimír Čunát 2017-03-12 18:46:22 +01:00
commit 45115b1937
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA
6 changed files with 22 additions and 14 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

@ -9,17 +9,16 @@
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.
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,14 +74,15 @@ 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
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 +95,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"
'';

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/