gnu: Add ocaml-markup.
[jackhill/guix/guix.git] / gnu / packages / cups.scm
index c2c1a01..748f67b 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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>
   #: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 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.20.4")
+    (version "1.22.3")
     (source(origin
               (method url-fetch)
               (uri
@@ -61,7 +65,7 @@
                               "cups-filters-" version ".tar.xz"))
               (sha256
                (base32
-                "0sjkmclcb1r77015wllsyz26272br3s17v6b1q2xwb2nm2gnwx9k"))
+                "11vilv80l3q7hz8vyhclvjcnlgk93r7p9dvg634186iddjzls0j3"))
               (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
@@ -176,7 +186,7 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.")
 (define-public cups-minimal
   (package
     (name "cups-minimal")
-    (version "2.2.8")
+    (version "2.2.11")
     (source
      (origin
        (method url-fetch)
@@ -184,7 +194,7 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.")
                            version "/cups-" version "-source.tar.gz"))
        (sha256
         (base32
-         "1r7r7b3nqpzc1a9dczqpj2mr8rkcwf01676v11sp4j7w4qfzqs1r"))))
+         "0v5p10lyv8wv48s8ghkhjmdrxg6iwj8hn36v1ilkz46n7y0i107m"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
@@ -379,26 +389,70 @@ device-specific programs to convert and print many types of files.")
        ("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.6")
+    (version "3.18.9")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/hplip/hplip/" version
                                   "/hplip-" version ".tar.gz"))
               (sha256
                (base32
-                "0zbv6cp9n3xypf2fg4j6fpz8zkvl0z08lyc1vq1gd04ln1l3xkqf"))
+                "0g3q5mm2crjyc1z4z6gv4lam6sc5d3diz704djrnpqadk4q3h290"))
               (modules '((guix build utils)))
+              (patches (search-patches "hplip-remove-imageprocessor.patch"))
               (snippet
-               ;; Fix type mismatch.
                '(begin
+                  ;; 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 "http://hplipopensource.com/")
+    (home-page "https://developers.hp.com/hp-linux-imaging-and-printing")
     (synopsis "HP printer drivers")
     (description
      "Hewlett-Packard printer drivers and PostScript Printer Descriptions
@@ -414,6 +468,8 @@ device-specific programs to convert and print many types of files.")
        `("--disable-network-build"
          ,(string-append "--prefix=" (assoc-ref %outputs "out"))
          ,(string-append "--sysconfdir=" (assoc-ref %outputs "out") "/etc")
+         ,(string-append "LDFLAGS=-Wl,-rpath="
+                         (assoc-ref %outputs "out") "/lib")
          ;; Disable until mime.types merging works (FIXME).
          "--disable-fax-build"
          "--enable-hpcups-install"
@@ -515,10 +571,19 @@ device-specific programs to convert and print many types of files.")
     (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
@@ -574,14 +639,14 @@ printer/driver specific, but spooler-independent PPD file.")
 (define-public foo2zjs
   (package
     (name "foo2zjs")
-    (version "20171202")
+    (version "20190413")
     (source (origin
               (method url-fetch)
               ;; XXX: This is an unversioned URL!
               (uri "http://foo2zjs.rkkda.com/foo2zjs.tar.gz")
               (sha256
                (base32
-                "10m1ksbzqsrsl4faqyl73ahfnj2hv1y3zrmr366zvjg7w3l6ag5n"))))
+                "00k22vmghxls7rk2hrbz9v17wi5z8vdk3fmsp2lrfghfcad8nhpx"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases (modify-phases %standard-phases
@@ -642,7 +707,7 @@ HP@tie{}LaserJet, and possibly other printers.  See @file{README} for details.")
 (define-public escpr
   (package
     (name "escpr")
-    (version "1.6.20")
+    (version "1.6.30")
     ;; XXX: This currently works.  But it will break as soon as a newer
     ;; version is available since the URLs for older versions are not
     ;; preserved.  An alternative source will be added as soon as
@@ -650,12 +715,12 @@ HP@tie{}LaserJet, and possibly other printers.  See @file{README} for details.")
     (source (origin
               (method url-fetch)
               ;; The uri has to be chopped up in order to satisfy guix lint.
-              (uri (string-append "https://download3.ebz.epson.net/dsc/f/03/00/07/16/23/"
-                                  "804253d188a31ae6a0f2722648248ef952afedfb/"
-                                  "epson-inkjet-printer-escpr-1.6.20-1lsb3.2.tar.gz"))
+              (uri (string-append "https://download3.ebz.epson.net/dsc/f/03/00/08/18/20/"
+                                  "e94de600e28e510c1cfa158929d8b2c0aadc8aa0/"
+                                  "epson-inkjet-printer-escpr-1.6.30-1lsb3.2.tar.gz"))
               (sha256
                (base32
-                "19800pl7kbbgdzbsy9ijmd7dm3ly4kr2h1dxypqpd075g6n0i770"))))
+                "0m8pyfkixisp0vclwxj340isn15zzisal0v2xvv66kxfd68dzf12"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
@@ -674,3 +739,27 @@ printers.  It can only be used with printers that support the Epson ESC/P-R
 language.")
     (home-page "http://download.ebz.epson.net/dsc/search/01/search")
     (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+)))