Subject: [PATCH v2] gnu: Add gutenprint.

From: John Doe <[email-masked]>
Date: Fri, 8 Jan 2021 12:51:34 +0100

* gnu/packages/cups.scm (gutenprint): New variable.
---
Remove unused gettext use statement. 

 gnu/packages/cups.scm | 44 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm
index c8ca5db1a0..1fadb0de78 100644
--- a/gnu/packages/cups.scm
+++ b/gnu/packages/cups.scm
@@ -46,6 +46,7 @@
   #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages qt)
   #:use-module (gnu packages scanner)
+  #:use-module (gnu packages time)
   #:use-module (gnu packages tls)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
@@ -921,6 +922,49 @@ obtained and installed separately.")
       (home-page "http://splix.ap2c.org/")
       (license license:gpl2))))
 
+(define-public gutenprint
+  (package
+    (name "gutenprint")
+    (version "5.3.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "mirror://sourceforge/gimp-print/" name "-"
+                           (version-major+minor version) "/" version "/"
+                           name "-" version ".tar.xz"))
+       (sha256
+        (base32 "0wm0akfm0dp0wrwnn03j90hqxs8vx8iy896baf68blb7isyfqybj"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:test-target "check-parallel"
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'configure 'fix-paths
+           (lambda* (#:key outputs native-inputs #:allow-other-keys)
+             (substitute* "Makefile.in"
+               (("/usr/bin/time") "time"))
+             (let ((out (assoc-ref outputs "out")))
+               (substitute* "src/cups/Makefile.in"
+                 (("cups_conf_serverbin = @cups_conf_serverbin@")
+                  (string-append "cups_conf_serverbin = " out "/lib/cups"))
+                 (("cups_conf_serverroot = @cups_conf_serverroot@")
+                  (string-append "cups_conf_serverroot = " out "/etc/cups"))
+                 (("cups_conf_datadir = @cups_conf_datadir@")
+                  (string-append "cups_conf_datadir = " out "/share/cups")))
+               #t))))))
+    (native-inputs
+     `(("perl" ,perl)
+       ("time" ,time)))
+    (inputs
+     `(("cups" ,cups-minimal)))
+    (synopsis "Printer drivers for CUPS on GNU/Linux")
+    (description "A very high quality package of printer drivers for
+CUPS on GNU/Linux, Macintosh OS X, and other POSIX-compliant operating systems.
+This project also maintains an enhanced Print plug-in for GIMP 2.x from
+the same code base.")
+    (home-page "http://gimp-print.sourceforge.net/")
+    (license license:gpl2+)))
+
 (define-public python-pycups
   (package
     (name "python-pycups")
-- 
2.30.0