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, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
9 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
11 ;;; This file is part of GNU Guix.
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.
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.
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/>.
26 (define-module (gnu packages cups)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages algebra)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages avahi)
31 #:use-module (gnu packages compression)
32 #:use-module (gnu packages fonts) ; font-dejavu
33 #:use-module (gnu packages fontutils)
34 #:use-module (gnu packages ghostscript)
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages groff)
37 #:use-module (gnu packages image)
38 #:use-module (gnu packages libusb)
39 #:use-module (gnu packages pdf)
40 #:use-module (gnu packages perl)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages polkit)
43 #:use-module (gnu packages pretty-print)
44 #:use-module (gnu packages python)
45 #:use-module (gnu packages python-xyz)
46 #:use-module (gnu packages qt)
47 #:use-module (gnu packages scanner)
48 #:use-module (gnu packages tls)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system python)
51 #:use-module (guix download)
52 #:use-module (guix svn-download)
53 #:use-module ((guix licenses) #:prefix license:)
54 #:use-module (guix packages)
55 #:use-module (guix utils)
56 #:use-module (srfi srfi-1)
57 #:use-module (ice-9 match))
59 (define-public cups-filters
66 (string-append "https://openprinting.org/download/cups-filters/"
67 "cups-filters-" version ".tar.xz"))
70 "110b1xhb5vfpcx0zq9kkas7pj281skx5dpnnr22idx509jfdzj8b"))
71 (modules '((guix build utils)))
73 ;; install backends, banners and filters to cups-filters output
74 ;; directory, not the cups server directory
76 (substitute* "Makefile.in"
77 (("CUPS_DATADIR = @CUPS_DATADIR@")
78 "CUPS_DATADIR = $(PREFIX)/share/cups")
79 (("pkgcupsserverrootdir = \\$\\(CUPS_SERVERROOT\\)")
80 "pkgcupsserverrootdir = $(PREFIX)")
81 ;; Choose standard directories notably so that binaries are
83 (("pkgbackenddir = \\$\\(CUPS_SERVERBIN\\)/backend")
84 "pkgbackenddir = $(PREFIX)/lib/cups/backend")
85 (("pkgfilterdir = \\$\\(CUPS_SERVERBIN\\)/filter")
86 "pkgfilterdir = $(PREFIX)/lib/cups/filter"))
87 ;; Find bannertopdf data such as the print test page in our
88 ;; output directory, not CUPS's prefix.
89 (substitute* "configure"
90 (("\\{CUPS_DATADIR\\}/data")
91 "{prefix}/share/cups/data"))
93 (build-system gnu-build-system)
95 `(#:make-flags (list (string-append "PREFIX=" %output))
97 `("--disable-driverless" ; TODO: enable this
98 "--disable-mutool" ; depends on yet another PDF library (mupdf)
100 ;; Look for the "domain socket of CUPS" in /var/run/cups.
101 "--localstatedir=/var"
103 ;; Free software for the win.
104 "--with-acroread-path=evince"
106 ,(string-append "--with-test-font-path="
107 (assoc-ref %build-inputs "font-dejavu")
108 "/share/fonts/truetype/DejaVuSans.ttf")
109 ,(string-append "--with-gs-path="
110 (assoc-ref %build-inputs "ghostscript")
112 ,(string-append "--with-shell="
113 (assoc-ref %build-inputs "bash")
115 ,(string-append "--with-rcdir="
116 (assoc-ref %outputs "out") "/etc/rc.d"))
118 #:phases (modify-phases %standard-phases
119 (add-after 'unpack 'patch-foomatic-hardcoded-file-names
120 (lambda* (#:key inputs outputs #:allow-other-keys)
121 ;; Foomatic has hardcoded file names we need to fix.
122 (let ((out (assoc-ref outputs "out"))
123 (gs (assoc-ref inputs "ghostscript")))
124 (substitute* "filter/foomatic-rip/foomaticrip.c"
125 (("/usr/local/lib/cups/filter")
126 (string-append out "/lib/cups/filter")))
128 (add-after 'install 'wrap-filters
129 (lambda* (#:key inputs outputs #:allow-other-keys)
130 ;; Some filters expect to find 'gs' in $PATH. We cannot
131 ;; just hard-code its absolute file name in the source
132 ;; because foomatic-rip, for example, has tests like
133 ;; 'startswith(cmd, "gs")'.
134 (let ((out (assoc-ref outputs "out"))
135 (ghostscript (assoc-ref inputs "ghostscript")))
136 (for-each (lambda (file)
139 (,(string-append ghostscript
141 (find-files (string-append
142 out "/lib/cups/filter")))
145 `(("glib" ,glib "bin") ; for gdbus-codegen
146 ("pkg-config" ,pkg-config)))
149 ("fontconfig" ,fontconfig)
150 ("freetype" ,freetype)
151 ("font-dejavu" ,font-dejavu) ; also needed by test suite
152 ("ghostscript" ,ghostscript/cups)
156 ("libjpeg" ,libjpeg-turbo)
162 ("cups-minimal" ,cups-minimal)))
163 (home-page "https://wiki.linuxfoundation.org/openprinting/cups-filters")
164 (synopsis "OpenPrinting CUPS filters and backends")
166 "Contains backends, filters, and other software that was once part of the
167 core CUPS distribution but is no longer maintained by Apple Inc. In addition
168 it contains additional filters developed independently of Apple, especially
169 filters for the PDF-centric printing workflow introduced by OpenPrinting.")
170 ;; Different filters and backends have different licenses; see COPYING for
172 (license (list license:gpl2
179 ;; CUPS on non-MacOS systems requires cups-filters. Since cups-filters also
180 ;; depends on CUPS libraries and binaries, cups-minimal has been added to
181 ;; satisfy this dependency.
182 (define-public cups-minimal
184 (name "cups-minimal")
189 (uri (string-append "https://github.com/apple/cups/releases/download/v"
190 version "/cups-" version "-source.tar.gz"))
193 "1vpk0b2vq830f8fvf9z8qjsm5k141i7pi8djbinpnr78pi4dj7r6"))))
194 (build-system gnu-build-system)
197 '("--disable-launchd"
201 ;; Seven tests fail, mostly because of files that are provided by the
202 ;; cups-filters package.
205 (modify-phases %standard-phases
206 (add-before 'configure 'patch-makedefs
208 (substitute* "Makedefs.in"
209 (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
210 (("/bin/sh") (which "sh")))
212 ;; Make the compressed manpages writable so that the
213 ;; reset-gzip-timestamps phase does not error out.
214 (add-before 'reset-gzip-timestamps 'make-manpages-writable
215 (lambda* (#:key outputs #:allow-other-keys)
216 (let* ((out (assoc-ref outputs "out"))
217 (man (string-append out "/share/man")))
218 (for-each (lambda (file) (chmod file #o644))
219 (find-files man "\\.gz"))
221 (add-before 'build 'patch-tests
223 (substitute* "tools/ippeveprinter.c"
224 (("# else /\\* HAVE_AVAHI \\*/")
225 "#elif defined(HAVE_AVAHI)"))
228 `(("pkg-config" ,pkg-config)))
232 (home-page "https://www.cups.org")
233 (synopsis "The Common Unix Printing System")
235 "CUPS is a printing system that uses the Internet Printing Protocol
236 (@dfn{IPP}). It provides System V and BSD command-line interfaces, as well
237 as a Web interface and a C programming interface to manage printers and print
238 jobs. It supports printing to both local (parallel, serial, USB) and
239 networked printers, and printers can be shared from one computer to another.
240 Internally, CUPS uses PostScript Printer Description (@dfn{PPD}) files to
241 describe printer capabilities and features, and a wide variety of generic and
242 device-specific programs to convert and print many types of files.")
243 ;; CUPS is Apache 2.0 with exceptions, see the NOTICE file.
244 (license license:asl2.0)))
247 (package/inherit cups-minimal
250 `(;; Three tests fail:
251 ;; * two tests in ipp-1.1.test related to "RFC 2911 section 3.2.6:
252 ;; Get-Jobs Operation"
253 ;; * test of number of error/warning messages, probably related to a
257 '("--disable-launchd"
260 (modify-phases %standard-phases
261 (add-before 'configure 'patch-makedefs
263 (substitute* "Makedefs.in"
264 (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
265 (("/bin/sh") (which "sh")))
267 (add-before 'check 'patch-tests
269 (let ((filters (assoc-ref %build-inputs "cups-filters"))
270 (catpath (string-append
271 (assoc-ref %build-inputs "coreutils") "/bin/"))
272 (testdir (string-append (getcwd) "/tmp/")))
274 (substitute* "test/run-stp-tests.sh"
275 ((" *BASE=/tmp/") (string-append "BASE=" testdir))
277 ;; allow installation of filters from output dir and from
279 (("for dir in /usr/libexec/cups/filter /usr/lib/cups/filter")
282 (assoc-ref %outputs "out") "/lib/cups/filter "
283 filters "/lib/cups/filter"))
285 ;; check for charsets in cups-filters output
286 (("/usr/share/cups/charsets")
287 (string-append filters "/share/cups/charsets"))
289 ;; install additional required filters
290 (("instfilter texttopdf texttopdf pdf")
292 "instfilter texttopdf texttopdf pdf;"
293 "instfilter imagetoraster imagetoraster raster;"
294 "instfilter gstoraster gstoraster raster;"
295 "instfilter urftopdf urftopdf pdf;"
296 "instfilter rastertopdf rastertopdf pdf;"
297 "instfilter pstopdf pstopdf pdf"))
299 ;; specify location of lpstat binary
300 (("description=\"`lpstat -l")
301 "description=\"`../systemv/lpstat -l")
303 ;; patch shebangs of embedded scripts
304 (("#!/bin/sh") (string-append "#!" (which "sh")))
306 ;; also link mime definitions from cups-filters
307 ;; to enable the additional filters for the test suite
308 (("ln -s \\$root/conf/mime\\.types")
311 "/share/cups/mime/cupsfilters.types $BASE/share/mime; "
312 "ln -s $root/conf/mime.types"))
313 (("ln -s \\$root/conf/mime\\.convs")
316 "/share/cups/mime/cupsfilters.convs $BASE/share/mime; "
317 "ln -s $root/conf/mime.convs")))
319 ;; fix search path for "cat"
320 (substitute* "cups/testfile.c"
321 (("cupsFileFind\\(\"cat\", \"/bin\"")
322 (string-append "cupsFileFind(\"cat\", \"" catpath "\""))
323 (("cupsFileFind\\(\"cat\", \"/bin:/usr/bin\"")
324 (string-append "cupsFileFind(\"cat\", \"" catpath "\"")))
326 ;; Make the compressed manpages writable so that the
327 ;; reset-gzip-timestamps phase does not error out.
328 (add-before 'reset-gzip-timestamps 'make-manpages-writable
329 (lambda* (#:key outputs #:allow-other-keys)
330 (let* ((out (assoc-ref outputs "out"))
331 (man (string-append out "/share/man")))
332 (for-each (lambda (file) (chmod file #o644))
333 (find-files man "\\.gz"))
335 (add-after 'install 'install-cups-filters-symlinks
336 (lambda* (#:key inputs outputs #:allow-other-keys)
337 (let ((out (assoc-ref outputs "out"))
338 (cups-filters (assoc-ref inputs "cups-filters")))
341 (string-append cups-filters "/share/cups/charsets")
342 (string-append out "/share/charsets"))
344 ;; mime types, driver file, ppds
347 (symlink (string-append cups-filters f)
348 (string-append out f)))
349 '("/share/cups/mime/cupsfilters.types"
350 "/share/cups/mime/cupsfilters.convs"
351 "/share/cups/drv/cupsfilters.drv"
358 (string-append out "/lib/cups/filter" (basename f))))
359 (find-files (string-append cups-filters "/lib/cups/filter")))
364 (symlink (string-append cups-filters f)
365 (string-append out "/lib/cups/backend/"
367 '("/lib/cups/backend/parallel"
368 "/lib/cups/backend/serial"))
371 (let ((banners "/share/cups/banners"))
372 (delete-file-recursively (string-append out banners))
373 (symlink (string-append cups-filters banners)
374 (string-append out banners)))
377 (let ((data "/share/cups/data"))
378 (delete-file-recursively (string-append out data))
379 (symlink (string-append cups-filters data)
380 (string-append out data)))
386 ("cups-filters" ,cups-filters)
389 (define-public cups-pk-helper
391 (name "cups-pk-helper")
395 (uri (string-append "https://freedesktop.org/software/"
396 name "/releases/" name "-" version ".tar.xz"))
399 "0a52jw6rm7lr5nbyksiia0rn7sasyb5cjqcb95z1wxm2yprgi6lm"))))
400 (build-system gnu-build-system)
402 `(("intltool" ,intltool)
403 ("pkg-config" ,pkg-config)
407 (home-page "https://www.freedesktop.org/wiki/Software/cups-pk-helper/")
408 (synopsis "PolicyKit helper to configure CUPS with fine-grained privileges")
410 "This package provides the org.opensuse.CupsPkHelper.Mechanism DBus
411 system service which uses @file{cups-pk-helper-mechanism}. This package
412 should only be used as part of the Guix cups-pk-helper service.")
413 (license license:gpl2+)))
421 (uri (string-append "mirror://sourceforge/hplip/hplip/" version
422 "/hplip-" version ".tar.gz"))
425 "0nj79r61fzddwwzf8kcc0qkp4y9qx46v15iarz6h6y3v91wbsjq0"))
426 (modules '((guix build utils)))
427 (patches (search-patches "hplip-remove-imageprocessor.patch"))
430 ;; Delete non-free blobs: .so files, pre-compiled
431 ;; 'locatedriver' executable, etc.
432 (for-each delete-file
436 (delete-file "prnt/hpcups/ImageProcessor.h")
438 ;; Install binaries under libexec/hplip instead of
439 ;; share/hplip; that'll at least ensure they get stripped.
440 ;; It's not even clear that they're of any use though...
441 (substitute* "Makefile.in"
443 "dat2drvdir = $(pkglibexecdir)\n")
444 (("^locatedriverdir =.*")
445 "locatedriverdir = $(pkglibexecdir)\n"))
447 (build-system gnu-build-system)
448 (home-page "https://developers.hp.com/hp-linux-imaging-and-printing")
449 (synopsis "HP printer drivers")
451 "Hewlett-Packard printer drivers and PostScript Printer Descriptions
454 ;; The 'COPYING' file lists directories where each of these 3 licenses
456 (license (list license:gpl2+ license:bsd-3 license:expat))
458 ;; TODO install apparmor profile files eventually.
461 `("--disable-network-build"
462 ,(string-append "--prefix=" (assoc-ref %outputs "out"))
463 ,(string-append "--sysconfdir=" (assoc-ref %outputs "out") "/etc")
464 ,(string-append "LDFLAGS=-Wl,-rpath="
465 (assoc-ref %outputs "out") "/lib")
466 ;; Disable until mime.types merging works (FIXME).
467 "--disable-fax-build"
468 "--enable-hpcups-install"
469 "--enable-new-hpcups"
470 "--enable-cups_ppd_install"
471 "--enable-cups_drv_install"
472 ;; TODO add foomatic drv install eventually.
473 ;; TODO --enable-policykit eventually.
474 ,(string-append "--with-cupsfilterdir="
475 (assoc-ref %outputs "out") "/lib/cups/filter")
476 ,(string-append "--with-cupsbackenddir="
477 (assoc-ref %outputs "out") "/lib/cups/backend")
478 ,(string-append "--with-icondir="
479 (assoc-ref %outputs "out") "/share/applications")
480 ,(string-append "--with-systraydir="
481 (assoc-ref %outputs "out") "/etc/xdg")
482 "--enable-qt5" "--disable-qt4")
484 #:imported-modules ((guix build python-build-system)
485 ,@%gnu-build-system-modules)
486 #:modules ((guix build gnu-build-system)
488 ((guix build python-build-system) #:prefix python:))
491 (modify-phases %standard-phases
492 (add-after 'unpack 'fix-hard-coded-file-names
493 (lambda* (#:key inputs outputs #:allow-other-keys)
494 (let ((out (assoc-ref outputs "out"))
495 ;; FIXME: use merged ppds (I think actually only
496 ;; drvs need to be merged).
497 (cupsdir (assoc-ref inputs "cups-minimal")))
498 (substitute* "base/g.py"
499 (("'/usr/share;[^']*'")
500 (string-append "'" cupsdir "/share'"))
501 (("'/etc/hp/hplip.conf'")
502 (string-append "'" out
503 "/etc/hp/hplip.conf" "'")))
505 (substitute* "Makefile.in"
506 (("[[:blank:]]check-plugin\\.py[[:blank:]]") " ")
507 ;; FIXME Use beginning-of-word in regexp.
508 (("[[:blank:]]plugin\\.py[[:blank:]]") " ")
509 (("/usr/include/libusb-1.0")
510 (string-append (assoc-ref inputs "libusb")
511 "/include/libusb-1.0"))
512 (("hplip_statedir =.*$")
513 ;; Don't bail out while trying to create
514 ;; /var/lib/hplip. We can safely change its value
515 ;; here because it's hard-coded in the code anyway.
516 "hplip_statedir = $(prefix)\n")
517 (("hplip_confdir = /etc/hp")
518 ;; This is only used for installing the default config.
519 (string-append "hplip_confdir = " out
521 (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor")
523 (string-append "halpredir = " out
524 "/share/hal/fdi/preprobe/10osvendor"))
525 (("rulesdir = /etc/udev/rules.d")
526 ;; udev rules will be merged by base service.
527 (string-append "rulesdir = " out
528 "/lib/udev/rules.d"))
529 (("rulessystemdir = /usr/lib/systemd/system")
530 ;; We don't use systemd.
531 (string-append "rulessystemdir = " out
532 "/lib/systemd/system"))
534 (string-append out "/etc/sane.d")))
536 (add-before 'configure 'fix-build-with-python-3.8
537 (lambda* (#:key inputs #:allow-other-keys)
538 (let ((python (assoc-ref inputs "python")))
539 ;; XXX: The configure script of looks for Python headers in the
540 ;; wrong places as of version 3.20.3. Help it by adding the
541 ;; include directory on C_INCLUDE_PATH.
543 (setenv "C_INCLUDE_PATH"
544 (string-append python "/include/python"
545 (python:python-version python)
546 ":" (getenv "C_INCLUDE_PATH"))))
548 (add-after 'install 'install-models-dat
549 (lambda* (#:key outputs #:allow-other-keys)
550 (let* ((out (assoc-ref outputs "out"))
551 (models-dir (string-append out
552 "/share/hplip/data/models")))
553 (install-file "data/models/models.dat" models-dir))
555 (add-after 'install 'wrap-binaries
556 ;; Scripts in /bin are all symlinks to .py files in /share/hplip.
557 ;; Symlinks are immune to the Python build system's 'WRAP phase,
558 ;; and the .py files can't be wrapped because they are reused as
559 ;; modules. Replacing the symlinks in /bin with copies and
560 ;; wrapping them also doesn't work (“ModuleNotFoundError:
561 ;; No module named 'base'”). Behold: a custom WRAP-PROGRAM.
562 (lambda* (#:key inputs outputs #:allow-other-keys)
563 (let* ((out (assoc-ref outputs "out"))
564 (bin (string-append out "/bin"))
565 (python (assoc-ref inputs "python")))
566 (with-directory-excursion bin
567 (for-each (lambda (file)
568 (let ((target (readlink file)))
570 (with-output-to-file file
574 export PYTHONPATH=\"~a:~a\"~@
575 exec -a \"$0\" \"~a/~a\" \"$@\"~%"
579 (python:python-version python)
581 (getenv "PYTHONPATH")
584 (find-files "." (lambda (file stat)
585 (eq? 'symlink (stat:type stat)))))
588 ;; Note that the error messages printed by the tools in the case of
589 ;; missing dependencies are often downright misleading.
590 ;; TODO: hp-toolbox still fails to start with:
591 ;; from dbus.mainloop.pyqt5 import DBusQtMainLoop
592 ;; ModuleNotFoundError: No module named 'dbus.mainloop.pyqt5'
594 `(("cups-minimal" ,cups-minimal)
596 ("libjpeg" ,libjpeg-turbo)
599 ("python-dbus" ,python-dbus)
600 ("python-pygobject" ,python-pygobject)
601 ("python-pyqt" ,python-pyqt)
602 ("python-wrapper" ,python-wrapper)
603 ("sane-backends" ,sane-backends-minimal)
607 ("pkg-config" ,pkg-config)))))
609 (define-public hplip-minimal
612 (name "hplip-minimal")
614 (substitute-keyword-arguments (package-arguments hplip)
615 ((#:configure-flags cf)
616 ;; Produce a "light build", meaning that only the printer (CUPS) and
617 ;; scanner (SANE) support gets built, without all the 'hp-*'
618 ;; command-line tools.
619 `(cons "--enable-lite-build"
620 (delete "--enable-qt5" ,cf)))
622 ;; The 'wrap-binaries' is not needed here since the 'hp-*' programs
623 ;; are not installed.
624 `(alist-delete 'wrap-binaries ,phases))))
625 (inputs (remove (match-lambda
627 (string-prefix? "python" label)))
628 (package-inputs hplip)))
629 (synopsis "GUI-less version of hplip")))
631 (define-public foomatic-filters
633 (name "foomatic-filters")
638 "http://www.openprinting.org/download/foomatic/"
639 "foomatic-filters-" version ".tar.gz"))
642 "1qrkgbm5jay2r7sh9qbyf0aiyrsl1mdc844hxf7fhw95a0zfbqm2"))
644 (search-patches "foomatic-filters-CVE-2015-8327.patch"
645 "foomatic-filters-CVE-2015-8560.patch"))))
646 (build-system gnu-build-system)
648 "https://wiki.linuxfoundation.org/openprinting/database/foomatic")
651 ("pkg-config" ,pkg-config)))
656 '( ;; Specify the installation directories.
657 #:configure-flags (list (string-append "ac_cv_path_CUPS_BACKENDS="
658 (assoc-ref %outputs "out")
660 (string-append "ac_cv_path_CUPS_FILTERS="
661 (assoc-ref %outputs "out")
663 (string-append "ac_cv_path_PPR_INTERFACES="
664 (assoc-ref %outputs "out")
665 "/lib/ppr/interfaces")
666 (string-append "ac_cv_path_PPR_LIB="
667 (assoc-ref %outputs "out")
670 ;; For some reason these are misdiagnosed.
671 "ac_cv_func_malloc_0_nonnull=yes"
672 "ac_cv_func_realloc_0_nonnull=yes")
673 #:test-target "tests"))
674 (synopsis "Convert PostScript to the printer's native format")
676 "This package contains filter scripts used by the printer spoolers to
677 convert the incoming PostScript data into the printer's native format using a
678 printer/driver specific, but spooler-independent PPD file.")
679 (license license:gpl2+)))
681 (define-public foo2zjs
687 ;; XXX: This is an unversioned URL!
688 (uri "http://foo2zjs.rkkda.com/foo2zjs.tar.gz")
691 "0wwh29ddd59q18r1jpi3166lgnwr8zn9lry82vahc2g96l97isp7"))))
692 (build-system gnu-build-system)
694 '(#:phases (modify-phases %standard-phases
696 (lambda* (#:key outputs #:allow-other-keys)
697 (substitute* (find-files "." "^Makefile$")
698 ;; Set the installation directory.
699 (("^PREFIX[[:blank:]]*=.*$")
700 (string-append "PREFIX = "
701 (assoc-ref outputs "out")
703 (("^UDEVBIN[[:blank:]]*=.*$")
704 "UDEVBIN = $(PREFIX)/bin\n")
705 ;; Don't try to chown/chgrp the installed files.
710 ;; Placate the dependency checks.
711 (("/usr/include/stdio.h")
715 ;; Ensure fixed timestamps in man pages.
716 (("^MODTIME[[:blank:]]*=.*$")
717 "MODTIME = echo Thu Jan 01 01:00:00 1970\n"))
719 (add-after 'install 'remove-pdf
720 (lambda* (#:key outputs #:allow-other-keys)
721 ;; Remove 'manual.pdf' which is (1) useless (it's a
722 ;; concatenation of man pages), and (2) not
723 ;; bit-reproducible due to <https://bugs.gnu.org/27593>.
724 (let ((out (assoc-ref outputs "out")))
725 (for-each delete-file
726 (find-files out "^manual\\.pdf$"))
728 #:parallel-build? #f ;broken makefile
729 #:tests? #f ;no tests
730 #:make-flags '("CC=gcc")))
732 `(("ghostscript" ,ghostscript)
733 ("foomatic-filters" ,foomatic-filters))) ;for 'foomatic-rip'
737 (home-page "http://foo2zjs.rkkda.com/")
738 (synopsis "Printer driver for ZjStream-based printers")
740 "foo2zjs is a printer driver for printers that use the Zenographics
741 ZjStream wire protocol for their print data, often erroneously referred to as
742 winprinters or GDI printers.
744 It supports Minolta/QMS@tie{}Magicolor, Minolta@tie{}Color@tie{}PageWorks/Pro,
745 HP@tie{}LaserJet, and possibly other printers. See @file{README} for details.")
746 (license (list license:expat ; icc2ps/*.[ch]
747 license:gpl2+)))) ; everything else
753 ;; XXX: This currently works. But it will break as soon as a newer
754 ;; version is available since the URLs for older versions are not
755 ;; preserved. An alternative source will be added as soon as
759 ;; The uri has to be chopped up in order to satisfy guix lint.
760 (uri (string-append "https://download3.ebz.epson.net/dsc/f/03/00/08/18/20/"
761 "e94de600e28e510c1cfa158929d8b2c0aadc8aa0/"
762 "epson-inkjet-printer-escpr-1.6.30-1lsb3.2.tar.gz"))
765 "0m8pyfkixisp0vclwxj340isn15zzisal0v2xvv66kxfd68dzf12"))))
766 (build-system gnu-build-system)
769 `(,(string-append "--prefix="
770 (assoc-ref %outputs "out"))
771 ,(string-append "--with-cupsfilterdir="
772 (assoc-ref %outputs "out") "/lib/cups/filter")
773 ,(string-append "--with-cupsppddir="
774 (assoc-ref %outputs "out") "/share/ppd"))))
775 (inputs `(("cups" ,cups-minimal)))
776 (synopsis "ESC/P-R printer driver")
778 "This package provides a filter for the Common UNIX Printing
779 System (CUPS). It offers high-quality printing with Seiko Epson color ink jet
780 printers. It can only be used with printers that support the Epson ESC/P-R
782 (home-page "http://download.ebz.epson.net/dsc/search/01/search")
783 (license license:gpl2+)))
786 ;; The last release was in 2009. The SVN repository contains 5 years of
787 ;; unreleased bug fixes and support for newer printer models.
788 (let ((revision 315))
791 (version (string-append "2.0.0-" (number->string revision)))
796 (url "https://svn.code.sf.net/p/splix/code/splix/")
797 (revision revision)))
798 (file-name (string-append name "-" version "-checkout"))
800 (base32 "16wbm4xnz35ca3mw2iggf5f4jaxpyna718ia190ka6y4ah932jxl"))))
801 (build-system gnu-build-system)
802 ;; 90% (3.8 MiB) of output are .ppd files. Don't install them by default:
803 ;; CUPS has been able to read the .drv sources directly since version 1.2.
804 (outputs (list "out" "ppd"))
807 (list (string-append "CUPSDRV="
808 (assoc-ref %outputs "out") "/share/cups/drv")
809 (string-append "CUPSFILTER="
810 (assoc-ref %outputs "out") "/lib/cups/filter")
811 (string-append "CUPSPPD="
812 (assoc-ref %outputs "ppd") "/share/cups/model")
813 "CACHESIZE=100" ; pages in RAM, ±300 KiB each
814 "THREADS=4") ; compress and print faster
816 (modify-phases %standard-phases
817 (delete 'configure) ; no configure script
818 (add-before 'build 'build-.drv-files
819 (lambda* (#:key make-flags #:allow-other-keys)
820 (apply invoke "make" "drv" make-flags)))
821 (add-after 'install 'install-.drv-files
822 (lambda* (#:key make-flags #:allow-other-keys)
823 (apply invoke "make" "install" "DRV_ONLY=1" make-flags))))
824 #:tests? #f)) ; no test suite
826 `(("cups" ,cups-minimal)
829 ;; This dependency can be dropped by setting DISABLE_JBIG=1, but the
830 ;; result will not support some printers like the Samsung CLP-600.
831 ("jbigkit" ,jbigkit)))
832 (synopsis "QPDL (SPL2) printer driver")
834 "SpliX is a set of CUPS drivers for printers that speak @acronym{QPDL,
835 Quick Page Description Language}, also called @acronym{SPL2, Samsung Printer
836 Language version 2}. These include many laser printers sold by Samsung,
837 Xerox, Lexmark, Toshiba, and Dell.
839 Colour printers need colour profile files to get better results. These
840 @file{cms} files are provided by the printer's manufacturer and must be
841 obtained and installed separately.")
842 (home-page "http://splix.ap2c.org/")
843 (license license:gpl2))))
845 (define-public python-pycups
847 (name "python-pycups")
852 (uri (pypi-uri "pycups" version ".tar.bz2"))
855 "1ffp7sswhdsfpy88zg0cc8kl04wygkjs01rlm9f0spbwk8jhy2c6"))))
856 (build-system python-build-system)
858 '(;; Tests require CUPS to be running
862 (home-page "https://github.com/zdohnal/pycups")
863 (synopsis "Python bindings for libcups")
865 "This package provides Python bindings for libcups, wrapping the CUPS
867 (license license:gpl2+)))