diff mbox series

[bug#45725] gnu: Add gutenprint.

Message ID 20210108113822.24978-1-dftxbs3e@free.fr
State New
Headers show
Series [bug#45725] gnu: Add gutenprint. | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

dftxbs3e Jan. 8, 2021, 11:38 a.m. UTC
* gnu/packages/cups.scm (gutenprint): New variable.
---
 gnu/packages/cups.scm | 45 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

Comments

dftxbs3e Jan. 8, 2021, 12:09 p.m. UTC | #1
There's still runtime errors related to cups not being able to open
PPDs, so don't merge as-is. I am still working on it.
Faré Aug. 13, 2021, 8:03 p.m. UTC | #2
Hi. I'm new to Guix and would like to see if Gutenprint will allow me
to print on a Brother MFC-9970CDW without a proprietary driver.

What's left to do to complete the current patch? Can I help? Is there
a git repository and branch somewhere with the latest version of this
patch? Is it just package documentation at this point, or are there
remaining issues with e.g. paths?
Faré Aug. 13, 2021, 9:38 p.m. UTC | #3
For the path issue, I'm not sure how you get CUPS to see the PPDs you
want, but once it does, the remaining issue should be to rewrite some
entries in the PPD to have a full path, most importantly the
cupsFilter entries, but in the PPD from macOS there were also other
entries with paths, that may or may not apply (except maybe the last
one?):
*APDialogExtension:
*APPrinterIconPath:
*APPrinterUtilityPath:
*APPrinterLowInkTool:
*APHelpBook:
*cupsICCProfile:

Note that the NixOS recipe creates a cups-progs derivation output that
has all the ppds and all the filter binaries (themselves symlinks to
the respective derivation outputs); then it symlinks that cups-progs
output to /var/lib/cups/path and configures to look for data and
binaries there, so it doesn't have to modify any PPD.
Faré Aug. 14, 2021, 3:34 a.m. UTC | #4
As for how Guix does it, it looks like the cups-server-bin output is
created in gnu/services/cups.scm based on the union of the extensions
listed in the configuration for lib/cups, share/ppd and share/cups,
and that you would put the filter programs in the lib/cups of your
package and the ppd in the share/ppd/ (though I see some ppd.gz under
share/cups/model/), and some .drv in share/cups/drv/.
Milan Svoboda April 30, 2022, 11:21 a.m. UTC | #5
Hello Brice,


I tried your recipe and I confirm it works. Cups can see it and use it.


I have two problems:


1) It doesn't work with my (supported) printer. I can see this error in 
dmesg when I try to print with it:

[12788.877547] traps: gutenprint.5.3[12432] general protection fault 
ip:7f6f7411b2b6 sp:7fffc79555e0 error:0 in libc-2.33.so[7f6f740c7000+141000]


2) Adding the printer it shows me two possible drivers:


Canon MP240 series - CUPS+Gutenprint v5.3.4 (en)

Canon MP240 series - CUPS+Gutenprint v5.3.4 (en, ca, cs, da, de, el, ...)


When I select the first, CUPS complains that it is 'Unable to copy PPD 
file'.

When I select the second, CUPS uses it and it seems working (except the 
issue #1).


I'll try older version, maybe that make difference in problem #1.


Milan
Milan Svoboda April 30, 2022, 3:09 p.m. UTC | #6
Older nor newer version doesn't help.
diff mbox series

Patch

diff --git a/gnu/packages/cups.scm b/gnu/packages/cups.scm
index c8ca5db1a0..12a5d05857 100644
--- a/gnu/packages/cups.scm
+++ b/gnu/packages/cups.scm
@@ -32,6 +32,7 @@ 
   #:use-module (gnu packages compression)
   #:use-module (gnu packages fonts)     ; font-dejavu
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages groff)
@@ -46,6 +47,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 +923,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")