;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; This file is part of GNU Guix.
;;;
#:use-module (gnu packages pdf)
#:use-module (gnu packages perl)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages polkit)
#:use-module (gnu packages pretty-print)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-xyz)
#:use-module (gnu packages qt)
#:use-module (gnu packages scanner)
#:use-module (gnu packages tls)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system python)
#:use-module (guix download)
+ #:use-module (guix svn-download)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix packages)
#:use-module (guix utils)
- #:use-module (srfi srfi-1))
+ #:use-module (srfi srfi-1)
+ #:use-module (ice-9 match))
(define-public cups-filters
(package
(name "cups-filters")
- (version "1.21.5")
+ (version "1.25.1")
(source(origin
(method url-fetch)
(uri
"cups-filters-" version ".tar.xz"))
(sha256
(base32
- "0azq9j7kqy18g6vgmvrbw8i4mcqdp3cbgh7q79x1b8p92w4si6rq"))
+ "0nlq44jnjcnrbdv0dv5myg5kaycmk6a4klynpvj65xvn3l9cq28s"))
(modules '((guix build utils)))
(snippet
;; install backends, banners and filters to cups-filters output
(("/usr/local/lib/cups/filter")
(string-append out "/lib/cups/filter")))
#t)))
+ (add-after 'unpack 'patch-for-poppler
+ (lambda _
+ (substitute* "filter/pdf.cxx"
+ (("GooString \\*field_name;" m)
+ (string-append "const " m)))
+ #t))
(add-after 'install 'wrap-filters
(lambda* (#:key inputs outputs #:allow-other-keys)
;; Some filters expect to find 'gs' in $PATH. We cannot
(define-public cups-minimal
(package
(name "cups-minimal")
- (version "2.2.10")
+ (version "2.2.11")
(source
(origin
(method url-fetch)
version "/cups-" version "-source.tar.gz"))
(sha256
(base32
- "1fq52aw1mini3ld2czv5gg37wbbvh4n7yc7wzzxvbs3zpfrv5j3p"))))
+ "0v5p10lyv8wv48s8ghkhjmdrxg6iwj8hn36v1ilkz46n7y0i107m"))))
(build-system gnu-build-system)
(arguments
`(#:configure-flags
("cups-filters" ,cups-filters)
("zlib" ,zlib)))))
+(define-public cups-pk-helper
+ (package
+ (name "cups-pk-helper")
+ (version "0.2.6")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://freedesktop.org/software/"
+ name "/releases/" name "-" version ".tar.xz"))
+ (sha256
+ (base32
+ "0a52jw6rm7lr5nbyksiia0rn7sasyb5cjqcb95z1wxm2yprgi6lm"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("intltool" ,intltool)
+ ("pkg-config" ,pkg-config)
+ ("glib" ,glib)
+ ("polkit" ,polkit)
+ ("cups" ,cups)))
+ (home-page "https://www.freedesktop.org/wiki/Software/cups-pk-helper/")
+ (synopsis "PolicyKit helper to configure CUPS with fine-grained privileges")
+ (description
+ "This package provides the org.opensuse.CupsPkHelper.Mechanism DBus
+system service which uses @file{cups-pk-helper-mechanism}. This package
+should only be used as part of the Guix cups-pk-helper service.")
+ (license license:gpl2+)))
+
(define-public hplip
(package
(name "hplip")
- (version "3.18.9")
+ (version "3.19.11")
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/hplip/hplip/" version
"/hplip-" version ".tar.gz"))
(sha256
(base32
- "0g3q5mm2crjyc1z4z6gv4lam6sc5d3diz704djrnpqadk4q3h290"))
+ "0lfmym225dr4qnssglqd0gyf0nmm7jpbzkdr1s2wyknmx8z7fx9x"))
(modules '((guix build utils)))
(patches (search-patches "hplip-remove-imageprocessor.patch"))
(snippet
'(begin
- ;; Delete non-free blobs
- (for-each delete-file (find-files "." "\\.so$"))
+ ;; Delete non-free blobs: .so files, pre-compiled
+ ;; 'locatedriver' executable, etc.
+ (for-each delete-file
+ (find-files "."
+ (lambda (file stat)
+ (elf-file? file))))
(delete-file "prnt/hpcups/ImageProcessor.h")
- ;; Fix type mismatch.
- (substitute* "prnt/hpcups/genPCLm.cpp"
- (("boolean") "bool"))
+
+ ;; Install binaries under libexec/hplip instead of
+ ;; share/hplip; that'll at least ensure they get stripped.
+ ;; It's not even clear that they're of any use though...
+ (substitute* "Makefile.in"
+ (("^dat2drvdir =.*")
+ "dat2drvdir = $(pkglibexecdir)\n")
+ (("^locatedriverdir =.*")
+ "locatedriverdir = $(pkglibexecdir)\n"))
#t))))
(build-system gnu-build-system)
(home-page "https://developers.hp.com/hp-linux-imaging-and-printing")
(arguments
(substitute-keyword-arguments (package-arguments hplip)
((#:configure-flags cf)
- `(delete "--enable-qt5" ,cf))))
- (inputs
- (fold alist-delete (package-inputs hplip)
- '("python-pygobject" "python-pyqt")))
+ ;; Produce a "light build", meaning that only the printer (CUPS) and
+ ;; scanner (SANE) support gets built, without all the 'hp-*'
+ ;; command-line tools.
+ `(cons "--enable-lite-build"
+ (delete "--enable-qt5" ,cf)))
+ ((#:phases phases)
+ ;; The 'wrap-binaries' is not needed here since the 'hp-*' programs
+ ;; are not installed.
+ `(alist-delete 'wrap-binaries ,phases))))
+ (inputs (remove (match-lambda
+ ((label . _)
+ (string-prefix? "python" label)))
+ (package-inputs hplip)))
(synopsis "GUI-less version of hplip")))
(define-public foomatic-filters
(method url-fetch)
(uri (string-append
"http://www.openprinting.org/download/foomatic/"
- name "-" version ".tar.gz"))
+ "foomatic-filters-" version ".tar.gz"))
(sha256
(base32
"1qrkgbm5jay2r7sh9qbyf0aiyrsl1mdc844hxf7fhw95a0zfbqm2"))
(define-public foo2zjs
(package
(name "foo2zjs")
- (version "20180910")
+ (version "20190909")
(source (origin
(method url-fetch)
;; XXX: This is an unversioned URL!
(uri "http://foo2zjs.rkkda.com/foo2zjs.tar.gz")
(sha256
(base32
- "1clddqy4y4vvws0lllv1v90dfiihihdc23bn93c544yb3fvmwmr6"))))
+ "1nn84c045mbv6yzpjfggc6152bvgrmcxiyvgz9v2w3sws7ihshrm"))))
(build-system gnu-build-system)
(arguments
'(#:phases (modify-phases %standard-phases
language.")
(home-page "http://download.ebz.epson.net/dsc/search/01/search")
(license license:gpl2+)))
+
+(define-public splix
+ ;; The last release was in 2009. The SVN repository contains 5 years of
+ ;; unreleased bug fixes and support for newer printer models.
+ (let ((revision 315))
+ (package
+ (name "splix")
+ (version (string-append "2.0.0-" (number->string revision)))
+ (source
+ (origin
+ (method svn-fetch)
+ (uri (svn-reference
+ (url "https://svn.code.sf.net/p/splix/code/splix/")
+ (revision revision)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32 "16wbm4xnz35ca3mw2iggf5f4jaxpyna718ia190ka6y4ah932jxl"))))
+ (build-system gnu-build-system)
+ ;; 90% (3.8 MiB) of output are .ppd files. Don't install them by default:
+ ;; CUPS has been able to read the .drv sources directly since version 1.2.
+ (outputs (list "out" "ppd"))
+ (arguments
+ '(#:make-flags
+ (list (string-append "CUPSDRV="
+ (assoc-ref %outputs "out") "/share/cups/drv")
+ (string-append "CUPSFILTER="
+ (assoc-ref %outputs "out") "/lib/cups/filter")
+ (string-append "CUPSPPD="
+ (assoc-ref %outputs "ppd") "/share/cups/model")
+ "CACHESIZE=100" ; pages in RAM, ±300 KiB each
+ "THREADS=4") ; compress and print faster
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ; no configure script
+ (add-before 'build 'build-.drv-files
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (apply invoke "make" "drv" make-flags)))
+ (add-after 'install 'install-.drv-files
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (apply invoke "make" "install" "DRV_ONLY=1" make-flags))))
+ #:tests? #f)) ; no test suite
+ (inputs
+ `(("cups" ,cups-minimal)
+ ("zlib" ,zlib)
+
+ ;; This dependency can be dropped by setting DISABLE_JBIG=1, but the
+ ;; result will not support some printers like the Samsung CLP-600.
+ ("jbigkit" ,jbigkit)))
+ (synopsis "QPDL (SPL2) printer driver")
+ (description
+ "SpliX is a set of CUPS drivers for printers that speak @acronym{QPDL,
+Quick Page Description Language}, also called @acronym{SPL2, Samsung Printer
+Language version 2}. These include many laser printers sold by Samsung,
+Xerox, Lexmark, Toshiba, and Dell.
+
+Colour printers need colour profile files to get better results. These
+@file{cms} files are provided by the printer's manufacturer and must be
+obtained and installed separately.")
+ (home-page "http://splix.ap2c.org/")
+ (license license:gpl2))))
+
+(define-public python-pycups
+ (package
+ (name "python-pycups")
+ (version "1.9.74")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "pycups" version ".tar.bz2"))
+ (sha256
+ (base32
+ "1ffp7sswhdsfpy88zg0cc8kl04wygkjs01rlm9f0spbwk8jhy2c6"))))
+ (build-system python-build-system)
+ (arguments
+ '(;; Tests require CUPS to be running
+ #:tests? #f))
+ (inputs
+ `(("cups" ,cups)))
+ (home-page "https://github.com/zdohnal/pycups")
+ (synopsis "Python bindings for libcups")
+ (description
+ "This package provides Python bindings for libcups, wrapping the CUPS
+API.")
+ (license license:gpl2+)))