Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / cups.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
5 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
6 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
7 ;;; Copyright © 2017 Mark H Weaver <mhw@netris.org>
8 ;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;;
10 ;;; This file is part of GNU Guix.
11 ;;;
12 ;;; GNU Guix is free software; you can redistribute it and/or modify it
13 ;;; under the terms of the GNU General Public License as published by
14 ;;; the Free Software Foundation; either version 3 of the License, or (at
15 ;;; your option) any later version.
16 ;;;
17 ;;; GNU Guix is distributed in the hope that it will be useful, but
18 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;;; GNU General Public License for more details.
21 ;;;
22 ;;; You should have received a copy of the GNU General Public License
23 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25 (define-module (gnu packages cups)
26 #:use-module ((guix licenses) #:prefix license:)
27 #:use-module (guix packages)
28 #:use-module (guix download)
29 #:use-module (guix build-system gnu)
30 #:use-module (gnu packages)
31 #:use-module (gnu packages algebra)
32 #:use-module (gnu packages autotools)
33 #:use-module (gnu packages avahi)
34 #:use-module (gnu packages compression)
35 #:use-module (gnu packages groff)
36 #:use-module (gnu packages libusb)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pretty-print)
39 #:use-module (gnu packages python)
40 #:use-module (gnu packages scanner)
41 #:use-module (gnu packages image)
42 #:use-module (gnu packages fonts) ;font-dejavu
43 #:use-module (gnu packages fontutils)
44 #:use-module (gnu packages ghostscript)
45 #:use-module (gnu packages glib)
46 #:use-module (gnu packages pdf)
47 #:use-module (gnu packages pkg-config)
48 #:use-module (gnu packages tls))
49
50 (define-public cups-filters
51 (package
52 (name "cups-filters")
53 (version "1.17.9")
54 (source(origin
55 (method url-fetch)
56 (uri
57 (string-append "https://openprinting.org/download/cups-filters/"
58 "cups-filters-" version ".tar.xz"))
59 (sha256
60 (base32
61 "0i7mvvnq7ayhxn1ajci8h7l3cijzwr9d50p58h0rbsh9hf63zblq"))
62 (modules '((guix build utils)))
63 (snippet
64 ;; install backends, banners and filters to cups-filters output
65 ;; directory, not the cups server directory
66 '(begin
67 (substitute* "Makefile.in"
68 (("CUPS_DATADIR = @CUPS_DATADIR@")
69 "CUPS_DATADIR = $(PREFIX)/share/cups")
70 (("pkgcupsserverrootdir = \\$\\(CUPS_SERVERROOT\\)")
71 "pkgcupsserverrootdir = $(PREFIX)")
72 ;; Choose standard directories notably so that binaries are
73 ;; stripped.
74 (("pkgbackenddir = \\$\\(CUPS_SERVERBIN\\)/backend")
75 "pkgbackenddir = $(PREFIX)/lib/cups/backend")
76 (("pkgfilterdir = \\$\\(CUPS_SERVERBIN\\)/filter")
77 "pkgfilterdir = $(PREFIX)/lib/cups/filter"))
78 ;; Find bannertopdf data such as the print test page in our
79 ;; output directory, not CUPS's prefix.
80 (substitute* "configure"
81 (("\\{CUPS_DATADIR\\}/data")
82 "{prefix}/share/cups/data"))))))
83 (build-system gnu-build-system)
84 (arguments
85 `(#:make-flags (list (string-append "PREFIX=" %output))
86 #:configure-flags
87 `("--disable-driverless" ; TODO: enable this
88 "--disable-mutool" ; depends on yet another PDF library (mupdf)
89
90 ;; Look for the "domain socket of CUPS" in /var/run/cups.
91 "--localstatedir=/var"
92
93 ;; Free software for the win.
94 "--with-acroread-path=evince"
95
96 ,(string-append "--with-test-font-path="
97 (assoc-ref %build-inputs "font-dejavu")
98 "/share/fonts/truetype/DejaVuSans.ttf")
99 ,(string-append "--with-gs-path="
100 (assoc-ref %build-inputs "ghostscript")
101 "/bin/gsc")
102 ,(string-append "--with-shell="
103 (assoc-ref %build-inputs "bash")
104 "/bin/bash")
105 ,(string-append "--with-rcdir="
106 (assoc-ref %outputs "out") "/etc/rc.d"))
107
108 #:phases (modify-phases %standard-phases
109 (add-after 'unpack 'patch-foomatic-hardcoded-file-names
110 (lambda* (#:key inputs outputs #:allow-other-keys)
111 ;; Foomatic has hardcoded file names we need to fix.
112 (let ((out (assoc-ref outputs "out"))
113 (gs (assoc-ref inputs "ghostscript")))
114 (substitute* "filter/foomatic-rip/foomaticrip.c"
115 (("/usr/local/lib/cups/filter")
116 (string-append out "/lib/cups/filter")))
117 #t)))
118 (add-after 'install 'wrap-filters
119 (lambda* (#:key inputs outputs #:allow-other-keys)
120 ;; Some filters expect to find 'gs' in $PATH. We cannot
121 ;; just hard-code its absolute file name in the source
122 ;; because foomatic-rip, for example, has tests like
123 ;; 'startswith(cmd, "gs")'.
124 (let ((out (assoc-ref outputs "out"))
125 (ghostscript (assoc-ref inputs "ghostscript")))
126 (for-each (lambda (file)
127 (wrap-program file
128 `("PATH" ":" prefix
129 (,(string-append ghostscript
130 "/bin")))))
131 (find-files (string-append
132 out "/lib/cups/filter")))
133 #t))))))
134 (native-inputs
135 `(("glib" ,glib "bin") ; for gdbus-codegen
136 ("pkg-config" ,pkg-config)))
137 (inputs
138 `(("avahi" ,avahi)
139 ("fontconfig" ,fontconfig)
140 ("freetype" ,freetype)
141 ("font-dejavu" ,font-dejavu) ; also needed by test suite
142 ("ghostscript" ,ghostscript/cups)
143 ("ijs" ,ijs)
144 ("dbus" ,dbus)
145 ("lcms" ,lcms)
146 ("libjpeg" ,libjpeg)
147 ("libpng" ,libpng)
148 ("libtiff" ,libtiff)
149 ("glib" ,glib)
150 ("qpdf" ,qpdf)
151 ("poppler" ,poppler)
152 ("cups-minimal" ,cups-minimal)))
153 (home-page "https://wiki.linuxfoundation.org/openprinting/cups-filters")
154 (synopsis "OpenPrinting CUPS filters and backends")
155 (description
156 "Contains backends, filters, and other software that was once part of the
157 core CUPS distribution but is no longer maintained by Apple Inc. In addition
158 it contains additional filters developed independently of Apple, especially
159 filters for the PDF-centric printing workflow introduced by OpenPrinting.")
160 ;; Different filters and backends have different licenses; see COPYING for
161 ;; details
162 (license (list license:gpl2
163 license:gpl2+
164 license:gpl3
165 license:gpl3+
166 license:lgpl2.0+
167 license:expat))))
168
169 ;; CUPS on non-MacOS systems requires cups-filters. Since cups-filters also
170 ;; depends on CUPS libraries and binaries, cups-minimal has been added to
171 ;; satisfy this dependency.
172 (define-public cups-minimal
173 (package
174 (name "cups-minimal")
175 (version "2.2.6")
176 (source
177 (origin
178 (method url-fetch)
179 (uri (string-append "https://github.com/apple/cups/releases/download/v"
180 version "/cups-" version "-source.tar.gz"))
181 (sha256
182 (base32
183 "16qn41b84xz6khrr2pa2wdwlqxr29rrrkjfi618gbgdkq9w5ff20"))))
184 (build-system gnu-build-system)
185 (arguments
186 `(#:configure-flags
187 '("--disable-launchd"
188 "--disable-systemd"
189 "--disable-avahi"
190 "--disable-dnssd")
191 ;; Seven tests fail, mostly because of files that are provided by the
192 ;; cups-filters package.
193 #:tests? #f
194 #:phases
195 (modify-phases %standard-phases
196 (add-before 'configure 'patch-makedefs
197 (lambda _
198 (substitute* "Makedefs.in"
199 (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
200 (("/bin/sh") (which "sh")))))
201 ;; Make the compressed manpages writable so that the
202 ;; reset-gzip-timestamps phase does not error out.
203 (add-before 'reset-gzip-timestamps 'make-manpages-writable
204 (lambda* (#:key outputs #:allow-other-keys)
205 (let* ((out (assoc-ref outputs "out"))
206 (man (string-append out "/share/man")))
207 (for-each (lambda (file) (chmod file #o644))
208 (find-files man "\\.gz")))))
209 (add-before 'build 'patch-tests
210 (lambda _
211 (substitute* "test/ippserver.c"
212 (("# else /\\* HAVE_AVAHI \\*/")
213 "#elif defined(HAVE_AVAHI)")))))))
214 (native-inputs
215 `(("pkg-config" ,pkg-config)))
216 (inputs
217 `(("zlib" ,zlib)
218 ("gnutls" ,gnutls)))
219 (home-page "https://www.cups.org")
220 (synopsis "The Common Unix Printing System")
221 (description
222 "CUPS is a printing system that uses the Internet Printing Protocol
223 (@dfn{IPP}). It provides System V and BSD command-line interfaces, as well
224 as a Web interface and a C programming interface to manage printers and print
225 jobs. It supports printing to both local (parallel, serial, USB) and
226 networked printers, and printers can be shared from one computer to another.
227 Internally, CUPS uses PostScript Printer Description (@dfn{PPD}) files to
228 describe printer capabilities and features, and a wide variety of generic and
229 device-specific programs to convert and print many types of files.")
230 (license license:gpl2)))
231
232 (define-public cups
233 (package (inherit cups-minimal)
234 (name "cups")
235 (arguments
236 `(;; Three tests fail:
237 ;; * two tests in ipp-1.1.test related to "RFC 2911 section 3.2.6:
238 ;; Get-Jobs Operation"
239 ;; * test of number of error/warning messages, probably related to a
240 ;; missing font.
241 #:tests? #f
242 #:configure-flags
243 '("--disable-launchd"
244 "--disable-systemd")
245 #:phases
246 (modify-phases %standard-phases
247 (add-before 'configure 'patch-makedefs
248 (lambda _
249 (substitute* "Makedefs.in"
250 (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
251 (("/bin/sh") (which "sh")))))
252 (add-before 'check 'patch-tests
253 (lambda _
254 (let ((filters (assoc-ref %build-inputs "cups-filters"))
255 (catpath (string-append
256 (assoc-ref %build-inputs "coreutils") "/bin/"))
257 (testdir (string-append (getcwd) "/tmp/")))
258 (mkdir testdir)
259 (substitute* "test/run-stp-tests.sh"
260 ((" *BASE=/tmp/") (string-append "BASE=" testdir))
261
262 ;; allow installation of filters from output dir and from
263 ;; cups-filters
264 (("for dir in /usr/libexec/cups/filter /usr/lib/cups/filter")
265 (string-append
266 "for dir in "
267 (assoc-ref %outputs "out") "/lib/cups/filter "
268 filters "/lib/cups/filter"))
269
270 ;; check for charsets in cups-filters output
271 (("/usr/share/cups/charsets")
272 (string-append filters "/share/cups/charsets"))
273
274 ;; install additional required filters
275 (("instfilter texttopdf texttopdf pdf")
276 (string-append
277 "instfilter texttopdf texttopdf pdf;"
278 "instfilter imagetoraster imagetoraster raster;"
279 "instfilter gstoraster gstoraster raster;"
280 "instfilter urftopdf urftopdf pdf;"
281 "instfilter rastertopdf rastertopdf pdf;"
282 "instfilter pstopdf pstopdf pdf"))
283
284 ;; specify location of lpstat binary
285 (("description=\"`lpstat -l")
286 "description=\"`../systemv/lpstat -l")
287
288 ;; patch shebangs of embedded scripts
289 (("#!/bin/sh") (string-append "#!" (which "sh")))
290
291 ;; also link mime definitions from cups-filters
292 ;; to enable the additional filters for the test suite
293 (("ln -s \\$root/conf/mime\\.types")
294 (string-append
295 "ln -s " filters
296 "/share/cups/mime/cupsfilters.types $BASE/share/mime; "
297 "ln -s $root/conf/mime.types"))
298 (("ln -s \\$root/conf/mime\\.convs")
299 (string-append
300 "ln -s " filters
301 "/share/cups/mime/cupsfilters.convs $BASE/share/mime; "
302 "ln -s $root/conf/mime.convs")))
303
304 ;; fix search path for "cat"
305 (substitute* "cups/testfile.c"
306 (("cupsFileFind\\(\"cat\", \"/bin\"")
307 (string-append "cupsFileFind(\"cat\", \"" catpath "\""))
308 (("cupsFileFind\\(\"cat\", \"/bin:/usr/bin\"")
309 (string-append "cupsFileFind(\"cat\", \"" catpath "\""))))))
310 ;; Make the compressed manpages writable so that the
311 ;; reset-gzip-timestamps phase does not error out.
312 (add-before 'reset-gzip-timestamps 'make-manpages-writable
313 (lambda* (#:key outputs #:allow-other-keys)
314 (let* ((out (assoc-ref outputs "out"))
315 (man (string-append out "/share/man")))
316 (for-each (lambda (file) (chmod file #o644))
317 (find-files man "\\.gz")))))
318 (add-after 'install 'install-cups-filters-symlinks
319 (lambda* (#:key inputs outputs #:allow-other-keys)
320 (let ((out (assoc-ref outputs "out"))
321 (cups-filters (assoc-ref inputs "cups-filters")))
322 ;; charsets
323 (symlink
324 (string-append cups-filters "/share/cups/charsets")
325 (string-append out "/share/charsets"))
326
327 ;; mime types, driver file, ppds
328 (for-each
329 (lambda (f)
330 (symlink (string-append cups-filters f)
331 (string-append out f)))
332 '("/share/cups/mime/cupsfilters.types"
333 "/share/cups/mime/cupsfilters.convs"
334 "/share/cups/drv/cupsfilters.drv"
335 "/share/ppd"))
336
337 ;; filters
338 (for-each
339 (lambda (f)
340 (symlink f
341 (string-append out "/lib/cups/filter" (basename f))))
342 (find-files (string-append cups-filters "/lib/cups/filter")))
343
344 ;; backends
345 (for-each
346 (lambda (f)
347 (symlink (string-append cups-filters f)
348 (string-append out "/lib/cups/backend/"
349 (basename f))))
350 '("/lib/cups/backend/parallel"
351 "/lib/cups/backend/serial"))
352
353 ;; banners
354 (let ((banners "/share/cups/banners"))
355 (delete-file-recursively (string-append out banners))
356 (symlink (string-append cups-filters banners)
357 (string-append out banners)))
358
359 ;; assorted data
360 (let ((data "/share/cups/data"))
361 (delete-file-recursively (string-append out data))
362 (symlink (string-append cups-filters data)
363 (string-append out data)))))))))
364 (inputs
365 `(("avahi" ,avahi)
366 ("gnutls" ,gnutls)
367 ("cups-filters" ,cups-filters)
368 ("zlib" ,zlib)))))
369
370 (define-public hplip
371 (package
372 (name "hplip")
373 (version "3.17.11")
374 (source (origin
375 (method url-fetch)
376 (uri (string-append "mirror://sourceforge/hplip/hplip/" version
377 "/hplip-" version ".tar.gz"))
378 (sha256
379 (base32
380 "0xda7x7xxjvzn1l0adlvbwcw21crq1r3r79bkf94q3m5i6abx49g"))
381 (modules '((guix build utils)))
382 (snippet
383 ;; Fix type mismatch.
384 '(substitute* "prnt/hpcups/genPCLm.cpp"
385 (("boolean") "bool")))))
386 (build-system gnu-build-system)
387 (home-page "http://hplipopensource.com/")
388 (synopsis "HP Printer Drivers")
389 (description "Hewlett-Packard Printer Drivers and PPDs.")
390
391 ;; The 'COPYING' file lists directories where each of these 3 licenses
392 ;; applies.
393 (license (list license:gpl2+ license:bsd-3 license:expat))
394
395 ;; TODO install apparmor profile files eventually.
396 (arguments
397 `(#:configure-flags
398 `("--disable-network-build"
399 ,(string-append "--prefix=" (assoc-ref %outputs "out"))
400 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out") "/etc")
401 ;; Disable until mime.types merging works (FIXME).
402 "--disable-fax-build"
403 "--enable-hpcups-install"
404 "--enable-new-hpcups"
405 "--enable-cups_ppd_install"
406 "--enable-cups_drv_install"
407 ;; TODO add foomatic drv install eventually.
408 ;; TODO --enable-policykit eventually.
409 ,(string-append "--with-cupsfilterdir="
410 (assoc-ref %outputs "out") "/lib/cups/filter")
411 ,(string-append "--with-cupsbackenddir="
412 (assoc-ref %outputs "out") "/lib/cups/backend")
413 ,(string-append "--with-icondir="
414 (assoc-ref %outputs "out") "/share/applications")
415 ,(string-append "--with-systraydir="
416 (assoc-ref %outputs "out") "/etc/xdg"))
417
418 #:imported-modules ((guix build python-build-system)
419 ,@%gnu-build-system-modules)
420 #:modules ((guix build gnu-build-system)
421 (guix build utils)
422 ((guix build python-build-system) #:prefix python:))
423
424 #:phases (modify-phases %standard-phases
425 (add-after 'unpack 'fix-hard-coded-file-names
426 (lambda* (#:key inputs outputs #:allow-other-keys)
427 (let ((out (assoc-ref outputs "out"))
428 ;; FIXME: use merged ppds (I think actually only
429 ;; drvs need to be merged).
430 (cupsdir (assoc-ref inputs "cups-minimal")))
431 (substitute* "base/g.py"
432 (("'/usr/share;[^']*'")
433 (string-append "'" cupsdir "/share'"))
434 (("'/etc/hp/hplip.conf'")
435 (string-append "'" out
436 "/etc/hp/hplip.conf" "'")))
437
438 (substitute* "Makefile.in"
439 (("[[:blank:]]check-plugin\\.py[[:blank:]]") " ")
440 ;; FIXME Use beginning-of-word in regexp.
441 (("[[:blank:]]plugin\\.py[[:blank:]]") " ")
442 (("/usr/include/libusb-1.0")
443 (string-append (assoc-ref inputs "libusb")
444 "/include/libusb-1.0"))
445 (("hplip_statedir =.*$")
446 ;; Don't bail out while trying to create
447 ;; /var/lib/hplip. We can safely change its value
448 ;; here because it's hard-coded in the code anyway.
449 "hplip_statedir = $(prefix)\n")
450 (("hplip_confdir = /etc/hp")
451 ;; This is only used for installing the default config.
452 (string-append "hplip_confdir = " out
453 "/etc/hp"))
454 (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor")
455 ;; Note: We don't use hal.
456 (string-append "halpredir = " out
457 "/share/hal/fdi/preprobe/10osvendor"))
458 (("rulesdir = /etc/udev/rules.d")
459 ;; udev rules will be merged by base service.
460 (string-append "rulesdir = " out
461 "/lib/udev/rules.d"))
462 (("rulessystemdir = /usr/lib/systemd/system")
463 ;; We don't use systemd.
464 (string-append "rulessystemdir = " out
465 "/lib/systemd/system"))
466 (("/etc/sane.d")
467 (string-append out "/etc/sane.d"))))))
468
469 ;; Wrap bin/* so that the Python libs are found.
470 (add-after 'install 'wrap-binaries
471 (assoc-ref python:%standard-phases 'wrap)))))
472
473 ;; Python3 support is available starting from hplip@3.15.2.
474 (inputs `(("libjpeg" ,libjpeg)
475 ("cups-minimal" ,cups-minimal)
476 ("libusb" ,libusb)
477 ("sane-backends" ,sane-backends-minimal)
478 ("zlib" ,zlib)
479 ("dbus" ,dbus)
480 ("python-wrapper" ,python-wrapper)
481 ("python" ,python)
482 ;; TODO: Make hp-setup find python-dbus.
483 ("python-dbus" ,python-dbus)))
484 (native-inputs `(("pkg-config" ,pkg-config)
485 ("perl" ,perl)))))
486
487 (define-public foomatic-filters
488 (package
489 (name "foomatic-filters")
490 (version "4.0.17")
491 (source (origin
492 (method url-fetch)
493 (uri (string-append
494 "http://www.openprinting.org/download/foomatic/"
495 name "-" version ".tar.gz"))
496 (sha256
497 (base32
498 "1qrkgbm5jay2r7sh9qbyf0aiyrsl1mdc844hxf7fhw95a0zfbqm2"))
499 (patches
500 (search-patches "foomatic-filters-CVE-2015-8327.patch"
501 "foomatic-filters-CVE-2015-8560.patch"))))
502 (build-system gnu-build-system)
503 (home-page
504 "https://wiki.linuxfoundation.org/openprinting/database/foomatic")
505 (native-inputs
506 `(("perl" ,perl)
507 ("pkg-config" ,pkg-config)))
508 (inputs
509 `(("dbus" ,dbus)
510 ("a2ps" ,a2ps)))
511 (arguments
512 '( ;; Specify the installation directories.
513 #:configure-flags (list (string-append "ac_cv_path_CUPS_BACKENDS="
514 (assoc-ref %outputs "out")
515 "/lib/cups/backend")
516 (string-append "ac_cv_path_CUPS_FILTERS="
517 (assoc-ref %outputs "out")
518 "/lib/cups/filter")
519 (string-append "ac_cv_path_PPR_INTERFACES="
520 (assoc-ref %outputs "out")
521 "/lib/ppr/interfaces")
522 (string-append "ac_cv_path_PPR_LIB="
523 (assoc-ref %outputs "out")
524 "/lib/ppr/lib")
525
526 ;; For some reason these are misdiagnosed.
527 "ac_cv_func_malloc_0_nonnull=yes"
528 "ac_cv_func_realloc_0_nonnull=yes")
529 #:test-target "tests"))
530 (synopsis "Convert PostScript to the printer's native format")
531 (description
532 "This package contains filter scripts used by the printer spoolers to
533 convert the incoming PostScript data into the printer's native format using a
534 printer/driver specific, but spooler-independent PPD file.")
535 (license license:gpl2+)))
536
537 (define-public foo2zjs
538 (package
539 (name "foo2zjs")
540 (version "20171202")
541 (source (origin
542 (method url-fetch)
543 ;; XXX: This is an unversioned URL!
544 (uri "http://foo2zjs.rkkda.com/foo2zjs.tar.gz")
545 (sha256
546 (base32
547 "10m1ksbzqsrsl4faqyl73ahfnj2hv1y3zrmr366zvjg7w3l6ag5n"))))
548 (build-system gnu-build-system)
549 (arguments
550 '(#:phases (modify-phases %standard-phases
551 (replace 'configure
552 (lambda* (#:key outputs #:allow-other-keys)
553 (substitute* (find-files "." "^Makefile$")
554 ;; Set the installation directory.
555 (("^PREFIX[[:blank:]]*=.*$")
556 (string-append "PREFIX = "
557 (assoc-ref outputs "out")
558 "\n"))
559 (("^UDEVBIN[[:blank:]]*=.*$")
560 "UDEVBIN = $(PREFIX)/bin\n")
561 ;; Don't try to chown/chgrp the installed files.
562 (("-oroot")
563 "")
564 (("-glp")
565 "")
566 ;; Placate the dependency checks.
567 (("/usr/include/stdio.h")
568 "/etc/passwd")
569 (("/usr/")
570 "$(PREFIX)/")
571 ;; Ensure fixed timestamps in man pages.
572 (("^MODTIME[[:blank:]]*=.*$")
573 "MODTIME = echo Thu Jan 01 01:00:00 1970\n"))
574 #t))
575 (add-after 'install 'remove-pdf
576 (lambda* (#:key outputs #:allow-other-keys)
577 ;; Remove 'manual.pdf' which is (1) useless (it's a
578 ;; concatenation of man pages), and (2) not
579 ;; bit-reproducible due to <https://bugs.gnu.org/27593>.
580 (let ((out (assoc-ref outputs "out")))
581 (for-each delete-file
582 (find-files out "^manual\\.pdf$"))
583 #t))))
584 #:parallel-build? #f ;broken makefile
585 #:tests? #f ;no tests
586 #:make-flags '("CC=gcc")))
587 (inputs
588 `(("ghostscript" ,ghostscript)
589 ("foomatic-filters" ,foomatic-filters))) ;for 'foomatic-rip'
590 (native-inputs
591 `(("bc" ,bc)
592 ("groff" ,groff)))
593 (home-page "http://foo2zjs.rkkda.com/")
594 (synopsis "Printer driver for ZjStream-based printers")
595 (description
596 "foo2zjs is a printer driver for printers that use the Zenographics
597 ZjStream wire protocol for their print data, often erroneously referred to as
598 winprinters or GDI printers.
599
600 It supports Minolta/QMS@tie{}Magicolor, Minolta@tie{}Color@tie{}PageWorks/Pro,
601 HP@tie{}LaserJet, and possibly other printers. See @file{README} for details.")
602 (license (list license:expat ; icc2ps/*.[ch]
603 license:gpl2+)))) ; everything else
604
605 (define-public escpr
606 (package
607 (name "escpr")
608 (version "1.6.18")
609 ;; XXX: This currently works. But it will break as soon as a newer
610 ;; version is available since the URLs for older versions are not
611 ;; preserved. An alternative source will be added as soon as
612 ;; available.
613 (source (origin
614 (method url-fetch)
615 ;; The uri has to be chopped up in order to satisfy guix lint.
616 (uri (string-append "https://download3.ebz.epson.net/dsc/f/03/00/06/86/80/"
617 "9955e43f3aead20366851d24cea65de779cf5aa7/"
618 "epson-inkjet-printer-escpr-1.6.18-1lsb3.2.tar.gz"))
619 (sha256
620 (base32
621 "137jf52dhi5v2rkmlw4b73f7r7f98m61dpgsb7yvqs2f0yhsjsb3"))))
622 (build-system gnu-build-system)
623 (arguments
624 `(#:configure-flags
625 `(,(string-append "--prefix="
626 (assoc-ref %outputs "out"))
627 ,(string-append "--with-cupsfilterdir="
628 (assoc-ref %outputs "out") "/lib/cups/filter")
629 ,(string-append "--with-cupsppddir="
630 (assoc-ref %outputs "out") "/share/ppd"))))
631 (inputs `(("cups" ,cups-minimal)))
632 (synopsis "ESC/P-R printer driver")
633 (description
634 "This package provides a filter for the Common UNIX Printing
635 System (CUPS). It offers high-quality printing with Seiko Epson color ink jet
636 printers. It can only be used with printers that support the Epson ESC/P-R
637 language.")
638 (home-page "http://download.ebz.epson.net/dsc/search/01/search")
639 (license license:gpl2+)))