Commit | Line | Data |
---|---|---|
51002318 | 1 | ;;; GNU Guix --- Functional package management for GNU |
8498aee8 | 2 | ;;; Copyright © 2015, 2019, 2021 Ricardo Wurmus <rekado@elephly.net> |
7a7d5f66 | 3 | ;;; Copyright © 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org> |
8e189596 | 4 | ;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il> |
2b56dc01 | 5 | ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org> |
8afabb2e | 6 | ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> |
7020a6ab | 7 | ;;; Copyright © 2017 Mark H Weaver <mhw@netris.org> |
ae223155 | 8 | ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr> |
68c7f577 | 9 | ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com> |
51002318 RW |
10 | ;;; |
11 | ;;; This file is part of GNU Guix. | |
12 | ;;; | |
13 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
14 | ;;; under the terms of the GNU General Public License as published by | |
15 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
16 | ;;; your option) any later version. | |
17 | ;;; | |
18 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
19 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
20 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
21 | ;;; GNU General Public License for more details. | |
22 | ;;; | |
23 | ;;; You should have received a copy of the GNU General Public License | |
24 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
25 | ||
26 | (define-module (gnu packages cups) | |
51002318 | 27 | #:use-module (gnu packages) |
d02aabaf LC |
28 | #:use-module (gnu packages algebra) |
29 | #:use-module (gnu packages autotools) | |
51002318 | 30 | #:use-module (gnu packages avahi) |
cf066b7a | 31 | #:use-module (gnu packages base) |
51002318 | 32 | #:use-module (gnu packages compression) |
d9cdcad1 TGR |
33 | #:use-module (gnu packages fonts) ; font-dejavu |
34 | #:use-module (gnu packages fontutils) | |
35 | #:use-module (gnu packages ghostscript) | |
36 | #:use-module (gnu packages glib) | |
d02aabaf | 37 | #:use-module (gnu packages groff) |
d9cdcad1 | 38 | #:use-module (gnu packages image) |
2b56dc01 | 39 | #:use-module (gnu packages libusb) |
d9cdcad1 | 40 | #:use-module (gnu packages pdf) |
d02aabaf | 41 | #:use-module (gnu packages perl) |
d9cdcad1 | 42 | #:use-module (gnu packages pkg-config) |
12255b3d | 43 | #:use-module (gnu packages polkit) |
d02aabaf | 44 | #:use-module (gnu packages pretty-print) |
2b56dc01 | 45 | #:use-module (gnu packages python) |
44d10b1f | 46 | #:use-module (gnu packages python-xyz) |
407ef4b3 | 47 | #:use-module (gnu packages qt) |
2b56dc01 | 48 | #:use-module (gnu packages scanner) |
d9cdcad1 | 49 | #:use-module (gnu packages tls) |
8498aee8 | 50 | #:use-module (guix build-system cmake) |
d9cdcad1 | 51 | #:use-module (guix build-system gnu) |
dd6f309d | 52 | #:use-module (guix build-system python) |
d9cdcad1 | 53 | #:use-module (guix download) |
a25362a5 | 54 | #:use-module (guix git-download) |
d9cdcad1 | 55 | #:use-module ((guix licenses) #:prefix license:) |
8e189596 EF |
56 | #:use-module (guix packages) |
57 | #:use-module (guix utils) | |
c9b3a72b LC |
58 | #:use-module (srfi srfi-1) |
59 | #:use-module (ice-9 match)) | |
51002318 | 60 | |
8498aee8 TGR |
61 | (define-public brlaser |
62 | (let ((commit "9d7ddda8383bfc4d205b5e1b49de2b8bcd9137f1") | |
63 | (revision "1")) | |
64 | (package | |
65 | (name "brlaser") | |
66 | (version (git-version "6" revision commit)) | |
67 | (source (origin | |
68 | (method git-fetch) | |
69 | (uri (git-reference | |
70 | (url "https://github.com/pdewacht/brlaser") | |
71 | (commit commit))) | |
72 | (file-name (git-file-name name version)) | |
73 | (sha256 | |
74 | (base32 | |
75 | "1drh0nk7amn9a8wykki4l9maqa4vy7vwminypfy1712alwj31nd4")))) | |
76 | (build-system cmake-build-system) | |
77 | (arguments | |
78 | `(#:configure-flags | |
79 | (list (string-append "-DCUPS_DATA_DIR=" | |
80 | (assoc-ref %outputs "out") | |
81 | "/share/cups") | |
82 | (string-append "-DCUPS_SERVER_BIN=" | |
83 | (assoc-ref %outputs "out") | |
84 | "/lib/cups")))) | |
85 | (inputs | |
86 | `(("ghostscript" ,ghostscript) | |
87 | ("cups" ,cups) | |
88 | ("zlib" ,zlib))) | |
89 | (home-page "https://github.com/pdewacht/brlaser") | |
90 | (synopsis "Brother laser printer driver") | |
91 | (description "Brlaser is a CUPS driver for Brother laser printers. This | |
92 | driver is known to work with these printers: | |
93 | ||
94 | @enumerate | |
95 | @item Brother DCP-1510 series | |
96 | @item Brother DCP-1600 series | |
97 | @item Brother DCP-7030 | |
98 | @item Brother DCP-7040 | |
99 | @item Brother DCP-7055 | |
100 | @item Brother DCP-7055W | |
101 | @item Brother DCP-7060D | |
102 | @item Brother DCP-7065DN | |
103 | @item Brother DCP-7080 | |
104 | @item Brother DCP-L2500D series | |
105 | @item Brother DCP-L2520D series | |
106 | @item Brother DCP-L2540DW series | |
107 | @item Brother HL-1110 series | |
108 | @item Brother HL-1200 series | |
109 | @item Brother HL-2030 series | |
110 | @item Brother HL-2140 series | |
111 | @item Brother HL-2220 series | |
112 | @item Brother HL-2270DW series | |
113 | @item Brother HL-5030 series | |
114 | @item Brother HL-L2300D series | |
115 | @item Brother HL-L2320D series | |
116 | @item Brother HL-L2340D series | |
117 | @item Brother HL-L2360D series | |
118 | @item Brother MFC-1910W | |
119 | @item Brother MFC-7240 | |
120 | @item Brother MFC-7360N | |
121 | @item Brother MFC-7365DN | |
122 | @item Brother MFC-7840W | |
123 | @item Brother MFC-L2710DW series | |
124 | @item Lenovo M7605D | |
125 | @end enumerate") | |
126 | (license license:gpl2+)))) | |
127 | ||
51002318 RW |
128 | (define-public cups-filters |
129 | (package | |
130 | (name "cups-filters") | |
c96bb2e3 | 131 | (version "1.27.4") |
4ab016e0 | 132 | (source(origin |
51002318 RW |
133 | (method url-fetch) |
134 | (uri | |
96b44a94 | 135 | (string-append "https://openprinting.org/download/cups-filters/" |
51002318 RW |
136 | "cups-filters-" version ".tar.xz")) |
137 | (sha256 | |
138 | (base32 | |
c96bb2e3 | 139 | "110b1xhb5vfpcx0zq9kkas7pj281skx5dpnnr22idx509jfdzj8b")) |
51002318 RW |
140 | (modules '((guix build utils))) |
141 | (snippet | |
142 | ;; install backends, banners and filters to cups-filters output | |
143 | ;; directory, not the cups server directory | |
085cca5b AW |
144 | '(begin |
145 | (substitute* "Makefile.in" | |
146 | (("CUPS_DATADIR = @CUPS_DATADIR@") | |
147 | "CUPS_DATADIR = $(PREFIX)/share/cups") | |
148 | (("pkgcupsserverrootdir = \\$\\(CUPS_SERVERROOT\\)") | |
149 | "pkgcupsserverrootdir = $(PREFIX)") | |
150 | ;; Choose standard directories notably so that binaries are | |
151 | ;; stripped. | |
152 | (("pkgbackenddir = \\$\\(CUPS_SERVERBIN\\)/backend") | |
153 | "pkgbackenddir = $(PREFIX)/lib/cups/backend") | |
154 | (("pkgfilterdir = \\$\\(CUPS_SERVERBIN\\)/filter") | |
155 | "pkgfilterdir = $(PREFIX)/lib/cups/filter")) | |
156 | ;; Find bannertopdf data such as the print test page in our | |
157 | ;; output directory, not CUPS's prefix. | |
158 | (substitute* "configure" | |
159 | (("\\{CUPS_DATADIR\\}/data") | |
6cbee49d MW |
160 | "{prefix}/share/cups/data")) |
161 | #t)))) | |
51002318 RW |
162 | (build-system gnu-build-system) |
163 | (arguments | |
164 | `(#:make-flags (list (string-append "PREFIX=" %output)) | |
165 | #:configure-flags | |
f8489f16 | 166 | `("--disable-driverless" ; TODO: enable this |
79e90f05 | 167 | "--disable-mutool" ; depends on yet another PDF library (mupdf) |
b2639670 LC |
168 | |
169 | ;; Look for the "domain socket of CUPS" in /var/run/cups. | |
170 | "--localstatedir=/var" | |
171 | ||
f40aef6b LC |
172 | ;; Free software for the win. |
173 | "--with-acroread-path=evince" | |
174 | ||
f8489f16 | 175 | ,(string-append "--with-test-font-path=" |
51002318 RW |
176 | (assoc-ref %build-inputs "font-dejavu") |
177 | "/share/fonts/truetype/DejaVuSans.ttf") | |
95264cc6 AW |
178 | ,(string-append "--with-gs-path=" |
179 | (assoc-ref %build-inputs "ghostscript") | |
180 | "/bin/gsc") | |
f8489f16 EF |
181 | ,(string-append "--with-shell=" |
182 | (assoc-ref %build-inputs "bash") | |
183 | "/bin/bash") | |
51002318 | 184 | ,(string-append "--with-rcdir=" |
1728c411 LC |
185 | (assoc-ref %outputs "out") "/etc/rc.d")) |
186 | ||
187 | #:phases (modify-phases %standard-phases | |
188 | (add-after 'unpack 'patch-foomatic-hardcoded-file-names | |
189 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
190 | ;; Foomatic has hardcoded file names we need to fix. | |
191 | (let ((out (assoc-ref outputs "out")) | |
192 | (gs (assoc-ref inputs "ghostscript"))) | |
193 | (substitute* "filter/foomatic-rip/foomaticrip.c" | |
194 | (("/usr/local/lib/cups/filter") | |
195 | (string-append out "/lib/cups/filter"))) | |
196 | #t))) | |
197 | (add-after 'install 'wrap-filters | |
198 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
199 | ;; Some filters expect to find 'gs' in $PATH. We cannot | |
200 | ;; just hard-code its absolute file name in the source | |
201 | ;; because foomatic-rip, for example, has tests like | |
202 | ;; 'startswith(cmd, "gs")'. | |
203 | (let ((out (assoc-ref outputs "out")) | |
204 | (ghostscript (assoc-ref inputs "ghostscript"))) | |
205 | (for-each (lambda (file) | |
206 | (wrap-program file | |
207 | `("PATH" ":" prefix | |
208 | (,(string-append ghostscript | |
209 | "/bin"))))) | |
210 | (find-files (string-append | |
211 | out "/lib/cups/filter"))) | |
212 | #t)))))) | |
51002318 | 213 | (native-inputs |
b76b1dcb AE |
214 | `(("glib" ,glib "bin") ; for gdbus-codegen |
215 | ("pkg-config" ,pkg-config))) | |
51002318 | 216 | (inputs |
7e214019 EF |
217 | `(("avahi" ,avahi) |
218 | ("fontconfig" ,fontconfig) | |
51002318 | 219 | ("freetype" ,freetype) |
f8489f16 | 220 | ("font-dejavu" ,font-dejavu) ; also needed by test suite |
3e442f85 | 221 | ("ghostscript" ,ghostscript/cups) |
51002318 RW |
222 | ("ijs" ,ijs) |
223 | ("dbus" ,dbus) | |
224 | ("lcms" ,lcms) | |
4bd428a7 | 225 | ("libjpeg" ,libjpeg-turbo) |
51002318 RW |
226 | ("libpng" ,libpng) |
227 | ("libtiff" ,libtiff) | |
228 | ("glib" ,glib) | |
229 | ("qpdf" ,qpdf) | |
230 | ("poppler" ,poppler) | |
231 | ("cups-minimal" ,cups-minimal))) | |
6c474253 | 232 | (home-page "https://wiki.linuxfoundation.org/openprinting/cups-filters") |
51002318 RW |
233 | (synopsis "OpenPrinting CUPS filters and backends") |
234 | (description | |
235 | "Contains backends, filters, and other software that was once part of the | |
236 | core CUPS distribution but is no longer maintained by Apple Inc. In addition | |
237 | it contains additional filters developed independently of Apple, especially | |
238 | filters for the PDF-centric printing workflow introduced by OpenPrinting.") | |
239 | ;; Different filters and backends have different licenses; see COPYING for | |
240 | ;; details | |
241 | (license (list license:gpl2 | |
242 | license:gpl2+ | |
243 | license:gpl3 | |
244 | license:gpl3+ | |
245 | license:lgpl2.0+ | |
246 | license:expat)))) | |
247 | ||
248 | ;; CUPS on non-MacOS systems requires cups-filters. Since cups-filters also | |
249 | ;; depends on CUPS libraries and binaries, cups-minimal has been added to | |
250 | ;; satisfy this dependency. | |
251 | (define-public cups-minimal | |
252 | (package | |
253 | (name "cups-minimal") | |
0ab39ce2 | 254 | (version "2.3.3") |
620669fd | 255 | (replacement cups-minimal/fixed) |
88dfd8b8 TGR |
256 | (source |
257 | (origin | |
258 | (method url-fetch) | |
259 | (uri (string-append "https://github.com/apple/cups/releases/download/v" | |
260 | version "/cups-" version "-source.tar.gz")) | |
261 | (sha256 | |
262 | (base32 | |
0ab39ce2 | 263 | "1vpk0b2vq830f8fvf9z8qjsm5k141i7pi8djbinpnr78pi4dj7r6")))) |
51002318 RW |
264 | (build-system gnu-build-system) |
265 | (arguments | |
266 | `(#:configure-flags | |
267 | '("--disable-launchd" | |
268 | "--disable-systemd" | |
269 | "--disable-avahi" | |
270 | "--disable-dnssd") | |
271 | ;; Seven tests fail, mostly because of files that are provided by the | |
272 | ;; cups-filters package. | |
273 | #:tests? #f | |
274 | #:phases | |
6ea06a0e LC |
275 | (modify-phases %standard-phases |
276 | (add-before 'configure 'patch-makedefs | |
277 | (lambda _ | |
278 | (substitute* "Makedefs.in" | |
279 | (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@") | |
74c164e0 MW |
280 | (("/bin/sh") (which "sh"))) |
281 | #t)) | |
d043ceed LF |
282 | ;; Make the compressed manpages writable so that the |
283 | ;; reset-gzip-timestamps phase does not error out. | |
284 | (add-before 'reset-gzip-timestamps 'make-manpages-writable | |
285 | (lambda* (#:key outputs #:allow-other-keys) | |
286 | (let* ((out (assoc-ref outputs "out")) | |
287 | (man (string-append out "/share/man"))) | |
288 | (for-each (lambda (file) (chmod file #o644)) | |
74c164e0 MW |
289 | (find-files man "\\.gz")) |
290 | #t))) | |
6ea06a0e LC |
291 | (add-before 'build 'patch-tests |
292 | (lambda _ | |
5ba3ea42 | 293 | (substitute* "tools/ippeveprinter.c" |
6ea06a0e | 294 | (("# else /\\* HAVE_AVAHI \\*/") |
74c164e0 MW |
295 | "#elif defined(HAVE_AVAHI)")) |
296 | #t))))) | |
51002318 RW |
297 | (native-inputs |
298 | `(("pkg-config" ,pkg-config))) | |
299 | (inputs | |
300 | `(("zlib" ,zlib) | |
301 | ("gnutls" ,gnutls))) | |
d2a79db4 | 302 | (home-page "https://www.cups.org") |
51002318 RW |
303 | (synopsis "The Common Unix Printing System") |
304 | (description | |
9ced1033 TGR |
305 | "CUPS is a printing system that uses the Internet Printing Protocol |
306 | (@dfn{IPP}). It provides System V and BSD command-line interfaces, as well | |
51002318 RW |
307 | as a Web interface and a C programming interface to manage printers and print |
308 | jobs. It supports printing to both local (parallel, serial, USB) and | |
309 | networked printers, and printers can be shared from one computer to another. | |
9ced1033 TGR |
310 | Internally, CUPS uses PostScript Printer Description (@dfn{PPD}) files to |
311 | describe printer capabilities and features, and a wide variety of generic and | |
51002318 | 312 | device-specific programs to convert and print many types of files.") |
5ba3ea42 MB |
313 | ;; CUPS is Apache 2.0 with exceptions, see the NOTICE file. |
314 | (license license:asl2.0))) | |
51002318 | 315 | |
620669fd TGR |
316 | (define cups-minimal/fixed |
317 | (package-with-extra-patches | |
318 | cups-minimal | |
319 | (search-patches "cups-CVE-2020-10001.patch"))) | |
320 | ||
51002318 | 321 | (define-public cups |
a6ce9e35 | 322 | (package/inherit cups-minimal |
51002318 RW |
323 | (name "cups") |
324 | (arguments | |
325 | `(;; Three tests fail: | |
326 | ;; * two tests in ipp-1.1.test related to "RFC 2911 section 3.2.6: | |
327 | ;; Get-Jobs Operation" | |
328 | ;; * test of number of error/warning messages, probably related to a | |
329 | ;; missing font. | |
330 | #:tests? #f | |
331 | #:configure-flags | |
332 | '("--disable-launchd" | |
333 | "--disable-systemd") | |
334 | #:phases | |
3064d176 EF |
335 | (modify-phases %standard-phases |
336 | (add-before 'configure 'patch-makedefs | |
337 | (lambda _ | |
338 | (substitute* "Makedefs.in" | |
339 | (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@") | |
74c164e0 MW |
340 | (("/bin/sh") (which "sh"))) |
341 | #t)) | |
3064d176 EF |
342 | (add-before 'check 'patch-tests |
343 | (lambda _ | |
344 | (let ((filters (assoc-ref %build-inputs "cups-filters")) | |
345 | (catpath (string-append | |
346 | (assoc-ref %build-inputs "coreutils") "/bin/")) | |
347 | (testdir (string-append (getcwd) "/tmp/"))) | |
348 | (mkdir testdir) | |
349 | (substitute* "test/run-stp-tests.sh" | |
350 | ((" *BASE=/tmp/") (string-append "BASE=" testdir)) | |
51002318 | 351 | |
3064d176 EF |
352 | ;; allow installation of filters from output dir and from |
353 | ;; cups-filters | |
354 | (("for dir in /usr/libexec/cups/filter /usr/lib/cups/filter") | |
355 | (string-append | |
356 | "for dir in " | |
357 | (assoc-ref %outputs "out") "/lib/cups/filter " | |
358 | filters "/lib/cups/filter")) | |
51002318 | 359 | |
3064d176 EF |
360 | ;; check for charsets in cups-filters output |
361 | (("/usr/share/cups/charsets") | |
362 | (string-append filters "/share/cups/charsets")) | |
51002318 | 363 | |
3064d176 EF |
364 | ;; install additional required filters |
365 | (("instfilter texttopdf texttopdf pdf") | |
366 | (string-append | |
367 | "instfilter texttopdf texttopdf pdf;" | |
368 | "instfilter imagetoraster imagetoraster raster;" | |
369 | "instfilter gstoraster gstoraster raster;" | |
370 | "instfilter urftopdf urftopdf pdf;" | |
371 | "instfilter rastertopdf rastertopdf pdf;" | |
372 | "instfilter pstopdf pstopdf pdf")) | |
51002318 | 373 | |
3064d176 EF |
374 | ;; specify location of lpstat binary |
375 | (("description=\"`lpstat -l") | |
376 | "description=\"`../systemv/lpstat -l") | |
51002318 | 377 | |
3064d176 EF |
378 | ;; patch shebangs of embedded scripts |
379 | (("#!/bin/sh") (string-append "#!" (which "sh"))) | |
51002318 | 380 | |
3064d176 EF |
381 | ;; also link mime definitions from cups-filters |
382 | ;; to enable the additional filters for the test suite | |
383 | (("ln -s \\$root/conf/mime\\.types") | |
384 | (string-append | |
385 | "ln -s " filters | |
386 | "/share/cups/mime/cupsfilters.types $BASE/share/mime; " | |
387 | "ln -s $root/conf/mime.types")) | |
388 | (("ln -s \\$root/conf/mime\\.convs") | |
389 | (string-append | |
390 | "ln -s " filters | |
391 | "/share/cups/mime/cupsfilters.convs $BASE/share/mime; " | |
392 | "ln -s $root/conf/mime.convs"))) | |
51002318 | 393 | |
3064d176 EF |
394 | ;; fix search path for "cat" |
395 | (substitute* "cups/testfile.c" | |
396 | (("cupsFileFind\\(\"cat\", \"/bin\"") | |
397 | (string-append "cupsFileFind(\"cat\", \"" catpath "\"")) | |
398 | (("cupsFileFind\\(\"cat\", \"/bin:/usr/bin\"") | |
74c164e0 MW |
399 | (string-append "cupsFileFind(\"cat\", \"" catpath "\""))) |
400 | #t))) | |
29796b3f LF |
401 | ;; Make the compressed manpages writable so that the |
402 | ;; reset-gzip-timestamps phase does not error out. | |
403 | (add-before 'reset-gzip-timestamps 'make-manpages-writable | |
404 | (lambda* (#:key outputs #:allow-other-keys) | |
405 | (let* ((out (assoc-ref outputs "out")) | |
406 | (man (string-append out "/share/man"))) | |
407 | (for-each (lambda (file) (chmod file #o644)) | |
74c164e0 MW |
408 | (find-files man "\\.gz")) |
409 | #t))) | |
3064d176 EF |
410 | (add-after 'install 'install-cups-filters-symlinks |
411 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
412 | (let ((out (assoc-ref outputs "out")) | |
413 | (cups-filters (assoc-ref inputs "cups-filters"))) | |
414 | ;; charsets | |
415 | (symlink | |
416 | (string-append cups-filters "/share/cups/charsets") | |
417 | (string-append out "/share/charsets")) | |
51002318 | 418 | |
3064d176 EF |
419 | ;; mime types, driver file, ppds |
420 | (for-each | |
421 | (lambda (f) | |
422 | (symlink (string-append cups-filters f) | |
423 | (string-append out f))) | |
424 | '("/share/cups/mime/cupsfilters.types" | |
425 | "/share/cups/mime/cupsfilters.convs" | |
426 | "/share/cups/drv/cupsfilters.drv" | |
427 | "/share/ppd")) | |
51002318 | 428 | |
3064d176 EF |
429 | ;; filters |
430 | (for-each | |
431 | (lambda (f) | |
432 | (symlink f | |
433 | (string-append out "/lib/cups/filter" (basename f)))) | |
434 | (find-files (string-append cups-filters "/lib/cups/filter"))) | |
51002318 | 435 | |
3064d176 EF |
436 | ;; backends |
437 | (for-each | |
438 | (lambda (f) | |
439 | (symlink (string-append cups-filters f) | |
440 | (string-append out "/lib/cups/backend/" | |
441 | (basename f)))) | |
442 | '("/lib/cups/backend/parallel" | |
443 | "/lib/cups/backend/serial")) | |
51002318 | 444 | |
3064d176 EF |
445 | ;; banners |
446 | (let ((banners "/share/cups/banners")) | |
447 | (delete-file-recursively (string-append out banners)) | |
448 | (symlink (string-append cups-filters banners) | |
449 | (string-append out banners))) | |
51002318 | 450 | |
3064d176 EF |
451 | ;; assorted data |
452 | (let ((data "/share/cups/data")) | |
453 | (delete-file-recursively (string-append out data)) | |
454 | (symlink (string-append cups-filters data) | |
74c164e0 MW |
455 | (string-append out data))) |
456 | ||
457 | #t)))))) | |
51002318 RW |
458 | (inputs |
459 | `(("avahi" ,avahi) | |
460 | ("gnutls" ,gnutls) | |
461 | ("cups-filters" ,cups-filters) | |
462 | ("zlib" ,zlib))))) | |
2b56dc01 | 463 | |
12255b3d CB |
464 | (define-public cups-pk-helper |
465 | (package | |
466 | (name "cups-pk-helper") | |
467 | (version "0.2.6") | |
468 | (source (origin | |
469 | (method url-fetch) | |
470 | (uri (string-append "https://freedesktop.org/software/" | |
471 | name "/releases/" name "-" version ".tar.xz")) | |
472 | (sha256 | |
473 | (base32 | |
474 | "0a52jw6rm7lr5nbyksiia0rn7sasyb5cjqcb95z1wxm2yprgi6lm")))) | |
475 | (build-system gnu-build-system) | |
476 | (native-inputs | |
477 | `(("intltool" ,intltool) | |
478 | ("pkg-config" ,pkg-config) | |
479 | ("glib" ,glib) | |
480 | ("polkit" ,polkit) | |
481 | ("cups" ,cups))) | |
482 | (home-page "https://www.freedesktop.org/wiki/Software/cups-pk-helper/") | |
483 | (synopsis "PolicyKit helper to configure CUPS with fine-grained privileges") | |
484 | (description | |
485 | "This package provides the org.opensuse.CupsPkHelper.Mechanism DBus | |
486 | system service which uses @file{cups-pk-helper-mechanism}. This package | |
487 | should only be used as part of the Guix cups-pk-helper service.") | |
488 | (license license:gpl2+))) | |
489 | ||
2b56dc01 DM |
490 | (define-public hplip |
491 | (package | |
492 | (name "hplip") | |
0cbc8357 | 493 | (version "3.21.4") |
2b56dc01 DM |
494 | (source (origin |
495 | (method url-fetch) | |
de67e922 LF |
496 | (uri (string-append "mirror://sourceforge/hplip/hplip/" version |
497 | "/hplip-" version ".tar.gz")) | |
2b56dc01 DM |
498 | (sha256 |
499 | (base32 | |
0cbc8357 | 500 | "1lsa0g8lafnmfyia0vy9x1j9q2l80xjjm7clkrawrbg53y3x7ixx")) |
86c979b7 LC |
501 | (modules '((guix build utils))) |
502 | (snippet | |
6cbee49d | 503 | '(begin |
7a7d5f66 LC |
504 | ;; Delete non-free blobs: .so files, pre-compiled |
505 | ;; 'locatedriver' executable, etc. | |
506 | (for-each delete-file | |
507 | (find-files "." | |
508 | (lambda (file stat) | |
509 | (elf-file? file)))) | |
0cbc8357 TGR |
510 | |
511 | ;; Now remove some broken references to them. | |
b44b1f08 | 512 | (delete-file "prnt/hpcups/ImageProcessor.h") |
0cbc8357 TGR |
513 | (substitute* "Makefile.in" |
514 | ((" -lImageProcessor ") " ") | |
515 | (("(\\@HPLIP_BUILD_TRUE\\@[[:blank:]]*).*libImageProcessor.*" | |
516 | _ prefix) | |
517 | (string-append prefix ":; \\\n"))) | |
ea843715 | 518 | |
ea843715 LC |
519 | ;; Install binaries under libexec/hplip instead of |
520 | ;; share/hplip; that'll at least ensure they get stripped. | |
521 | ;; It's not even clear that they're of any use though... | |
522 | (substitute* "Makefile.in" | |
523 | (("^dat2drvdir =.*") | |
524 | "dat2drvdir = $(pkglibexecdir)\n") | |
525 | (("^locatedriverdir =.*") | |
526 | "locatedriverdir = $(pkglibexecdir)\n")) | |
6cbee49d | 527 | #t)))) |
2b56dc01 | 528 | (build-system gnu-build-system) |
8ce52a25 | 529 | (outputs (list "out" "ppd")) |
21c51ebd | 530 | (home-page "https://developers.hp.com/hp-linux-imaging-and-printing") |
6a163a3f TGR |
531 | (synopsis "HP printer drivers") |
532 | (description | |
533 | "Hewlett-Packard printer drivers and PostScript Printer Descriptions | |
534 | (@dfn{PPD}s).") | |
2b56dc01 DM |
535 | |
536 | ;; The 'COPYING' file lists directories where each of these 3 licenses | |
537 | ;; applies. | |
538 | (license (list license:gpl2+ license:bsd-3 license:expat)) | |
539 | ||
540 | ;; TODO install apparmor profile files eventually. | |
541 | (arguments | |
542 | `(#:configure-flags | |
0cbc8357 TGR |
543 | `("--disable-imageProcessor-build" |
544 | "--disable-network-build" | |
2b56dc01 DM |
545 | ,(string-append "--prefix=" (assoc-ref %outputs "out")) |
546 | ,(string-append "--sysconfdir=" (assoc-ref %outputs "out") "/etc") | |
b17004f9 TGR |
547 | ,(string-append "LDFLAGS=-Wl,-rpath=" |
548 | (assoc-ref %outputs "out") "/lib") | |
2b56dc01 DM |
549 | ;; Disable until mime.types merging works (FIXME). |
550 | "--disable-fax-build" | |
2b56dc01 | 551 | "--enable-new-hpcups" |
2b56dc01 DM |
552 | ;; TODO add foomatic drv install eventually. |
553 | ;; TODO --enable-policykit eventually. | |
554 | ,(string-append "--with-cupsfilterdir=" | |
555 | (assoc-ref %outputs "out") "/lib/cups/filter") | |
556 | ,(string-append "--with-cupsbackenddir=" | |
557 | (assoc-ref %outputs "out") "/lib/cups/backend") | |
8ce52a25 TGR |
558 | ,(string-append "--with-hpppddir=" |
559 | (assoc-ref %outputs "ppd") "/share/ppd/HP") | |
2b56dc01 DM |
560 | ,(string-append "--with-icondir=" |
561 | (assoc-ref %outputs "out") "/share/applications") | |
562 | ,(string-append "--with-systraydir=" | |
407ef4b3 TGR |
563 | (assoc-ref %outputs "out") "/etc/xdg") |
564 | "--enable-qt5" "--disable-qt4") | |
2b56dc01 DM |
565 | |
566 | #:imported-modules ((guix build python-build-system) | |
567 | ,@%gnu-build-system-modules) | |
568 | #:modules ((guix build gnu-build-system) | |
569 | (guix build utils) | |
570 | ((guix build python-build-system) #:prefix python:)) | |
571 | ||
fbaa66ac TGR |
572 | #:phases |
573 | (modify-phases %standard-phases | |
574 | (add-after 'unpack 'fix-hard-coded-file-names | |
575 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
576 | (let ((out (assoc-ref outputs "out")) | |
577 | ;; FIXME: use merged ppds (I think actually only | |
578 | ;; drvs need to be merged). | |
579 | (cupsdir (assoc-ref inputs "cups-minimal"))) | |
580 | (substitute* "base/g.py" | |
581 | (("'/usr/share;[^']*'") | |
582 | (string-append "'" cupsdir "/share'")) | |
583 | (("'/etc/hp/hplip.conf'") | |
584 | (string-append "'" out | |
585 | "/etc/hp/hplip.conf" "'"))) | |
586 | ||
587 | (substitute* "Makefile.in" | |
588 | (("[[:blank:]]check-plugin\\.py[[:blank:]]") " ") | |
589 | ;; FIXME Use beginning-of-word in regexp. | |
590 | (("[[:blank:]]plugin\\.py[[:blank:]]") " ") | |
591 | (("/usr/include/libusb-1.0") | |
592 | (string-append (assoc-ref inputs "libusb") | |
593 | "/include/libusb-1.0")) | |
594 | (("hplip_statedir =.*$") | |
595 | ;; Don't bail out while trying to create | |
596 | ;; /var/lib/hplip. We can safely change its value | |
597 | ;; here because it's hard-coded in the code anyway. | |
598 | "hplip_statedir = $(prefix)\n") | |
599 | (("hplip_confdir = /etc/hp") | |
600 | ;; This is only used for installing the default config. | |
601 | (string-append "hplip_confdir = " out | |
602 | "/etc/hp")) | |
603 | (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor") | |
604 | ;; We don't use hal. | |
605 | (string-append "halpredir = " out | |
606 | "/share/hal/fdi/preprobe/10osvendor")) | |
607 | (("rulesdir = /etc/udev/rules.d") | |
608 | ;; udev rules will be merged by base service. | |
609 | (string-append "rulesdir = " out | |
610 | "/lib/udev/rules.d")) | |
611 | (("rulessystemdir = /usr/lib/systemd/system") | |
612 | ;; We don't use systemd. | |
613 | (string-append "rulessystemdir = " out | |
614 | "/lib/systemd/system")) | |
615 | (("/etc/sane.d") | |
68c7f577 MB |
616 | (string-append out "/etc/sane.d"))) |
617 | #t))) | |
618 | (add-before 'configure 'fix-build-with-python-3.8 | |
619 | (lambda* (#:key inputs #:allow-other-keys) | |
620 | (let ((python (assoc-ref inputs "python"))) | |
8ce52a25 | 621 | ;; XXX: The configure script looks for Python headers in the |
68c7f577 MB |
622 | ;; wrong places as of version 3.20.3. Help it by adding the |
623 | ;; include directory on C_INCLUDE_PATH. | |
624 | (when python | |
625 | (setenv "C_INCLUDE_PATH" | |
626 | (string-append python "/include/python" | |
627 | (python:python-version python) | |
628 | ":" (getenv "C_INCLUDE_PATH")))) | |
629 | #t))) | |
afc7882f DM |
630 | (add-after 'install 'install-models-dat |
631 | (lambda* (#:key outputs #:allow-other-keys) | |
632 | (let* ((out (assoc-ref outputs "out")) | |
633 | (models-dir (string-append out | |
634 | "/share/hplip/data/models"))) | |
635 | (install-file "data/models/models.dat" models-dir)) | |
636 | #t)) | |
fbaa66ac TGR |
637 | (add-after 'install 'wrap-binaries |
638 | ;; Scripts in /bin are all symlinks to .py files in /share/hplip. | |
639 | ;; Symlinks are immune to the Python build system's 'WRAP phase, | |
640 | ;; and the .py files can't be wrapped because they are reused as | |
641 | ;; modules. Replacing the symlinks in /bin with copies and | |
642 | ;; wrapping them also doesn't work (“ModuleNotFoundError: | |
643 | ;; No module named 'base'”). Behold: a custom WRAP-PROGRAM. | |
644 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
645 | (let* ((out (assoc-ref outputs "out")) | |
646 | (bin (string-append out "/bin")) | |
647 | (python (assoc-ref inputs "python"))) | |
648 | (with-directory-excursion bin | |
649 | (for-each (lambda (file) | |
650 | (let ((target (readlink file))) | |
651 | (delete-file file) | |
652 | (with-output-to-file file | |
653 | (lambda _ | |
654 | (format #t | |
655 | "#!~a~@ | |
656 | export PYTHONPATH=\"~a:~a\"~@ | |
657 | exec -a \"$0\" \"~a/~a\" \"$@\"~%" | |
658 | (which "bash") | |
659 | (string-append | |
660 | out "/lib/python" | |
661 | (python:python-version python) | |
662 | "/site-packages") | |
663 | (getenv "PYTHONPATH") | |
664 | bin target))) | |
665 | (chmod file #o755))) | |
666 | (find-files "." (lambda (file stat) | |
667 | (eq? 'symlink (stat:type stat))))) | |
668 | #t))))))) | |
2b56dc01 | 669 | |
407ef4b3 TGR |
670 | ;; Note that the error messages printed by the tools in the case of |
671 | ;; missing dependencies are often downright misleading. | |
672 | ;; TODO: hp-toolbox still fails to start with: | |
673 | ;; from dbus.mainloop.pyqt5 import DBusQtMainLoop | |
674 | ;; ModuleNotFoundError: No module named 'dbus.mainloop.pyqt5' | |
675 | (inputs | |
676 | `(("cups-minimal" ,cups-minimal) | |
677 | ("dbus" ,dbus) | |
4bd428a7 | 678 | ("libjpeg" ,libjpeg-turbo) |
407ef4b3 TGR |
679 | ("libusb" ,libusb) |
680 | ("python" ,python) | |
681 | ("python-dbus" ,python-dbus) | |
682 | ("python-pygobject" ,python-pygobject) | |
683 | ("python-pyqt" ,python-pyqt) | |
684 | ("python-wrapper" ,python-wrapper) | |
685 | ("sane-backends" ,sane-backends-minimal) | |
686 | ("zlib" ,zlib))) | |
687 | (native-inputs | |
688 | `(("perl" ,perl) | |
689 | ("pkg-config" ,pkg-config))))) | |
d02aabaf | 690 | |
8e189596 | 691 | (define-public hplip-minimal |
1a265842 | 692 | (package/inherit hplip |
8e189596 EF |
693 | (name "hplip-minimal") |
694 | (arguments | |
695 | (substitute-keyword-arguments (package-arguments hplip) | |
696 | ((#:configure-flags cf) | |
c9b3a72b LC |
697 | ;; Produce a "light build", meaning that only the printer (CUPS) and |
698 | ;; scanner (SANE) support gets built, without all the 'hp-*' | |
699 | ;; command-line tools. | |
700 | `(cons "--enable-lite-build" | |
701 | (delete "--enable-qt5" ,cf))) | |
702 | ((#:phases phases) | |
703 | ;; The 'wrap-binaries' is not needed here since the 'hp-*' programs | |
704 | ;; are not installed. | |
705 | `(alist-delete 'wrap-binaries ,phases)))) | |
706 | (inputs (remove (match-lambda | |
707 | ((label . _) | |
708 | (string-prefix? "python" label))) | |
709 | (package-inputs hplip))) | |
8e189596 EF |
710 | (synopsis "GUI-less version of hplip"))) |
711 | ||
d02aabaf LC |
712 | (define-public foomatic-filters |
713 | (package | |
714 | (name "foomatic-filters") | |
4bd05a21 | 715 | (version "4.0.17") |
d02aabaf LC |
716 | (source (origin |
717 | (method url-fetch) | |
718 | (uri (string-append | |
719 | "http://www.openprinting.org/download/foomatic/" | |
8d515ce6 | 720 | "foomatic-filters-" version ".tar.gz")) |
d02aabaf LC |
721 | (sha256 |
722 | (base32 | |
4bd05a21 | 723 | "1qrkgbm5jay2r7sh9qbyf0aiyrsl1mdc844hxf7fhw95a0zfbqm2")) |
d02aabaf LC |
724 | (patches |
725 | (search-patches "foomatic-filters-CVE-2015-8327.patch" | |
726 | "foomatic-filters-CVE-2015-8560.patch")))) | |
727 | (build-system gnu-build-system) | |
728 | (home-page | |
729 | "https://wiki.linuxfoundation.org/openprinting/database/foomatic") | |
730 | (native-inputs | |
731 | `(("perl" ,perl) | |
732 | ("pkg-config" ,pkg-config))) | |
733 | (inputs | |
734 | `(("dbus" ,dbus) | |
735 | ("a2ps" ,a2ps))) | |
736 | (arguments | |
737 | '( ;; Specify the installation directories. | |
738 | #:configure-flags (list (string-append "ac_cv_path_CUPS_BACKENDS=" | |
739 | (assoc-ref %outputs "out") | |
740 | "/lib/cups/backend") | |
741 | (string-append "ac_cv_path_CUPS_FILTERS=" | |
742 | (assoc-ref %outputs "out") | |
743 | "/lib/cups/filter") | |
744 | (string-append "ac_cv_path_PPR_INTERFACES=" | |
745 | (assoc-ref %outputs "out") | |
746 | "/lib/ppr/interfaces") | |
747 | (string-append "ac_cv_path_PPR_LIB=" | |
748 | (assoc-ref %outputs "out") | |
749 | "/lib/ppr/lib") | |
750 | ||
751 | ;; For some reason these are misdiagnosed. | |
752 | "ac_cv_func_malloc_0_nonnull=yes" | |
753 | "ac_cv_func_realloc_0_nonnull=yes") | |
754 | #:test-target "tests")) | |
755 | (synopsis "Convert PostScript to the printer's native format") | |
756 | (description | |
757 | "This package contains filter scripts used by the printer spoolers to | |
758 | convert the incoming PostScript data into the printer's native format using a | |
759 | printer/driver specific, but spooler-independent PPD file.") | |
760 | (license license:gpl2+))) | |
5db0a1cd LC |
761 | |
762 | (define-public foo2zjs | |
763 | (package | |
5db0a1cd | 764 | (name "foo2zjs") |
f1442560 TGR |
765 | (version "20200610.1") |
766 | (source | |
767 | (origin | |
768 | (method url-fetch) | |
769 | ;; The upstream tarball is unversioned: use a stable snapshot. | |
770 | (uri (string-append "https://web.archive.org/web/20210224094943if_/" | |
771 | "http://foo2zjs.rkkda.com/foo2zjs.tar.gz")) | |
772 | (sha256 | |
773 | (base32 "03ncif50n7ck7drggqxbc7w0kgzdb90ha0dbvqk98ky8lw3k76xd")))) | |
5db0a1cd LC |
774 | (build-system gnu-build-system) |
775 | (arguments | |
776 | '(#:phases (modify-phases %standard-phases | |
777 | (replace 'configure | |
778 | (lambda* (#:key outputs #:allow-other-keys) | |
779 | (substitute* (find-files "." "^Makefile$") | |
780 | ;; Set the installation directory. | |
781 | (("^PREFIX[[:blank:]]*=.*$") | |
782 | (string-append "PREFIX = " | |
783 | (assoc-ref outputs "out") | |
784 | "\n")) | |
785 | (("^UDEVBIN[[:blank:]]*=.*$") | |
786 | "UDEVBIN = $(PREFIX)/bin\n") | |
787 | ;; Don't try to chown/chgrp the installed files. | |
788 | (("-oroot") | |
789 | "") | |
790 | (("-glp") | |
791 | "") | |
792 | ;; Placate the dependency checks. | |
793 | (("/usr/include/stdio.h") | |
794 | "/etc/passwd") | |
795 | (("/usr/") | |
796 | "$(PREFIX)/") | |
797 | ;; Ensure fixed timestamps in man pages. | |
798 | (("^MODTIME[[:blank:]]*=.*$") | |
799 | "MODTIME = echo Thu Jan 01 01:00:00 1970\n")) | |
800 | #t)) | |
cf066b7a BD |
801 | (add-before 'install 'make-install-dirs |
802 | (lambda* (#:key outputs #:allow-other-keys) | |
803 | ;; Make missing install dirs | |
804 | (let ((out (assoc-ref outputs "out")) | |
805 | (dirs '("/share/cups/model" | |
806 | "/share/foomatic/db/source/opt" | |
807 | "/share/foomatic/db/source/printer" | |
808 | "/share/foomatic/db/source/driver" | |
809 | "/lib/cups/filter"))) | |
810 | (for-each (lambda (dir) | |
811 | (mkdir-p (string-append out dir))) | |
812 | dirs)))) | |
813 | (add-after 'install 'wrap-wrappers | |
814 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
815 | (let ((out (assoc-ref outputs "out")) | |
816 | (ghostscript (assoc-ref inputs "ghostscript")) | |
817 | (coreutils (assoc-ref inputs "coreutils")) | |
818 | (sed (assoc-ref inputs "sed"))) | |
819 | (for-each (lambda (file) | |
820 | (wrap-program file | |
821 | `("PATH" ":" prefix | |
822 | (,(string-append ghostscript "/bin:" | |
823 | coreutils "/bin:" | |
824 | sed "/bin"))))) | |
825 | (find-files (string-append | |
826 | out "/bin") "wrapper$"))))) | |
827 | (add-after 'install 'install-cups-filters-symlinks | |
828 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
829 | (let ((out (assoc-ref outputs "out"))) | |
830 | (for-each | |
831 | (lambda (file) | |
832 | (symlink file | |
833 | (string-append out "/lib/cups/filter/" | |
834 | (basename file)))) | |
835 | (find-files (string-append out "/bin")))))) | |
5db0a1cd LC |
836 | (add-after 'install 'remove-pdf |
837 | (lambda* (#:key outputs #:allow-other-keys) | |
838 | ;; Remove 'manual.pdf' which is (1) useless (it's a | |
839 | ;; concatenation of man pages), and (2) not | |
840 | ;; bit-reproducible due to <https://bugs.gnu.org/27593>. | |
841 | (let ((out (assoc-ref outputs "out"))) | |
842 | (for-each delete-file | |
843 | (find-files out "^manual\\.pdf$")) | |
844 | #t)))) | |
845 | #:parallel-build? #f ;broken makefile | |
846 | #:tests? #f ;no tests | |
847 | #:make-flags '("CC=gcc"))) | |
848 | (inputs | |
cf066b7a BD |
849 | `(("coreutils" ,coreutils) |
850 | ("sed" ,sed) | |
851 | ("ghostscript" ,ghostscript) | |
5db0a1cd LC |
852 | ("foomatic-filters" ,foomatic-filters))) ;for 'foomatic-rip' |
853 | (native-inputs | |
854 | `(("bc" ,bc) | |
855 | ("groff" ,groff))) | |
0a7d3e1e TGR |
856 | (home-page "http://foo2zjs.rkkda.com/") |
857 | (synopsis "Printer driver for ZjStream-based printers") | |
5db0a1cd | 858 | (description |
0a7d3e1e TGR |
859 | "foo2zjs is a printer driver for printers that use the Zenographics |
860 | ZjStream wire protocol for their print data, often erroneously referred to as | |
861 | winprinters or GDI printers. | |
862 | ||
863 | It supports Minolta/QMS@tie{}Magicolor, Minolta@tie{}Color@tie{}PageWorks/Pro, | |
864 | HP@tie{}LaserJet, and possibly other printers. See @file{README} for details.") | |
865 | (license (list license:expat ; icc2ps/*.[ch] | |
866 | license:gpl2+)))) ; everything else | |
011f5769 | 867 | |
0b57c1b0 | 868 | (define-public epson-inkjet-printer-escpr |
011f5769 | 869 | (package |
0b57c1b0 | 870 | (name "epson-inkjet-printer-escpr") |
111521db | 871 | (version "1.7.11") |
011f5769 DNB |
872 | ;; XXX: This currently works. But it will break as soon as a newer |
873 | ;; version is available since the URLs for older versions are not | |
874 | ;; preserved. An alternative source will be added as soon as | |
875 | ;; available. | |
7158dc2d TGR |
876 | (source |
877 | (origin | |
878 | (method url-fetch) | |
111521db TGR |
879 | (uri (string-append "https://download3.ebz.epson.net/dsc/f/03/00/12/84/" |
880 | "42/69bb076469542fe702ada5ea53a4ea4773d407b0/" | |
881 | "epson-inkjet-printer-escpr-1.7.11-1lsb3.2.tar.gz")) | |
7158dc2d | 882 | (sha256 |
111521db | 883 | (base32 "0m21qks68697x7k6z0i1c8lcf9l5ap4mwc5519a086cmy9whslzf")))) |
011f5769 DNB |
884 | (build-system gnu-build-system) |
885 | (arguments | |
aa954ec3 TGR |
886 | `(#:modules |
887 | ((srfi srfi-26) | |
888 | ,@%gnu-build-system-modules) | |
889 | #:configure-flags | |
3b2a2621 TGR |
890 | `("--disable-static" |
891 | ,(string-append "--prefix=" | |
011f5769 DNB |
892 | (assoc-ref %outputs "out")) |
893 | ,(string-append "--with-cupsfilterdir=" | |
894 | (assoc-ref %outputs "out") "/lib/cups/filter") | |
895 | ,(string-append "--with-cupsppddir=" | |
7158dc2d TGR |
896 | (assoc-ref %outputs "out") "/share/cups/model")) |
897 | #:phases | |
898 | (modify-phases %standard-phases | |
899 | (add-after 'unpack 'patch-autotools-version-requirement | |
900 | (lambda _ | |
901 | (substitute* "aclocal.m4" | |
902 | (("1\\.15") | |
903 | ,(package-version automake))) | |
904 | (substitute* "configure" | |
905 | (("^(ACLOCAL=).*" _ match) | |
906 | (string-append match "aclocal")) | |
907 | (("^(AUTOMAKE=).*" _ match) | |
908 | (string-append match "automake"))) | |
aa954ec3 TGR |
909 | #t)) |
910 | (add-after 'install 'compress-PPDs | |
911 | (lambda* (#:key outputs #:allow-other-keys) | |
912 | (let ((out (assoc-ref outputs "out"))) | |
913 | (with-directory-excursion out | |
914 | (for-each (cut invoke "gzip" "-9" <>) | |
915 | (find-files "share/cups" "\\.ppd$"))))))))) | |
7158dc2d TGR |
916 | (native-inputs |
917 | `(("autoconf" ,autoconf) | |
918 | ("automake" ,automake))) | |
919 | (inputs | |
920 | `(("cups" ,cups-minimal))) | |
011f5769 DNB |
921 | (synopsis "ESC/P-R printer driver") |
922 | (description | |
0b66a8bb TGR |
923 | "This package provides a filter for @acronym{CUPS, the Common UNIX Printing |
924 | System} that offers high-quality printing with Seiko@tie{}Epson color ink jet | |
925 | printers. It can be used only with printers that support the Epson@tie{}ESC/P-R | |
011f5769 | 926 | language.") |
61eba727 | 927 | (home-page "http://download.ebz.epson.net/dsc/search/01/search/?OSC=LX") |
011f5769 | 928 | (license license:gpl2+))) |
dd6f309d | 929 | |
0b57c1b0 TGR |
930 | (define-public escpr |
931 | (deprecated-package "escpr" epson-inkjet-printer-escpr)) | |
932 | ||
390f3e9e | 933 | (define-public splix |
a25362a5 TGR |
934 | ;; Last released in 2009 <https://sourceforge.net/projects/splix/files/>. |
935 | ;; Last SVN commit was 2013 <https://svn.code.sf.net/p/splix/code/splix/>. | |
936 | ;; Use a more maintained fork with several bug fixes and support for newer | |
937 | ;; printer models. | |
938 | (let ((commit "76268c4dd7dbc8218ea7426401104c3b40cc707a") | |
939 | (revision "315")) | |
390f3e9e TGR |
940 | (package |
941 | (name "splix") | |
a25362a5 | 942 | (version (git-version "2.0.0" revision commit)) |
390f3e9e TGR |
943 | (source |
944 | (origin | |
a25362a5 TGR |
945 | (method git-fetch) |
946 | (uri (git-reference | |
947 | (url "https://gitlab.com/ScumCoder/splix") | |
948 | (commit commit))) | |
949 | (file-name (git-file-name name version)) | |
390f3e9e | 950 | (sha256 |
a25362a5 | 951 | (base32 "1mxsvllwwr1v8sgrax0b7gkajjhnm0l06s67spmaxz47lyll1qab")))) |
390f3e9e | 952 | (build-system gnu-build-system) |
a25362a5 | 953 | ;; PPDs have been obsolete since CUPS 1.2 and make up 90% of total size. |
390f3e9e TGR |
954 | (outputs (list "out" "ppd")) |
955 | (arguments | |
359a195e TGR |
956 | `(#:modules |
957 | ((srfi srfi-26) | |
958 | ,@%gnu-build-system-modules) | |
959 | #:make-flags | |
390f3e9e TGR |
960 | (list (string-append "CUPSDRV=" |
961 | (assoc-ref %outputs "out") "/share/cups/drv") | |
962 | (string-append "CUPSFILTER=" | |
963 | (assoc-ref %outputs "out") "/lib/cups/filter") | |
964 | (string-append "CUPSPPD=" | |
965 | (assoc-ref %outputs "ppd") "/share/cups/model") | |
966 | "CACHESIZE=100" ; pages in RAM, ±300 KiB each | |
967 | "THREADS=4") ; compress and print faster | |
968 | #:phases | |
969 | (modify-phases %standard-phases | |
a25362a5 TGR |
970 | (add-after 'unpack 'enter-subdirectory |
971 | ;; The git repository replicates the top-level SVN layout. | |
972 | (lambda _ | |
973 | (chdir "splix") | |
974 | #t)) | |
390f3e9e TGR |
975 | (delete 'configure) ; no configure script |
976 | (add-before 'build 'build-.drv-files | |
977 | (lambda* (#:key make-flags #:allow-other-keys) | |
978 | (apply invoke "make" "drv" make-flags))) | |
979 | (add-after 'install 'install-.drv-files | |
980 | (lambda* (#:key make-flags #:allow-other-keys) | |
359a195e TGR |
981 | (apply invoke "make" "install" "DRV_ONLY=1" make-flags))) |
982 | (add-after 'install 'compress-PPDs | |
983 | (lambda* (#:key outputs #:allow-other-keys) | |
984 | (let ((ppd (assoc-ref outputs "ppd"))) | |
985 | (for-each (cut invoke "gzip" "-9" <>) | |
986 | (find-files ppd "\\.ppd$")))))) | |
390f3e9e TGR |
987 | #:tests? #f)) ; no test suite |
988 | (inputs | |
989 | `(("cups" ,cups-minimal) | |
a25362a5 TGR |
990 | ("jbigkit" ,jbigkit) |
991 | ("zlib" ,zlib))) | |
390f3e9e TGR |
992 | (synopsis "QPDL (SPL2) printer driver") |
993 | (description | |
994 | "SpliX is a set of CUPS drivers for printers that speak @acronym{QPDL, | |
995 | Quick Page Description Language}, also called @acronym{SPL2, Samsung Printer | |
996 | Language version 2}. These include many laser printers sold by Samsung, | |
997 | Xerox, Lexmark, Toshiba, and Dell. | |
998 | ||
999 | Colour printers need colour profile files to get better results. These | |
1000 | @file{cms} files are provided by the printer's manufacturer and must be | |
1001 | obtained and installed separately.") | |
1002 | (home-page "http://splix.ap2c.org/") | |
1003 | (license license:gpl2)))) | |
1004 | ||
dd6f309d CB |
1005 | (define-public python-pycups |
1006 | (package | |
1007 | (name "python-pycups") | |
1008 | (version "1.9.74") | |
1009 | (source | |
1010 | (origin | |
1011 | (method url-fetch) | |
1012 | (uri (pypi-uri "pycups" version ".tar.bz2")) | |
1013 | (sha256 | |
1014 | (base32 | |
1015 | "1ffp7sswhdsfpy88zg0cc8kl04wygkjs01rlm9f0spbwk8jhy2c6")))) | |
1016 | (build-system python-build-system) | |
1017 | (arguments | |
1018 | '(;; Tests require CUPS to be running | |
1019 | #:tests? #f)) | |
1020 | (inputs | |
1021 | `(("cups" ,cups))) | |
1022 | (home-page "https://github.com/zdohnal/pycups") | |
1023 | (synopsis "Python bindings for libcups") | |
1024 | (description | |
1025 | "This package provides Python bindings for libcups, wrapping the CUPS | |
1026 | API.") | |
1027 | (license license:gpl2+))) |