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