1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2015, 2016, 2017, 2019 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, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
10 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 polkit)
42 #:use-module (gnu packages pretty-print)
43 #:use-module (gnu packages python)
44 #:use-module (gnu packages python-xyz)
45 #:use-module (gnu packages qt)
46 #:use-module (gnu packages scanner)
47 #:use-module (gnu packages tls)
48 #:use-module (guix build-system gnu)
49 #:use-module (guix build-system python)
50 #:use-module (guix download)
51 #:use-module (guix svn-download)
52 #:use-module ((guix licenses) #:prefix license:)
53 #:use-module (guix packages)
54 #:use-module (guix utils)
55 #:use-module (srfi srfi-1)
56 #:use-module (ice-9 match))
58 (define-public cups-filters
65 (string-append "https://openprinting.org/download/cups-filters/"
66 "cups-filters-" version ".tar.xz"))
69 "0nlq44jnjcnrbdv0dv5myg5kaycmk6a4klynpvj65xvn3l9cq28s"))
70 (modules '((guix build utils)))
72 ;; install backends, banners and filters to cups-filters output
73 ;; directory, not the cups server directory
75 (substitute* "Makefile.in"
76 (("CUPS_DATADIR = @CUPS_DATADIR@")
77 "CUPS_DATADIR = $(PREFIX)/share/cups")
78 (("pkgcupsserverrootdir = \\$\\(CUPS_SERVERROOT\\)")
79 "pkgcupsserverrootdir = $(PREFIX)")
80 ;; Choose standard directories notably so that binaries are
82 (("pkgbackenddir = \\$\\(CUPS_SERVERBIN\\)/backend")
83 "pkgbackenddir = $(PREFIX)/lib/cups/backend")
84 (("pkgfilterdir = \\$\\(CUPS_SERVERBIN\\)/filter")
85 "pkgfilterdir = $(PREFIX)/lib/cups/filter"))
86 ;; Find bannertopdf data such as the print test page in our
87 ;; output directory, not CUPS's prefix.
88 (substitute* "configure"
89 (("\\{CUPS_DATADIR\\}/data")
90 "{prefix}/share/cups/data"))
92 (build-system gnu-build-system)
94 `(#:make-flags (list (string-append "PREFIX=" %output))
96 `("--disable-driverless" ; TODO: enable this
97 "--disable-mutool" ; depends on yet another PDF library (mupdf)
99 ;; Look for the "domain socket of CUPS" in /var/run/cups.
100 "--localstatedir=/var"
102 ;; Free software for the win.
103 "--with-acroread-path=evince"
105 ,(string-append "--with-test-font-path="
106 (assoc-ref %build-inputs "font-dejavu")
107 "/share/fonts/truetype/DejaVuSans.ttf")
108 ,(string-append "--with-gs-path="
109 (assoc-ref %build-inputs "ghostscript")
111 ,(string-append "--with-shell="
112 (assoc-ref %build-inputs "bash")
114 ,(string-append "--with-rcdir="
115 (assoc-ref %outputs "out") "/etc/rc.d"))
117 #:phases (modify-phases %standard-phases
118 (add-after 'unpack 'patch-foomatic-hardcoded-file-names
119 (lambda* (#:key inputs outputs #:allow-other-keys)
120 ;; Foomatic has hardcoded file names we need to fix.
121 (let ((out (assoc-ref outputs "out"))
122 (gs (assoc-ref inputs "ghostscript")))
123 (substitute* "filter/foomatic-rip/foomaticrip.c"
124 (("/usr/local/lib/cups/filter")
125 (string-append out "/lib/cups/filter")))
127 (add-after 'unpack 'patch-for-poppler
129 (substitute* "filter/pdf.cxx"
130 (("GooString \\*field_name;" m)
131 (string-append "const " m)))
133 (add-after 'install 'wrap-filters
134 (lambda* (#:key inputs outputs #:allow-other-keys)
135 ;; Some filters expect to find 'gs' in $PATH. We cannot
136 ;; just hard-code its absolute file name in the source
137 ;; because foomatic-rip, for example, has tests like
138 ;; 'startswith(cmd, "gs")'.
139 (let ((out (assoc-ref outputs "out"))
140 (ghostscript (assoc-ref inputs "ghostscript")))
141 (for-each (lambda (file)
144 (,(string-append ghostscript
146 (find-files (string-append
147 out "/lib/cups/filter")))
150 `(("glib" ,glib "bin") ; for gdbus-codegen
151 ("pkg-config" ,pkg-config)))
154 ("fontconfig" ,fontconfig)
155 ("freetype" ,freetype)
156 ("font-dejavu" ,font-dejavu) ; also needed by test suite
157 ("ghostscript" ,ghostscript/cups)
167 ("cups-minimal" ,cups-minimal)))
168 (home-page "https://wiki.linuxfoundation.org/openprinting/cups-filters")
169 (synopsis "OpenPrinting CUPS filters and backends")
171 "Contains backends, filters, and other software that was once part of the
172 core CUPS distribution but is no longer maintained by Apple Inc. In addition
173 it contains additional filters developed independently of Apple, especially
174 filters for the PDF-centric printing workflow introduced by OpenPrinting.")
175 ;; Different filters and backends have different licenses; see COPYING for
177 (license (list license:gpl2
184 ;; CUPS on non-MacOS systems requires cups-filters. Since cups-filters also
185 ;; depends on CUPS libraries and binaries, cups-minimal has been added to
186 ;; satisfy this dependency.
187 (define-public cups-minimal
189 (name "cups-minimal")
194 (uri (string-append "https://github.com/apple/cups/releases/download/v"
195 version "/cups-" version "-source.tar.gz"))
198 "0v5p10lyv8wv48s8ghkhjmdrxg6iwj8hn36v1ilkz46n7y0i107m"))))
199 (build-system gnu-build-system)
202 '("--disable-launchd"
206 ;; Seven tests fail, mostly because of files that are provided by the
207 ;; cups-filters package.
210 (modify-phases %standard-phases
211 (add-before 'configure 'patch-makedefs
213 (substitute* "Makedefs.in"
214 (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
215 (("/bin/sh") (which "sh")))
217 ;; Make the compressed manpages writable so that the
218 ;; reset-gzip-timestamps phase does not error out.
219 (add-before 'reset-gzip-timestamps 'make-manpages-writable
220 (lambda* (#:key outputs #:allow-other-keys)
221 (let* ((out (assoc-ref outputs "out"))
222 (man (string-append out "/share/man")))
223 (for-each (lambda (file) (chmod file #o644))
224 (find-files man "\\.gz"))
226 (add-before 'build 'patch-tests
228 (substitute* "test/ippserver.c"
229 (("# else /\\* HAVE_AVAHI \\*/")
230 "#elif defined(HAVE_AVAHI)"))
233 `(("pkg-config" ,pkg-config)))
237 (home-page "https://www.cups.org")
238 (synopsis "The Common Unix Printing System")
240 "CUPS is a printing system that uses the Internet Printing Protocol
241 (@dfn{IPP}). It provides System V and BSD command-line interfaces, as well
242 as a Web interface and a C programming interface to manage printers and print
243 jobs. It supports printing to both local (parallel, serial, USB) and
244 networked printers, and printers can be shared from one computer to another.
245 Internally, CUPS uses PostScript Printer Description (@dfn{PPD}) files to
246 describe printer capabilities and features, and a wide variety of generic and
247 device-specific programs to convert and print many types of files.")
248 (license license:gpl2)))
251 (package (inherit cups-minimal)
254 `(;; Three tests fail:
255 ;; * two tests in ipp-1.1.test related to "RFC 2911 section 3.2.6:
256 ;; Get-Jobs Operation"
257 ;; * test of number of error/warning messages, probably related to a
261 '("--disable-launchd"
264 (modify-phases %standard-phases
265 (add-before 'configure 'patch-makedefs
267 (substitute* "Makedefs.in"
268 (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
269 (("/bin/sh") (which "sh")))
271 (add-before 'check 'patch-tests
273 (let ((filters (assoc-ref %build-inputs "cups-filters"))
274 (catpath (string-append
275 (assoc-ref %build-inputs "coreutils") "/bin/"))
276 (testdir (string-append (getcwd) "/tmp/")))
278 (substitute* "test/run-stp-tests.sh"
279 ((" *BASE=/tmp/") (string-append "BASE=" testdir))
281 ;; allow installation of filters from output dir and from
283 (("for dir in /usr/libexec/cups/filter /usr/lib/cups/filter")
286 (assoc-ref %outputs "out") "/lib/cups/filter "
287 filters "/lib/cups/filter"))
289 ;; check for charsets in cups-filters output
290 (("/usr/share/cups/charsets")
291 (string-append filters "/share/cups/charsets"))
293 ;; install additional required filters
294 (("instfilter texttopdf texttopdf pdf")
296 "instfilter texttopdf texttopdf pdf;"
297 "instfilter imagetoraster imagetoraster raster;"
298 "instfilter gstoraster gstoraster raster;"
299 "instfilter urftopdf urftopdf pdf;"
300 "instfilter rastertopdf rastertopdf pdf;"
301 "instfilter pstopdf pstopdf pdf"))
303 ;; specify location of lpstat binary
304 (("description=\"`lpstat -l")
305 "description=\"`../systemv/lpstat -l")
307 ;; patch shebangs of embedded scripts
308 (("#!/bin/sh") (string-append "#!" (which "sh")))
310 ;; also link mime definitions from cups-filters
311 ;; to enable the additional filters for the test suite
312 (("ln -s \\$root/conf/mime\\.types")
315 "/share/cups/mime/cupsfilters.types $BASE/share/mime; "
316 "ln -s $root/conf/mime.types"))
317 (("ln -s \\$root/conf/mime\\.convs")
320 "/share/cups/mime/cupsfilters.convs $BASE/share/mime; "
321 "ln -s $root/conf/mime.convs")))
323 ;; fix search path for "cat"
324 (substitute* "cups/testfile.c"
325 (("cupsFileFind\\(\"cat\", \"/bin\"")
326 (string-append "cupsFileFind(\"cat\", \"" catpath "\""))
327 (("cupsFileFind\\(\"cat\", \"/bin:/usr/bin\"")
328 (string-append "cupsFileFind(\"cat\", \"" catpath "\"")))
330 ;; Make the compressed manpages writable so that the
331 ;; reset-gzip-timestamps phase does not error out.
332 (add-before 'reset-gzip-timestamps 'make-manpages-writable
333 (lambda* (#:key outputs #:allow-other-keys)
334 (let* ((out (assoc-ref outputs "out"))
335 (man (string-append out "/share/man")))
336 (for-each (lambda (file) (chmod file #o644))
337 (find-files man "\\.gz"))
339 (add-after 'install 'install-cups-filters-symlinks
340 (lambda* (#:key inputs outputs #:allow-other-keys)
341 (let ((out (assoc-ref outputs "out"))
342 (cups-filters (assoc-ref inputs "cups-filters")))
345 (string-append cups-filters "/share/cups/charsets")
346 (string-append out "/share/charsets"))
348 ;; mime types, driver file, ppds
351 (symlink (string-append cups-filters f)
352 (string-append out f)))
353 '("/share/cups/mime/cupsfilters.types"
354 "/share/cups/mime/cupsfilters.convs"
355 "/share/cups/drv/cupsfilters.drv"
362 (string-append out "/lib/cups/filter" (basename f))))
363 (find-files (string-append cups-filters "/lib/cups/filter")))
368 (symlink (string-append cups-filters f)
369 (string-append out "/lib/cups/backend/"
371 '("/lib/cups/backend/parallel"
372 "/lib/cups/backend/serial"))
375 (let ((banners "/share/cups/banners"))
376 (delete-file-recursively (string-append out banners))
377 (symlink (string-append cups-filters banners)
378 (string-append out banners)))
381 (let ((data "/share/cups/data"))
382 (delete-file-recursively (string-append out data))
383 (symlink (string-append cups-filters data)
384 (string-append out data)))
390 ("cups-filters" ,cups-filters)
393 (define-public cups-pk-helper
395 (name "cups-pk-helper")
399 (uri (string-append "https://freedesktop.org/software/"
400 name "/releases/" name "-" version ".tar.xz"))
403 "0a52jw6rm7lr5nbyksiia0rn7sasyb5cjqcb95z1wxm2yprgi6lm"))))
404 (build-system gnu-build-system)
406 `(("intltool" ,intltool)
407 ("pkg-config" ,pkg-config)
411 (home-page "https://www.freedesktop.org/wiki/Software/cups-pk-helper/")
412 (synopsis "PolicyKit helper to configure CUPS with fine-grained privileges")
414 "This package provides the org.opensuse.CupsPkHelper.Mechanism DBus
415 system service which uses @file{cups-pk-helper-mechanism}. This package
416 should only be used as part of the Guix cups-pk-helper service.")
417 (license license:gpl2+)))
425 (uri (string-append "mirror://sourceforge/hplip/hplip/" version
426 "/hplip-" version ".tar.gz"))
429 "0lfmym225dr4qnssglqd0gyf0nmm7jpbzkdr1s2wyknmx8z7fx9x"))
430 (modules '((guix build utils)))
431 (patches (search-patches "hplip-remove-imageprocessor.patch"))
434 ;; Delete non-free blobs: .so files, pre-compiled
435 ;; 'locatedriver' executable, etc.
436 (for-each delete-file
440 (delete-file "prnt/hpcups/ImageProcessor.h")
442 ;; Install binaries under libexec/hplip instead of
443 ;; share/hplip; that'll at least ensure they get stripped.
444 ;; It's not even clear that they're of any use though...
445 (substitute* "Makefile.in"
447 "dat2drvdir = $(pkglibexecdir)\n")
448 (("^locatedriverdir =.*")
449 "locatedriverdir = $(pkglibexecdir)\n"))
451 (build-system gnu-build-system)
452 (home-page "https://developers.hp.com/hp-linux-imaging-and-printing")
453 (synopsis "HP printer drivers")
455 "Hewlett-Packard printer drivers and PostScript Printer Descriptions
458 ;; The 'COPYING' file lists directories where each of these 3 licenses
460 (license (list license:gpl2+ license:bsd-3 license:expat))
462 ;; TODO install apparmor profile files eventually.
465 `("--disable-network-build"
466 ,(string-append "--prefix=" (assoc-ref %outputs "out"))
467 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out") "/etc")
468 ,(string-append "LDFLAGS=-Wl,-rpath="
469 (assoc-ref %outputs "out") "/lib")
470 ;; Disable until mime.types merging works (FIXME).
471 "--disable-fax-build"
472 "--enable-hpcups-install"
473 "--enable-new-hpcups"
474 "--enable-cups_ppd_install"
475 "--enable-cups_drv_install"
476 ;; TODO add foomatic drv install eventually.
477 ;; TODO --enable-policykit eventually.
478 ,(string-append "--with-cupsfilterdir="
479 (assoc-ref %outputs "out") "/lib/cups/filter")
480 ,(string-append "--with-cupsbackenddir="
481 (assoc-ref %outputs "out") "/lib/cups/backend")
482 ,(string-append "--with-icondir="
483 (assoc-ref %outputs "out") "/share/applications")
484 ,(string-append "--with-systraydir="
485 (assoc-ref %outputs "out") "/etc/xdg")
486 "--enable-qt5" "--disable-qt4")
488 #:imported-modules ((guix build python-build-system)
489 ,@%gnu-build-system-modules)
490 #:modules ((guix build gnu-build-system)
492 ((guix build python-build-system) #:prefix python:))
495 (modify-phases %standard-phases
496 (add-after 'unpack 'fix-hard-coded-file-names
497 (lambda* (#:key inputs outputs #:allow-other-keys)
498 (let ((out (assoc-ref outputs "out"))
499 ;; FIXME: use merged ppds (I think actually only
500 ;; drvs need to be merged).
501 (cupsdir (assoc-ref inputs "cups-minimal")))
502 (substitute* "base/g.py"
503 (("'/usr/share;[^']*'")
504 (string-append "'" cupsdir "/share'"))
505 (("'/etc/hp/hplip.conf'")
506 (string-append "'" out
507 "/etc/hp/hplip.conf" "'")))
509 (substitute* "Makefile.in"
510 (("[[:blank:]]check-plugin\\.py[[:blank:]]") " ")
511 ;; FIXME Use beginning-of-word in regexp.
512 (("[[:blank:]]plugin\\.py[[:blank:]]") " ")
513 (("/usr/include/libusb-1.0")
514 (string-append (assoc-ref inputs "libusb")
515 "/include/libusb-1.0"))
516 (("hplip_statedir =.*$")
517 ;; Don't bail out while trying to create
518 ;; /var/lib/hplip. We can safely change its value
519 ;; here because it's hard-coded in the code anyway.
520 "hplip_statedir = $(prefix)\n")
521 (("hplip_confdir = /etc/hp")
522 ;; This is only used for installing the default config.
523 (string-append "hplip_confdir = " out
525 (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor")
527 (string-append "halpredir = " out
528 "/share/hal/fdi/preprobe/10osvendor"))
529 (("rulesdir = /etc/udev/rules.d")
530 ;; udev rules will be merged by base service.
531 (string-append "rulesdir = " out
532 "/lib/udev/rules.d"))
533 (("rulessystemdir = /usr/lib/systemd/system")
534 ;; We don't use systemd.
535 (string-append "rulessystemdir = " out
536 "/lib/systemd/system"))
538 (string-append out "/etc/sane.d"))))))
539 (add-after 'install 'wrap-binaries
540 ;; Scripts in /bin are all symlinks to .py files in /share/hplip.
541 ;; Symlinks are immune to the Python build system's 'WRAP phase,
542 ;; and the .py files can't be wrapped because they are reused as
543 ;; modules. Replacing the symlinks in /bin with copies and
544 ;; wrapping them also doesn't work (“ModuleNotFoundError:
545 ;; No module named 'base'”). Behold: a custom WRAP-PROGRAM.
546 (lambda* (#:key inputs outputs #:allow-other-keys)
547 (let* ((out (assoc-ref outputs "out"))
548 (bin (string-append out "/bin"))
549 (python (assoc-ref inputs "python")))
550 (with-directory-excursion bin
551 (for-each (lambda (file)
552 (let ((target (readlink file)))
554 (with-output-to-file file
558 export PYTHONPATH=\"~a:~a\"~@
559 exec -a \"$0\" \"~a/~a\" \"$@\"~%"
563 (python:python-version python)
565 (getenv "PYTHONPATH")
568 (find-files "." (lambda (file stat)
569 (eq? 'symlink (stat:type stat)))))
572 ;; Note that the error messages printed by the tools in the case of
573 ;; missing dependencies are often downright misleading.
574 ;; TODO: hp-toolbox still fails to start with:
575 ;; from dbus.mainloop.pyqt5 import DBusQtMainLoop
576 ;; ModuleNotFoundError: No module named 'dbus.mainloop.pyqt5'
578 `(("cups-minimal" ,cups-minimal)
583 ("python-dbus" ,python-dbus)
584 ("python-pygobject" ,python-pygobject)
585 ("python-pyqt" ,python-pyqt)
586 ("python-wrapper" ,python-wrapper)
587 ("sane-backends" ,sane-backends-minimal)
591 ("pkg-config" ,pkg-config)))))
593 (define-public hplip-minimal
596 (name "hplip-minimal")
598 (substitute-keyword-arguments (package-arguments hplip)
599 ((#:configure-flags cf)
600 ;; Produce a "light build", meaning that only the printer (CUPS) and
601 ;; scanner (SANE) support gets built, without all the 'hp-*'
602 ;; command-line tools.
603 `(cons "--enable-lite-build"
604 (delete "--enable-qt5" ,cf)))
606 ;; The 'wrap-binaries' is not needed here since the 'hp-*' programs
607 ;; are not installed.
608 `(alist-delete 'wrap-binaries ,phases))))
609 (inputs (remove (match-lambda
611 (string-prefix? "python" label)))
612 (package-inputs hplip)))
613 (synopsis "GUI-less version of hplip")))
615 (define-public foomatic-filters
617 (name "foomatic-filters")
622 "http://www.openprinting.org/download/foomatic/"
623 "foomatic-filters-" version ".tar.gz"))
626 "1qrkgbm5jay2r7sh9qbyf0aiyrsl1mdc844hxf7fhw95a0zfbqm2"))
628 (search-patches "foomatic-filters-CVE-2015-8327.patch"
629 "foomatic-filters-CVE-2015-8560.patch"))))
630 (build-system gnu-build-system)
632 "https://wiki.linuxfoundation.org/openprinting/database/foomatic")
635 ("pkg-config" ,pkg-config)))
640 '( ;; Specify the installation directories.
641 #:configure-flags (list (string-append "ac_cv_path_CUPS_BACKENDS="
642 (assoc-ref %outputs "out")
644 (string-append "ac_cv_path_CUPS_FILTERS="
645 (assoc-ref %outputs "out")
647 (string-append "ac_cv_path_PPR_INTERFACES="
648 (assoc-ref %outputs "out")
649 "/lib/ppr/interfaces")
650 (string-append "ac_cv_path_PPR_LIB="
651 (assoc-ref %outputs "out")
654 ;; For some reason these are misdiagnosed.
655 "ac_cv_func_malloc_0_nonnull=yes"
656 "ac_cv_func_realloc_0_nonnull=yes")
657 #:test-target "tests"))
658 (synopsis "Convert PostScript to the printer's native format")
660 "This package contains filter scripts used by the printer spoolers to
661 convert the incoming PostScript data into the printer's native format using a
662 printer/driver specific, but spooler-independent PPD file.")
663 (license license:gpl2+)))
665 (define-public foo2zjs
671 ;; XXX: This is an unversioned URL!
672 (uri "http://foo2zjs.rkkda.com/foo2zjs.tar.gz")
675 "1nn84c045mbv6yzpjfggc6152bvgrmcxiyvgz9v2w3sws7ihshrm"))))
676 (build-system gnu-build-system)
678 '(#:phases (modify-phases %standard-phases
680 (lambda* (#:key outputs #:allow-other-keys)
681 (substitute* (find-files "." "^Makefile$")
682 ;; Set the installation directory.
683 (("^PREFIX[[:blank:]]*=.*$")
684 (string-append "PREFIX = "
685 (assoc-ref outputs "out")
687 (("^UDEVBIN[[:blank:]]*=.*$")
688 "UDEVBIN = $(PREFIX)/bin\n")
689 ;; Don't try to chown/chgrp the installed files.
694 ;; Placate the dependency checks.
695 (("/usr/include/stdio.h")
699 ;; Ensure fixed timestamps in man pages.
700 (("^MODTIME[[:blank:]]*=.*$")
701 "MODTIME = echo Thu Jan 01 01:00:00 1970\n"))
703 (add-after 'install 'remove-pdf
704 (lambda* (#:key outputs #:allow-other-keys)
705 ;; Remove 'manual.pdf' which is (1) useless (it's a
706 ;; concatenation of man pages), and (2) not
707 ;; bit-reproducible due to <https://bugs.gnu.org/27593>.
708 (let ((out (assoc-ref outputs "out")))
709 (for-each delete-file
710 (find-files out "^manual\\.pdf$"))
712 #:parallel-build? #f ;broken makefile
713 #:tests? #f ;no tests
714 #:make-flags '("CC=gcc")))
716 `(("ghostscript" ,ghostscript)
717 ("foomatic-filters" ,foomatic-filters))) ;for 'foomatic-rip'
721 (home-page "http://foo2zjs.rkkda.com/")
722 (synopsis "Printer driver for ZjStream-based printers")
724 "foo2zjs is a printer driver for printers that use the Zenographics
725 ZjStream wire protocol for their print data, often erroneously referred to as
726 winprinters or GDI printers.
728 It supports Minolta/QMS@tie{}Magicolor, Minolta@tie{}Color@tie{}PageWorks/Pro,
729 HP@tie{}LaserJet, and possibly other printers. See @file{README} for details.")
730 (license (list license:expat ; icc2ps/*.[ch]
731 license:gpl2+)))) ; everything else
737 ;; XXX: This currently works. But it will break as soon as a newer
738 ;; version is available since the URLs for older versions are not
739 ;; preserved. An alternative source will be added as soon as
743 ;; The uri has to be chopped up in order to satisfy guix lint.
744 (uri (string-append "https://download3.ebz.epson.net/dsc/f/03/00/08/18/20/"
745 "e94de600e28e510c1cfa158929d8b2c0aadc8aa0/"
746 "epson-inkjet-printer-escpr-1.6.30-1lsb3.2.tar.gz"))
749 "0m8pyfkixisp0vclwxj340isn15zzisal0v2xvv66kxfd68dzf12"))))
750 (build-system gnu-build-system)
753 `(,(string-append "--prefix="
754 (assoc-ref %outputs "out"))
755 ,(string-append "--with-cupsfilterdir="
756 (assoc-ref %outputs "out") "/lib/cups/filter")
757 ,(string-append "--with-cupsppddir="
758 (assoc-ref %outputs "out") "/share/ppd"))))
759 (inputs `(("cups" ,cups-minimal)))
760 (synopsis "ESC/P-R printer driver")
762 "This package provides a filter for the Common UNIX Printing
763 System (CUPS). It offers high-quality printing with Seiko Epson color ink jet
764 printers. It can only be used with printers that support the Epson ESC/P-R
766 (home-page "http://download.ebz.epson.net/dsc/search/01/search")
767 (license license:gpl2+)))
770 ;; The last release was in 2009. The SVN repository contains 5 years of
771 ;; unreleased bug fixes and support for newer printer models.
772 (let ((revision 315))
775 (version (string-append "2.0.0-" (number->string revision)))
780 (url "https://svn.code.sf.net/p/splix/code/splix/")
781 (revision revision)))
782 (file-name (string-append name "-" version "-checkout"))
784 (base32 "16wbm4xnz35ca3mw2iggf5f4jaxpyna718ia190ka6y4ah932jxl"))))
785 (build-system gnu-build-system)
786 ;; 90% (3.8 MiB) of output are .ppd files. Don't install them by default:
787 ;; CUPS has been able to read the .drv sources directly since version 1.2.
788 (outputs (list "out" "ppd"))
791 (list (string-append "CUPSDRV="
792 (assoc-ref %outputs "out") "/share/cups/drv")
793 (string-append "CUPSFILTER="
794 (assoc-ref %outputs "out") "/lib/cups/filter")
795 (string-append "CUPSPPD="
796 (assoc-ref %outputs "ppd") "/share/cups/model")
797 "CACHESIZE=100" ; pages in RAM, ±300 KiB each
798 "THREADS=4") ; compress and print faster
800 (modify-phases %standard-phases
801 (delete 'configure) ; no configure script
802 (add-before 'build 'build-.drv-files
803 (lambda* (#:key make-flags #:allow-other-keys)
804 (apply invoke "make" "drv" make-flags)))
805 (add-after 'install 'install-.drv-files
806 (lambda* (#:key make-flags #:allow-other-keys)
807 (apply invoke "make" "install" "DRV_ONLY=1" make-flags))))
808 #:tests? #f)) ; no test suite
810 `(("cups" ,cups-minimal)
813 ;; This dependency can be dropped by setting DISABLE_JBIG=1, but the
814 ;; result will not support some printers like the Samsung CLP-600.
815 ("jbigkit" ,jbigkit)))
816 (synopsis "QPDL (SPL2) printer driver")
818 "SpliX is a set of CUPS drivers for printers that speak @acronym{QPDL,
819 Quick Page Description Language}, also called @acronym{SPL2, Samsung Printer
820 Language version 2}. These include many laser printers sold by Samsung,
821 Xerox, Lexmark, Toshiba, and Dell.
823 Colour printers need colour profile files to get better results. These
824 @file{cms} files are provided by the printer's manufacturer and must be
825 obtained and installed separately.")
826 (home-page "http://splix.ap2c.org/")
827 (license license:gpl2))))
829 (define-public python-pycups
831 (name "python-pycups")
836 (uri (pypi-uri "pycups" version ".tar.bz2"))
839 "1ffp7sswhdsfpy88zg0cc8kl04wygkjs01rlm9f0spbwk8jhy2c6"))))
840 (build-system python-build-system)
842 '(;; Tests require CUPS to be running
846 (home-page "https://github.com/zdohnal/pycups")
847 (synopsis "Python bindings for libcups")
849 "This package provides Python bindings for libcups, wrapping the CUPS
851 (license license:gpl2+)))