fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv, fetchurl, pkgconfig, zlib, libjpeg, libpng, libtiff, pam
2, dbus, acl, gmp
3, libusb ? null, gnutls ? null, avahi ? null, libpaper ? null
4}:
5
6let version = "2.0.3"; in
7
8with stdenv.lib;
9stdenv.mkDerivation {
10 name = "cups-${version}";
11
12 passthru = { inherit version; };
13
14 src = fetchurl {
15 url = "https://www.cups.org/software/${version}/cups-${version}-source.tar.bz2";
16 sha256 = "10c84ppc9prx6gcyskmm6fh0rks346yryzd356gkg9whhq26fcdw";
17 };
18
19 buildInputs = [ pkgconfig zlib libjpeg libpng libtiff libusb gnutls avahi libpaper ]
20 ++ optionals stdenv.isLinux [ pam dbus.libs acl ];
21
22 propagatedBuildInputs = [ gmp ];
23
24 configureFlags = [
25 "--localstatedir=/var"
26 "--sysconfdir=/etc"
27 "--with-systemd=\${out}/lib/systemd/system"
28 "--enable-raw-printing"
29 "--enable-threads"
30 ] ++ optionals stdenv.isLinux [
31 "--enable-dbus"
32 "--enable-pam"
33 ] ++ optional (libusb != null) "--enable-libusb"
34 ++ optional (gnutls != null) "--enable-ssl"
35 ++ optional (avahi != null) "--enable-avahi"
36 ++ optional (libpaper != null) "--enable-libpaper";
37
38 installFlags =
39 [ # Don't try to write in /var at build time.
40 "CACHEDIR=$(TMPDIR)/dummy"
41 "LOGDIR=$(TMPDIR)/dummy"
42 "REQUESTS=$(TMPDIR)/dummy"
43 "STATEDIR=$(TMPDIR)/dummy"
44 # Idem for /etc.
45 "PAMDIR=$(out)/etc/pam.d"
46 "DBUSDIR=$(out)/etc/dbus-1"
47 "INITDIR=$(out)/etc/rc.d"
48 "XINETD=$(out)/etc/xinetd.d"
49 "SERVERROOT=$(out)/etc/cups"
50 # Idem for /usr.
51 "MENUDIR=$(out)/share/applications"
52 "ICONDIR=$(out)/share/icons"
53 # Work around a Makefile bug.
54 "CUPS_PRIMARY_SYSTEM_GROUP=root"
55 ];
56
57 postInstall = ''
58 # Delete obsolete stuff that conflicts with cups-filters.
59 rm -rf $out/share/cups/banners $out/share/cups/data/testprint
60
61 # Rename systemd files provided by CUPS
62 for f in $out/lib/systemd/system/*; do
63 substituteInPlace "$f" \
64 --replace "org.cups.cupsd" "cups" \
65 --replace "org.cups." ""
66
67 if [[ "$f" =~ .*cupsd\..* ]]; then
68 mv "$f" "''${f/org\.cups\.cupsd/cups}"
69 else
70 mv "$f" "''${f/org\.cups\./}"
71 fi
72 done
73 '' + optionalString stdenv.isLinux ''
74 # Use xdg-open when on Linux
75 substituteInPlace $out/share/applications/cups.desktop \
76 --replace "Exec=htmlview" "Exec=xdg-open"
77 '';
78
79 meta = {
80 homepage = https://cups.org/;
81 description = "A standards-based printing system for UNIX";
82 license = licenses.gpl2; # actually LGPL for the library and GPL for the rest
83 maintainers = with maintainers; [ urkud simons jgeerds ];
84 platforms = platforms.linux;
85 };
86}