gnu: hplip: Add Qt GUI support.
[jackhill/guix/guix.git] / gnu / packages / cups.scm
index 13a8f1f..2fedd3a 100644 (file)
@@ -5,7 +5,7 @@
 ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org>
 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2017 Mark H Weaver <mhw@netris.org>
-;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2017, 2018 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages cups)
-  #:use-module ((guix licenses) #:prefix license:)
-  #:use-module (guix packages)
-  #:use-module (guix download)
-  #:use-module (guix build-system gnu)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages fonts)     ; font-dejavu
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages glib)
   #:use-module (gnu packages groff)
+  #:use-module (gnu packages image)
   #:use-module (gnu packages libusb)
+  #:use-module (gnu packages pdf)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pretty-print)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
   #:use-module (gnu packages scanner)
-  #:use-module (gnu packages image)
-  #:use-module (gnu packages fonts) ;font-dejavu
-  #:use-module (gnu packages fontutils)
-  #:use-module (gnu packages ghostscript)
-  #:use-module (gnu packages glib)
-  #:use-module (gnu packages pdf)
-  #:use-module (gnu packages pkg-config)
-  #:use-module (gnu packages tls))
+  #:use-module (gnu packages tls)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix download)
+  #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix packages))
 
 (define-public cups-filters
   (package
     (name "cups-filters")
-    (version "1.17.7")
+    (version "1.20.1")
     (source(origin
               (method url-fetch)
               (uri
@@ -58,7 +59,7 @@
                               "cups-filters-" version ".tar.xz"))
               (sha256
                (base32
-                "1mg397kgfx0rs9j852f8ppmvaz2al5l75ildbgiqg6j3gwq5jssw"))
+                "0qix1whz5n4ijnl6d44f1v8nzkpv99wqjyrby8vx6xnpskw5hsxk"))
               (modules '((guix build utils)))
               (snippet
                ;; install backends, banners and filters to cups-filters output
@@ -79,7 +80,8 @@
                   ;; output directory, not CUPS's prefix.
                   (substitute* "configure"
                     (("\\{CUPS_DATADIR\\}/data")
-                     "{prefix}/share/cups/data"))))))
+                     "{prefix}/share/cups/data"))
+                  #t))))
     (build-system gnu-build-system)
     (arguments
      `(#:make-flags (list (string-append "PREFIX=" %output))
@@ -172,7 +174,7 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.")
 (define-public cups-minimal
   (package
     (name "cups-minimal")
-    (version "2.2.4")
+    (version "2.2.6")
     (source
      (origin
        (method url-fetch)
@@ -180,7 +182,7 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.")
                            version "/cups-" version "-source.tar.gz"))
        (sha256
         (base32
-         "1k4qxafmapq6hzbkh273fdyzkj9alw6ppwz5k933bhsi4svlsvar"))))
+         "16qn41b84xz6khrr2pa2wdwlqxr29rrrkjfi618gbgdkq9w5ff20"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags
@@ -197,7 +199,8 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.")
            (lambda _
              (substitute* "Makedefs.in"
                (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
-               (("/bin/sh") (which "sh")))))
+               (("/bin/sh") (which "sh")))
+             #t))
          ;; Make the compressed manpages writable so that the
          ;; reset-gzip-timestamps phase does not error out.
          (add-before 'reset-gzip-timestamps 'make-manpages-writable
@@ -205,12 +208,14 @@ filters for the PDF-centric printing workflow introduced by OpenPrinting.")
              (let* ((out (assoc-ref outputs "out"))
                     (man (string-append out "/share/man")))
                (for-each (lambda (file) (chmod file #o644))
-                         (find-files man "\\.gz")))))
+                         (find-files man "\\.gz"))
+               #t)))
          (add-before 'build 'patch-tests
            (lambda _
              (substitute* "test/ippserver.c"
                (("#  else /\\* HAVE_AVAHI \\*/")
-                "#elif defined(HAVE_AVAHI)")))))))
+                "#elif defined(HAVE_AVAHI)"))
+             #t)))))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (inputs
@@ -248,7 +253,8 @@ device-specific programs to convert and print many types of files.")
            (lambda _
              (substitute* "Makedefs.in"
                (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@")
-               (("/bin/sh") (which "sh")))))
+               (("/bin/sh") (which "sh")))
+             #t))
          (add-before 'check 'patch-tests
            (lambda _
              (let ((filters (assoc-ref %build-inputs "cups-filters"))
@@ -306,7 +312,8 @@ device-specific programs to convert and print many types of files.")
                  (("cupsFileFind\\(\"cat\", \"/bin\"")
                   (string-append "cupsFileFind(\"cat\", \"" catpath "\""))
                  (("cupsFileFind\\(\"cat\", \"/bin:/usr/bin\"")
-                  (string-append "cupsFileFind(\"cat\", \"" catpath "\""))))))
+                  (string-append "cupsFileFind(\"cat\", \"" catpath "\"")))
+               #t)))
          ;; Make the compressed manpages writable so that the
          ;; reset-gzip-timestamps phase does not error out.
          (add-before 'reset-gzip-timestamps 'make-manpages-writable
@@ -314,7 +321,8 @@ device-specific programs to convert and print many types of files.")
              (let* ((out (assoc-ref outputs "out"))
                     (man (string-append out "/share/man")))
                (for-each (lambda (file) (chmod file #o644))
-                         (find-files man "\\.gz")))))
+                         (find-files man "\\.gz"))
+               #t)))
          (add-after 'install 'install-cups-filters-symlinks
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (let ((out (assoc-ref outputs "out"))
@@ -360,7 +368,9 @@ device-specific programs to convert and print many types of files.")
                (let ((data "/share/cups/data"))
                  (delete-file-recursively (string-append out data))
                  (symlink (string-append cups-filters data)
-                          (string-append out data)))))))))
+                          (string-append out data)))
+
+               #t))))))
     (inputs
      `(("avahi" ,avahi)
        ("gnutls" ,gnutls)
@@ -370,19 +380,21 @@ device-specific programs to convert and print many types of files.")
 (define-public hplip
   (package
     (name "hplip")
-    (version "3.17.11")
+    (version "3.18.6")
     (source (origin
               (method url-fetch)
               (uri (string-append "mirror://sourceforge/hplip/hplip/" version
                                   "/hplip-" version ".tar.gz"))
               (sha256
                (base32
-                "0xda7x7xxjvzn1l0adlvbwcw21crq1r3r79bkf94q3m5i6abx49g"))
+                "0zbv6cp9n3xypf2fg4j6fpz8zkvl0z08lyc1vq1gd04ln1l3xkqf"))
               (modules '((guix build utils)))
               (snippet
                ;; Fix type mismatch.
-               '(substitute* "prnt/hpcups/genPCLm.cpp"
-                  (("boolean") "bool")))))
+               '(begin
+                  (substitute* "prnt/hpcups/genPCLm.cpp"
+                    (("boolean") "bool"))
+                  #t))))
     (build-system gnu-build-system)
     (home-page "http://hplipopensource.com/")
     (synopsis "HP Printer Drivers")
@@ -413,7 +425,8 @@ device-specific programs to convert and print many types of files.")
          ,(string-append "--with-icondir="
                          (assoc-ref %outputs "out") "/share/applications")
          ,(string-append "--with-systraydir="
-                         (assoc-ref %outputs "out") "/etc/xdg"))
+                         (assoc-ref %outputs "out") "/etc/xdg")
+         "--enable-qt5" "--disable-qt4")
 
        #:imported-modules ((guix build python-build-system)
                            ,@%gnu-build-system-modules)
@@ -452,7 +465,7 @@ device-specific programs to convert and print many types of files.")
                            (string-append "hplip_confdir = " out
                                           "/etc/hp"))
                           (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor")
-                           ;; Note: We don't use hal.
+                           ;; We don't use hal.
                            (string-append "halpredir = " out
                                           "/share/hal/fdi/preprobe/10osvendor"))
                           (("rulesdir = /etc/udev/rules.d")
@@ -466,23 +479,30 @@ device-specific programs to convert and print many types of files.")
                           (("/etc/sane.d")
                            (string-append out "/etc/sane.d"))))))
 
-                  ;; Wrap bin/* so that the Python libs are found.
+                  ;; Wrap bin/* so that the Python libraries are found.
                   (add-after 'install 'wrap-binaries
                     (assoc-ref python:%standard-phases 'wrap)))))
 
-    ;; Python3 support is available starting from hplip@3.15.2.
-    (inputs `(("libjpeg" ,libjpeg)
-              ("cups-minimal" ,cups-minimal)
-              ("libusb" ,libusb)
-              ("sane-backends" ,sane-backends-minimal)
-              ("zlib" ,zlib)
-              ("dbus" ,dbus)
-              ("python-wrapper" ,python-wrapper)
-              ("python" ,python)
-              ;; TODO: Make hp-setup find python-dbus.
-              ("python-dbus" ,python-dbus)))
-    (native-inputs `(("pkg-config" ,pkg-config)
-                     ("perl" ,perl)))))
+    ;; Note that the error messages printed by the tools in the case of
+    ;; missing dependencies are often downright misleading.
+    ;; TODO: hp-toolbox still fails to start with:
+    ;;   from dbus.mainloop.pyqt5 import DBusQtMainLoop
+    ;;   ModuleNotFoundError: No module named 'dbus.mainloop.pyqt5'
+    (inputs
+     `(("cups-minimal" ,cups-minimal)
+       ("dbus" ,dbus)
+       ("libjpeg" ,libjpeg)
+       ("libusb" ,libusb)
+       ("python" ,python)
+       ("python-dbus" ,python-dbus)
+       ("python-pygobject" ,python-pygobject)
+       ("python-pyqt" ,python-pyqt)
+       ("python-wrapper" ,python-wrapper)
+       ("sane-backends" ,sane-backends-minimal)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("perl" ,perl)
+       ("pkg-config" ,pkg-config)))))
 
 (define-public foomatic-filters
   (package
@@ -537,14 +557,14 @@ printer/driver specific, but spooler-independent PPD file.")
 (define-public foo2zjs
   (package
     (name "foo2zjs")
-    (version "201709")
+    (version "20171202")
     (source (origin
               (method url-fetch)
               ;; XXX: This is an unversioned URL!
               (uri "http://foo2zjs.rkkda.com/foo2zjs.tar.gz")
               (sha256
                (base32
-                "0amjj3jr6s6h7crzxyx11v31sj0blz7k5c2vycz4gn8cxlmk3c7w"))))
+                "10m1ksbzqsrsl4faqyl73ahfnj2hv1y3zrmr366zvjg7w3l6ag5n"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases (modify-phases %standard-phases
@@ -605,7 +625,7 @@ HP@tie{}LaserJet, and possibly other printers.  See @file{README} for details.")
 (define-public escpr
   (package
     (name "escpr")
-    (version "1.6.17")
+    (version "1.6.20")
     ;; 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
@@ -613,12 +633,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/06/66/09/"
-                                  "4ac2bf69bb1ddf4a9ad525596615cbb40fe4dad5/"
-                                  "epson-inkjet-printer-escpr-1.6.17-1lsb3.2.tar.gz"))
+              (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"))
               (sha256
                (base32
-                "0m6v1wdavw4r25jfywqchsx0v9ss1l5fr8vq9d0d8cmjnz8mqblv"))))
+                "19800pl7kbbgdzbsy9ijmd7dm3ly4kr2h1dxypqpd075g6n0i770"))))
     (build-system gnu-build-system)
     (arguments
      `(#:configure-flags