Merge pull request #32207 from peterhoeg/u/cups

cups: 2.2.2 -> 2.2.6

authored by Orivej Desh and committed by GitHub d104321b a1e1e437

+42 -27
+1 -1
nixos/tests/printing.nix
··· 39 $client->waitForUnit("cups.service"); 40 $client->sleep(10); # wait until cups is fully initialized 41 $client->succeed("lpstat -r") =~ /scheduler is running/ or die; 42 - $client->succeed("lpstat -H") =~ "/var/run/cups/cups.sock" or die; 43 $client->succeed("curl --fail http://localhost:631/"); 44 $client->succeed("curl --fail http://server:631/"); 45 $server->fail("curl --fail --connect-timeout 2 http://client:631/");
··· 39 $client->waitForUnit("cups.service"); 40 $client->sleep(10); # wait until cups is fully initialized 41 $client->succeed("lpstat -r") =~ /scheduler is running/ or die; 42 + $client->succeed("lpstat -H") =~ "localhost:631" or die; 43 $client->succeed("curl --fail http://localhost:631/"); 44 $client->succeed("curl --fail http://server:631/"); 45 $server->fail("curl --fail --connect-timeout 2 http://client:631/");
+41 -26
pkgs/misc/cups/default.nix
··· 1 - { stdenv, fetchurl, pkgconfig, zlib, libjpeg, libpng, libtiff, pam 2 - , dbus, systemd, acl, gmp, darwin 3 , libusb ? null, gnutls ? null, avahi ? null, libpaper ? null 4 }: 5 ··· 9 with stdenv.lib; 10 stdenv.mkDerivation rec { 11 name = "cups-${version}"; 12 - version = "2.2.2"; 13 14 passthru = { inherit version; }; 15 16 src = fetchurl { 17 url = "https://github.com/apple/cups/releases/download/v${version}/cups-${version}-source.tar.gz"; 18 - sha256 = "1xp4ji4rz3xffsz6w6nd60ajxvvihn02pkyp2l4smhqxbmyvp2gm"; 19 }; 20 21 outputs = [ "out" "lib" "dev" "man" ]; 22 23 - nativeBuildInputs = [ pkgconfig ]; 24 buildInputs = [ zlib libjpeg libpng libtiff libusb gnutls libpaper ] 25 ++ optionals stdenv.isLinux [ avahi pam dbus systemd acl ] 26 ++ optionals stdenv.isDarwin (with darwin; [ ··· 30 propagatedBuildInputs = [ gmp ]; 31 32 configureFlags = [ 33 - # Put just lib/* and locale into $lib; this didn't work directly. 34 - # lib/cups is moved back to $out in postInstall. 35 - # Beware: some parts of cups probably don't fully respect these. 36 - "--prefix=$(lib)" 37 - "--datadir=$(out)/share" 38 - "--localedir=$(lib)/share/locale" 39 - 40 "--localstatedir=/var" 41 "--sysconfdir=/etc" 42 - "--with-systemd=\${out}/lib/systemd/system" 43 "--enable-raw-printing" 44 "--enable-threads" 45 ] ++ optionals stdenv.isLinux [ ··· 49 ++ optional (gnutls != null) "--enable-ssl" 50 ++ optional (avahi != null) "--enable-avahi" 51 ++ optional (libpaper != null) "--enable-libpaper" 52 - ++ optionals stdenv.isDarwin [ 53 - "--with-bundledir=$out" 54 - "--disable-launchd" 55 - ]; 56 57 - # XXX: Hackery until https://github.com/NixOS/nixpkgs/issues/24693 58 - preBuild = if stdenv.isDarwin then '' 59 - export DYLD_FRAMEWORK_PATH=/System/Library/Frameworks 60 - '' else null; 61 62 installFlags = 63 [ # Don't try to write in /var at build time. ··· 80 enableParallelBuilding = true; 81 82 postInstall = '' 83 - moveToOutput lib/cups "$out" 84 85 # Delete obsolete stuff that conflicts with cups-filters. 86 rm -rf $out/share/cups/banners $out/share/cups/data/testprint 87 88 - # Some outputs in cups-config were unexpanded and some even wrong. 89 moveToOutput bin/cups-config "$dev" 90 - sed -e "/^cups_serverbin=/s|\$(lib)|$out|" \ 91 - -e "s|\$(out)|$out|" \ 92 - -e "s|\$(lib)|$lib|" \ 93 -i "$dev/bin/cups-config" 94 95 # Rename systemd files provided by CUPS 96 for f in "$out"/lib/systemd/system/*; do 97 substituteInPlace "$f" \ 98 --replace "org.cups.cupsd" "cups" \ 99 --replace "org.cups." "" 100
··· 1 + { stdenv, fetchurl, fetchpatch, pkgconfig, removeReferencesTo 2 + , zlib, libjpeg, libpng, libtiff, pam, dbus, systemd, acl, gmp, darwin 3 , libusb ? null, gnutls ? null, avahi ? null, libpaper ? null 4 }: 5 ··· 9 with stdenv.lib; 10 stdenv.mkDerivation rec { 11 name = "cups-${version}"; 12 + version = "2.2.6"; 13 14 passthru = { inherit version; }; 15 16 src = fetchurl { 17 url = "https://github.com/apple/cups/releases/download/v${version}/cups-${version}-source.tar.gz"; 18 + sha256 = "16qn41b84xz6khrr2pa2wdwlqxr29rrrkjfi618gbgdkq9w5ff20"; 19 }; 20 21 outputs = [ "out" "lib" "dev" "man" ]; 22 23 + patches = [ 24 + (fetchpatch { 25 + url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/cups-systemd-socket.patch?h=packages/cups"; 26 + sha256 = "1ddgdlg9s0l2ph6l8lx1m1lx6k50gyxqi3qiwr44ppq1rxs80ny5"; 27 + }) 28 + ]; 29 + 30 + nativeBuildInputs = [ pkgconfig removeReferencesTo ]; 31 + 32 buildInputs = [ zlib libjpeg libpng libtiff libusb gnutls libpaper ] 33 ++ optionals stdenv.isLinux [ avahi pam dbus systemd acl ] 34 ++ optionals stdenv.isDarwin (with darwin; [ ··· 38 propagatedBuildInputs = [ gmp ]; 39 40 configureFlags = [ 41 "--localstatedir=/var" 42 "--sysconfdir=/etc" 43 + "--with-rundir=/run" 44 "--enable-raw-printing" 45 "--enable-threads" 46 ] ++ optionals stdenv.isLinux [ ··· 50 ++ optional (gnutls != null) "--enable-ssl" 51 ++ optional (avahi != null) "--enable-avahi" 52 ++ optional (libpaper != null) "--enable-libpaper" 53 + ++ optional stdenv.isDarwin "--disable-launchd"; 54 + 55 + preConfigure = '' 56 + configureFlagsArray+=( 57 + # Put just lib/* and locale into $lib; this didn't work directly. 58 + # lib/cups is moved back to $out in postInstall. 59 + # Beware: some parts of cups probably don't fully respect these. 60 + "--prefix=$lib" 61 + "--datadir=$out/share" 62 + "--localedir=$lib/share/locale" 63 + 64 + "--with-systemd=$out/lib/systemd/system" 65 66 + ${optionalString stdenv.isDarwin '' 67 + "--with-bundledir=$out" 68 + ''} 69 + ) 70 + ''; 71 72 installFlags = 73 [ # Don't try to write in /var at build time. ··· 90 enableParallelBuilding = true; 91 92 postInstall = '' 93 + libexec=${if stdenv.isDarwin then "libexec/cups" else "lib/cups"} 94 + moveToOutput $libexec "$out" 95 + 96 + # $lib contains references to $out/share/cups. 97 + # CUPS is working without them, so they are not vital. 98 + find "$lib" -type f -exec grep -q "$out" {} \; \ 99 + -printf "removing references from %p\n" \ 100 + -exec remove-references-to -t "$out" {} + 101 102 # Delete obsolete stuff that conflicts with cups-filters. 103 rm -rf $out/share/cups/banners $out/share/cups/data/testprint 104 105 moveToOutput bin/cups-config "$dev" 106 + sed -e "/^cups_serverbin=/s|$lib|$out|" \ 107 -i "$dev/bin/cups-config" 108 109 # Rename systemd files provided by CUPS 110 for f in "$out"/lib/systemd/system/*; do 111 substituteInPlace "$f" \ 112 + --replace "$lib/$libexec" "$out/$libexec" \ 113 --replace "org.cups.cupsd" "cups" \ 114 --replace "org.cups." "" 115