Commit | Line | Data |
---|---|---|
51002318 RW |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> | |
1728c411 | 3 | ;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org> |
68eca623 | 4 | ;;; Copyright © 2015, 2016, 2017 Efraim Flashner <efraim@flashner.co.il> |
2b56dc01 | 5 | ;;; Copyright © 2016 Danny Milosavljevic <dannym@scratchpost.org> |
8afabb2e | 6 | ;;; Copyright © 2017 Leo Famulari <leo@famulari.name> |
7020a6ab | 7 | ;;; Copyright © 2017 Mark H Weaver <mhw@netris.org> |
51002318 RW |
8 | ;;; |
9 | ;;; This file is part of GNU Guix. | |
10 | ;;; | |
11 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
12 | ;;; under the terms of the GNU General Public License as published by | |
13 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
14 | ;;; your option) any later version. | |
15 | ;;; | |
16 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
17 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;;; GNU General Public License for more details. | |
20 | ;;; | |
21 | ;;; You should have received a copy of the GNU General Public License | |
22 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
23 | ||
24 | (define-module (gnu packages cups) | |
25 | #:use-module ((guix licenses) #:prefix license:) | |
26 | #:use-module (guix packages) | |
27 | #:use-module (guix download) | |
28 | #:use-module (guix build-system gnu) | |
29 | #:use-module (gnu packages) | |
d02aabaf LC |
30 | #:use-module (gnu packages algebra) |
31 | #:use-module (gnu packages autotools) | |
51002318 RW |
32 | #:use-module (gnu packages avahi) |
33 | #:use-module (gnu packages compression) | |
d02aabaf | 34 | #:use-module (gnu packages groff) |
2b56dc01 | 35 | #:use-module (gnu packages libusb) |
d02aabaf LC |
36 | #:use-module (gnu packages perl) |
37 | #:use-module (gnu packages pretty-print) | |
2b56dc01 DM |
38 | #:use-module (gnu packages python) |
39 | #:use-module (gnu packages scanner) | |
51002318 RW |
40 | #:use-module (gnu packages image) |
41 | #:use-module (gnu packages fonts) ;font-dejavu | |
42 | #:use-module (gnu packages fontutils) | |
43 | #:use-module (gnu packages ghostscript) | |
44 | #:use-module (gnu packages glib) | |
51002318 | 45 | #:use-module (gnu packages pdf) |
a7fd7b68 AE |
46 | #:use-module (gnu packages pkg-config) |
47 | #:use-module (gnu packages tls)) | |
51002318 RW |
48 | |
49 | (define-public cups-filters | |
50 | (package | |
51 | (name "cups-filters") | |
3d695e6a | 52 | (version "1.17.7") |
4ab016e0 | 53 | (source(origin |
51002318 RW |
54 | (method url-fetch) |
55 | (uri | |
96b44a94 | 56 | (string-append "https://openprinting.org/download/cups-filters/" |
51002318 RW |
57 | "cups-filters-" version ".tar.xz")) |
58 | (sha256 | |
59 | (base32 | |
3d695e6a | 60 | "1mg397kgfx0rs9j852f8ppmvaz2al5l75ildbgiqg6j3gwq5jssw")) |
51002318 RW |
61 | (modules '((guix build utils))) |
62 | (snippet | |
63 | ;; install backends, banners and filters to cups-filters output | |
64 | ;; directory, not the cups server directory | |
085cca5b AW |
65 | '(begin |
66 | (substitute* "Makefile.in" | |
67 | (("CUPS_DATADIR = @CUPS_DATADIR@") | |
68 | "CUPS_DATADIR = $(PREFIX)/share/cups") | |
69 | (("pkgcupsserverrootdir = \\$\\(CUPS_SERVERROOT\\)") | |
70 | "pkgcupsserverrootdir = $(PREFIX)") | |
71 | ;; Choose standard directories notably so that binaries are | |
72 | ;; stripped. | |
73 | (("pkgbackenddir = \\$\\(CUPS_SERVERBIN\\)/backend") | |
74 | "pkgbackenddir = $(PREFIX)/lib/cups/backend") | |
75 | (("pkgfilterdir = \\$\\(CUPS_SERVERBIN\\)/filter") | |
76 | "pkgfilterdir = $(PREFIX)/lib/cups/filter")) | |
77 | ;; Find bannertopdf data such as the print test page in our | |
78 | ;; output directory, not CUPS's prefix. | |
79 | (substitute* "configure" | |
80 | (("\\{CUPS_DATADIR\\}/data") | |
81 | "{prefix}/share/cups/data")))))) | |
51002318 RW |
82 | (build-system gnu-build-system) |
83 | (arguments | |
84 | `(#:make-flags (list (string-append "PREFIX=" %output)) | |
85 | #:configure-flags | |
f8489f16 | 86 | `("--disable-driverless" ; TODO: enable this |
79e90f05 | 87 | "--disable-mutool" ; depends on yet another PDF library (mupdf) |
b2639670 LC |
88 | |
89 | ;; Look for the "domain socket of CUPS" in /var/run/cups. | |
90 | "--localstatedir=/var" | |
91 | ||
f40aef6b LC |
92 | ;; Free software for the win. |
93 | "--with-acroread-path=evince" | |
94 | ||
f8489f16 | 95 | ,(string-append "--with-test-font-path=" |
51002318 RW |
96 | (assoc-ref %build-inputs "font-dejavu") |
97 | "/share/fonts/truetype/DejaVuSans.ttf") | |
95264cc6 AW |
98 | ,(string-append "--with-gs-path=" |
99 | (assoc-ref %build-inputs "ghostscript") | |
100 | "/bin/gsc") | |
f8489f16 EF |
101 | ,(string-append "--with-shell=" |
102 | (assoc-ref %build-inputs "bash") | |
103 | "/bin/bash") | |
51002318 | 104 | ,(string-append "--with-rcdir=" |
1728c411 LC |
105 | (assoc-ref %outputs "out") "/etc/rc.d")) |
106 | ||
107 | #:phases (modify-phases %standard-phases | |
108 | (add-after 'unpack 'patch-foomatic-hardcoded-file-names | |
109 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
110 | ;; Foomatic has hardcoded file names we need to fix. | |
111 | (let ((out (assoc-ref outputs "out")) | |
112 | (gs (assoc-ref inputs "ghostscript"))) | |
113 | (substitute* "filter/foomatic-rip/foomaticrip.c" | |
114 | (("/usr/local/lib/cups/filter") | |
115 | (string-append out "/lib/cups/filter"))) | |
116 | #t))) | |
117 | (add-after 'install 'wrap-filters | |
118 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
119 | ;; Some filters expect to find 'gs' in $PATH. We cannot | |
120 | ;; just hard-code its absolute file name in the source | |
121 | ;; because foomatic-rip, for example, has tests like | |
122 | ;; 'startswith(cmd, "gs")'. | |
123 | (let ((out (assoc-ref outputs "out")) | |
124 | (ghostscript (assoc-ref inputs "ghostscript"))) | |
125 | (for-each (lambda (file) | |
126 | (wrap-program file | |
127 | `("PATH" ":" prefix | |
128 | (,(string-append ghostscript | |
129 | "/bin"))))) | |
130 | (find-files (string-append | |
131 | out "/lib/cups/filter"))) | |
132 | #t)))))) | |
51002318 | 133 | (native-inputs |
b76b1dcb AE |
134 | `(("glib" ,glib "bin") ; for gdbus-codegen |
135 | ("pkg-config" ,pkg-config))) | |
51002318 | 136 | (inputs |
7e214019 EF |
137 | `(("avahi" ,avahi) |
138 | ("fontconfig" ,fontconfig) | |
51002318 | 139 | ("freetype" ,freetype) |
f8489f16 | 140 | ("font-dejavu" ,font-dejavu) ; also needed by test suite |
3e442f85 | 141 | ("ghostscript" ,ghostscript/cups) |
51002318 RW |
142 | ("ijs" ,ijs) |
143 | ("dbus" ,dbus) | |
144 | ("lcms" ,lcms) | |
f8489f16 | 145 | ("libjpeg" ,libjpeg) |
51002318 RW |
146 | ("libpng" ,libpng) |
147 | ("libtiff" ,libtiff) | |
148 | ("glib" ,glib) | |
149 | ("qpdf" ,qpdf) | |
150 | ("poppler" ,poppler) | |
151 | ("cups-minimal" ,cups-minimal))) | |
6c474253 | 152 | (home-page "https://wiki.linuxfoundation.org/openprinting/cups-filters") |
51002318 RW |
153 | (synopsis "OpenPrinting CUPS filters and backends") |
154 | (description | |
155 | "Contains backends, filters, and other software that was once part of the | |
156 | core CUPS distribution but is no longer maintained by Apple Inc. In addition | |
157 | it contains additional filters developed independently of Apple, especially | |
158 | filters for the PDF-centric printing workflow introduced by OpenPrinting.") | |
159 | ;; Different filters and backends have different licenses; see COPYING for | |
160 | ;; details | |
161 | (license (list license:gpl2 | |
162 | license:gpl2+ | |
163 | license:gpl3 | |
164 | license:gpl3+ | |
165 | license:lgpl2.0+ | |
166 | license:expat)))) | |
167 | ||
168 | ;; CUPS on non-MacOS systems requires cups-filters. Since cups-filters also | |
169 | ;; depends on CUPS libraries and binaries, cups-minimal has been added to | |
170 | ;; satisfy this dependency. | |
171 | (define-public cups-minimal | |
172 | (package | |
173 | (name "cups-minimal") | |
c23d8977 | 174 | (version "2.2.4") |
88dfd8b8 TGR |
175 | (source |
176 | (origin | |
177 | (method url-fetch) | |
178 | (uri (string-append "https://github.com/apple/cups/releases/download/v" | |
179 | version "/cups-" version "-source.tar.gz")) | |
180 | (sha256 | |
181 | (base32 | |
c23d8977 | 182 | "1k4qxafmapq6hzbkh273fdyzkj9alw6ppwz5k933bhsi4svlsvar")))) |
51002318 RW |
183 | (build-system gnu-build-system) |
184 | (arguments | |
185 | `(#:configure-flags | |
186 | '("--disable-launchd" | |
187 | "--disable-systemd" | |
188 | "--disable-avahi" | |
189 | "--disable-dnssd") | |
190 | ;; Seven tests fail, mostly because of files that are provided by the | |
191 | ;; cups-filters package. | |
192 | #:tests? #f | |
193 | #:phases | |
6ea06a0e LC |
194 | (modify-phases %standard-phases |
195 | (add-before 'configure 'patch-makedefs | |
196 | (lambda _ | |
197 | (substitute* "Makedefs.in" | |
198 | (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@") | |
199 | (("/bin/sh") (which "sh"))))) | |
d043ceed LF |
200 | ;; Make the compressed manpages writable so that the |
201 | ;; reset-gzip-timestamps phase does not error out. | |
202 | (add-before 'reset-gzip-timestamps 'make-manpages-writable | |
203 | (lambda* (#:key outputs #:allow-other-keys) | |
204 | (let* ((out (assoc-ref outputs "out")) | |
205 | (man (string-append out "/share/man"))) | |
206 | (for-each (lambda (file) (chmod file #o644)) | |
207 | (find-files man "\\.gz"))))) | |
6ea06a0e LC |
208 | (add-before 'build 'patch-tests |
209 | (lambda _ | |
210 | (substitute* "test/ippserver.c" | |
211 | (("# else /\\* HAVE_AVAHI \\*/") | |
212 | "#elif defined(HAVE_AVAHI)"))))))) | |
51002318 RW |
213 | (native-inputs |
214 | `(("pkg-config" ,pkg-config))) | |
215 | (inputs | |
216 | `(("zlib" ,zlib) | |
217 | ("gnutls" ,gnutls))) | |
d2a79db4 | 218 | (home-page "https://www.cups.org") |
51002318 RW |
219 | (synopsis "The Common Unix Printing System") |
220 | (description | |
9ced1033 TGR |
221 | "CUPS is a printing system that uses the Internet Printing Protocol |
222 | (@dfn{IPP}). It provides System V and BSD command-line interfaces, as well | |
51002318 RW |
223 | as a Web interface and a C programming interface to manage printers and print |
224 | jobs. It supports printing to both local (parallel, serial, USB) and | |
225 | networked printers, and printers can be shared from one computer to another. | |
9ced1033 TGR |
226 | Internally, CUPS uses PostScript Printer Description (@dfn{PPD}) files to |
227 | describe printer capabilities and features, and a wide variety of generic and | |
51002318 RW |
228 | device-specific programs to convert and print many types of files.") |
229 | (license license:gpl2))) | |
230 | ||
231 | (define-public cups | |
232 | (package (inherit cups-minimal) | |
233 | (name "cups") | |
234 | (arguments | |
235 | `(;; Three tests fail: | |
236 | ;; * two tests in ipp-1.1.test related to "RFC 2911 section 3.2.6: | |
237 | ;; Get-Jobs Operation" | |
238 | ;; * test of number of error/warning messages, probably related to a | |
239 | ;; missing font. | |
240 | #:tests? #f | |
241 | #:configure-flags | |
242 | '("--disable-launchd" | |
243 | "--disable-systemd") | |
244 | #:phases | |
3064d176 EF |
245 | (modify-phases %standard-phases |
246 | (add-before 'configure 'patch-makedefs | |
247 | (lambda _ | |
248 | (substitute* "Makedefs.in" | |
249 | (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@") | |
250 | (("/bin/sh") (which "sh"))))) | |
251 | (add-before 'check 'patch-tests | |
252 | (lambda _ | |
253 | (let ((filters (assoc-ref %build-inputs "cups-filters")) | |
254 | (catpath (string-append | |
255 | (assoc-ref %build-inputs "coreutils") "/bin/")) | |
256 | (testdir (string-append (getcwd) "/tmp/"))) | |
257 | (mkdir testdir) | |
258 | (substitute* "test/run-stp-tests.sh" | |
259 | ((" *BASE=/tmp/") (string-append "BASE=" testdir)) | |
51002318 | 260 | |
3064d176 EF |
261 | ;; allow installation of filters from output dir and from |
262 | ;; cups-filters | |
263 | (("for dir in /usr/libexec/cups/filter /usr/lib/cups/filter") | |
264 | (string-append | |
265 | "for dir in " | |
266 | (assoc-ref %outputs "out") "/lib/cups/filter " | |
267 | filters "/lib/cups/filter")) | |
51002318 | 268 | |
3064d176 EF |
269 | ;; check for charsets in cups-filters output |
270 | (("/usr/share/cups/charsets") | |
271 | (string-append filters "/share/cups/charsets")) | |
51002318 | 272 | |
3064d176 EF |
273 | ;; install additional required filters |
274 | (("instfilter texttopdf texttopdf pdf") | |
275 | (string-append | |
276 | "instfilter texttopdf texttopdf pdf;" | |
277 | "instfilter imagetoraster imagetoraster raster;" | |
278 | "instfilter gstoraster gstoraster raster;" | |
279 | "instfilter urftopdf urftopdf pdf;" | |
280 | "instfilter rastertopdf rastertopdf pdf;" | |
281 | "instfilter pstopdf pstopdf pdf")) | |
51002318 | 282 | |
3064d176 EF |
283 | ;; specify location of lpstat binary |
284 | (("description=\"`lpstat -l") | |
285 | "description=\"`../systemv/lpstat -l") | |
51002318 | 286 | |
3064d176 EF |
287 | ;; patch shebangs of embedded scripts |
288 | (("#!/bin/sh") (string-append "#!" (which "sh"))) | |
51002318 | 289 | |
3064d176 EF |
290 | ;; also link mime definitions from cups-filters |
291 | ;; to enable the additional filters for the test suite | |
292 | (("ln -s \\$root/conf/mime\\.types") | |
293 | (string-append | |
294 | "ln -s " filters | |
295 | "/share/cups/mime/cupsfilters.types $BASE/share/mime; " | |
296 | "ln -s $root/conf/mime.types")) | |
297 | (("ln -s \\$root/conf/mime\\.convs") | |
298 | (string-append | |
299 | "ln -s " filters | |
300 | "/share/cups/mime/cupsfilters.convs $BASE/share/mime; " | |
301 | "ln -s $root/conf/mime.convs"))) | |
51002318 | 302 | |
3064d176 EF |
303 | ;; fix search path for "cat" |
304 | (substitute* "cups/testfile.c" | |
305 | (("cupsFileFind\\(\"cat\", \"/bin\"") | |
306 | (string-append "cupsFileFind(\"cat\", \"" catpath "\"")) | |
307 | (("cupsFileFind\\(\"cat\", \"/bin:/usr/bin\"") | |
308 | (string-append "cupsFileFind(\"cat\", \"" catpath "\"")))))) | |
29796b3f LF |
309 | ;; Make the compressed manpages writable so that the |
310 | ;; reset-gzip-timestamps phase does not error out. | |
311 | (add-before 'reset-gzip-timestamps 'make-manpages-writable | |
312 | (lambda* (#:key outputs #:allow-other-keys) | |
313 | (let* ((out (assoc-ref outputs "out")) | |
314 | (man (string-append out "/share/man"))) | |
315 | (for-each (lambda (file) (chmod file #o644)) | |
316 | (find-files man "\\.gz"))))) | |
3064d176 EF |
317 | (add-after 'install 'install-cups-filters-symlinks |
318 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
319 | (let ((out (assoc-ref outputs "out")) | |
320 | (cups-filters (assoc-ref inputs "cups-filters"))) | |
321 | ;; charsets | |
322 | (symlink | |
323 | (string-append cups-filters "/share/cups/charsets") | |
324 | (string-append out "/share/charsets")) | |
51002318 | 325 | |
3064d176 EF |
326 | ;; mime types, driver file, ppds |
327 | (for-each | |
328 | (lambda (f) | |
329 | (symlink (string-append cups-filters f) | |
330 | (string-append out f))) | |
331 | '("/share/cups/mime/cupsfilters.types" | |
332 | "/share/cups/mime/cupsfilters.convs" | |
333 | "/share/cups/drv/cupsfilters.drv" | |
334 | "/share/ppd")) | |
51002318 | 335 | |
3064d176 EF |
336 | ;; filters |
337 | (for-each | |
338 | (lambda (f) | |
339 | (symlink f | |
340 | (string-append out "/lib/cups/filter" (basename f)))) | |
341 | (find-files (string-append cups-filters "/lib/cups/filter"))) | |
51002318 | 342 | |
3064d176 EF |
343 | ;; backends |
344 | (for-each | |
345 | (lambda (f) | |
346 | (symlink (string-append cups-filters f) | |
347 | (string-append out "/lib/cups/backend/" | |
348 | (basename f)))) | |
349 | '("/lib/cups/backend/parallel" | |
350 | "/lib/cups/backend/serial")) | |
51002318 | 351 | |
3064d176 EF |
352 | ;; banners |
353 | (let ((banners "/share/cups/banners")) | |
354 | (delete-file-recursively (string-append out banners)) | |
355 | (symlink (string-append cups-filters banners) | |
356 | (string-append out banners))) | |
51002318 | 357 | |
3064d176 EF |
358 | ;; assorted data |
359 | (let ((data "/share/cups/data")) | |
360 | (delete-file-recursively (string-append out data)) | |
361 | (symlink (string-append cups-filters data) | |
362 | (string-append out data))))))))) | |
51002318 RW |
363 | (inputs |
364 | `(("avahi" ,avahi) | |
365 | ("gnutls" ,gnutls) | |
366 | ("cups-filters" ,cups-filters) | |
367 | ("zlib" ,zlib))))) | |
2b56dc01 DM |
368 | |
369 | (define-public hplip | |
370 | (package | |
371 | (name "hplip") | |
3031b138 | 372 | (version "3.17.10") |
2b56dc01 DM |
373 | (source (origin |
374 | (method url-fetch) | |
de67e922 LF |
375 | (uri (string-append "mirror://sourceforge/hplip/hplip/" version |
376 | "/hplip-" version ".tar.gz")) | |
2b56dc01 DM |
377 | (sha256 |
378 | (base32 | |
3031b138 | 379 | "0v27hg856b5z2rilczcbfgz8ksxn0n810g1glac3mxkj8qbl8wqg")))) |
2b56dc01 DM |
380 | (build-system gnu-build-system) |
381 | (home-page "http://hplipopensource.com/") | |
382 | (synopsis "HP Printer Drivers") | |
383 | (description "Hewlett-Packard Printer Drivers and PPDs.") | |
384 | ||
385 | ;; The 'COPYING' file lists directories where each of these 3 licenses | |
386 | ;; applies. | |
387 | (license (list license:gpl2+ license:bsd-3 license:expat)) | |
388 | ||
389 | ;; TODO install apparmor profile files eventually. | |
390 | (arguments | |
391 | `(#:configure-flags | |
392 | `("--disable-network-build" | |
393 | ,(string-append "--prefix=" (assoc-ref %outputs "out")) | |
394 | ,(string-append "--sysconfdir=" (assoc-ref %outputs "out") "/etc") | |
395 | ;; Disable until mime.types merging works (FIXME). | |
396 | "--disable-fax-build" | |
397 | "--enable-hpcups-install" | |
398 | "--enable-new-hpcups" | |
399 | "--enable-cups_ppd_install" | |
400 | "--enable-cups_drv_install" | |
401 | ;; TODO add foomatic drv install eventually. | |
402 | ;; TODO --enable-policykit eventually. | |
403 | ,(string-append "--with-cupsfilterdir=" | |
404 | (assoc-ref %outputs "out") "/lib/cups/filter") | |
405 | ,(string-append "--with-cupsbackenddir=" | |
406 | (assoc-ref %outputs "out") "/lib/cups/backend") | |
407 | ,(string-append "--with-icondir=" | |
408 | (assoc-ref %outputs "out") "/share/applications") | |
409 | ,(string-append "--with-systraydir=" | |
410 | (assoc-ref %outputs "out") "/etc/xdg")) | |
411 | ||
412 | #:imported-modules ((guix build python-build-system) | |
413 | ,@%gnu-build-system-modules) | |
414 | #:modules ((guix build gnu-build-system) | |
415 | (guix build utils) | |
416 | ((guix build python-build-system) #:prefix python:)) | |
417 | ||
418 | #:phases (modify-phases %standard-phases | |
419 | (add-after 'unpack 'fix-hard-coded-file-names | |
420 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
421 | (let ((out (assoc-ref outputs "out")) | |
422 | ;; FIXME: use merged ppds (I think actually only | |
423 | ;; drvs need to be merged). | |
424 | (cupsdir (assoc-ref inputs "cups-minimal"))) | |
425 | (substitute* "base/g.py" | |
426 | (("'/usr/share;[^']*'") | |
427 | (string-append "'" cupsdir "/share'")) | |
428 | (("'/etc/hp/hplip.conf'") | |
429 | (string-append "'" out | |
430 | "/etc/hp/hplip.conf" "'"))) | |
431 | ||
432 | (substitute* "Makefile.in" | |
433 | (("[[:blank:]]check-plugin\\.py[[:blank:]]") " ") | |
434 | ;; FIXME Use beginning-of-word in regexp. | |
435 | (("[[:blank:]]plugin\\.py[[:blank:]]") " ") | |
436 | (("/usr/include/libusb-1.0") | |
437 | (string-append (assoc-ref inputs "libusb") | |
438 | "/include/libusb-1.0")) | |
439 | (("^\tinstall-dist_hplip_stateDATA") | |
440 | ;; Remove dependencies on | |
441 | ;; 'install-dist_hplip_stateDATA' so we don't bail | |
442 | ;; out while trying to create /var/lib/hplip. | |
443 | "\t") | |
444 | (("hplip_confdir = /etc/hp") | |
445 | ;; This is only used for installing the default config. | |
446 | (string-append "hplip_confdir = " out | |
447 | "/etc/hp")) | |
448 | (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor") | |
449 | ;; Note: We don't use hal. | |
450 | (string-append "halpredir = " out | |
451 | "/share/hal/fdi/preprobe/10osvendor")) | |
452 | (("rulesdir = /etc/udev/rules.d") | |
453 | ;; udev rules will be merged by base service. | |
454 | (string-append "rulesdir = " out | |
455 | "/lib/udev/rules.d")) | |
456 | (("rulessystemdir = /usr/lib/systemd/system") | |
457 | ;; We don't use systemd. | |
458 | (string-append "rulessystemdir = " out | |
459 | "/lib/systemd/system")) | |
460 | (("/etc/sane.d") | |
461 | (string-append out "/etc/sane.d")))))) | |
462 | ||
463 | ;; Wrap bin/* so that the Python libs are found. | |
464 | (add-after 'install 'wrap-binaries | |
465 | (assoc-ref python:%standard-phases 'wrap))))) | |
466 | ||
467 | ;; Python3 support is available starting from hplip@3.15.2. | |
468 | (inputs `(("libjpeg" ,libjpeg) | |
469 | ("cups-minimal" ,cups-minimal) | |
470 | ("libusb" ,libusb) | |
32aa37a2 | 471 | ("sane-backends" ,sane-backends-minimal) |
2b56dc01 DM |
472 | ("dbus" ,dbus) |
473 | ("python-wrapper" ,python-wrapper) | |
474 | ("python" ,python) | |
475 | ;; TODO: Make hp-setup find python-dbus. | |
476 | ("python-dbus" ,python-dbus))) | |
477 | (native-inputs `(("pkg-config" ,pkg-config))))) | |
d02aabaf LC |
478 | |
479 | (define-public foomatic-filters | |
480 | (package | |
481 | (name "foomatic-filters") | |
482 | (version "4.0.12") | |
483 | (source (origin | |
484 | (method url-fetch) | |
485 | (uri (string-append | |
486 | "http://www.openprinting.org/download/foomatic/" | |
487 | name "-" version ".tar.gz")) | |
488 | (sha256 | |
489 | (base32 | |
490 | "17w26r15094j4fqifa7f7i7jad4gsy9zdlq69kffrykcw31qx3q8")) | |
491 | (patches | |
492 | (search-patches "foomatic-filters-CVE-2015-8327.patch" | |
493 | "foomatic-filters-CVE-2015-8560.patch")))) | |
494 | (build-system gnu-build-system) | |
495 | (home-page | |
496 | "https://wiki.linuxfoundation.org/openprinting/database/foomatic") | |
497 | (native-inputs | |
498 | `(("perl" ,perl) | |
499 | ("pkg-config" ,pkg-config))) | |
500 | (inputs | |
501 | `(("dbus" ,dbus) | |
502 | ("a2ps" ,a2ps))) | |
503 | (arguments | |
504 | '( ;; Specify the installation directories. | |
505 | #:configure-flags (list (string-append "ac_cv_path_CUPS_BACKENDS=" | |
506 | (assoc-ref %outputs "out") | |
507 | "/lib/cups/backend") | |
508 | (string-append "ac_cv_path_CUPS_FILTERS=" | |
509 | (assoc-ref %outputs "out") | |
510 | "/lib/cups/filter") | |
511 | (string-append "ac_cv_path_PPR_INTERFACES=" | |
512 | (assoc-ref %outputs "out") | |
513 | "/lib/ppr/interfaces") | |
514 | (string-append "ac_cv_path_PPR_LIB=" | |
515 | (assoc-ref %outputs "out") | |
516 | "/lib/ppr/lib") | |
517 | ||
518 | ;; For some reason these are misdiagnosed. | |
519 | "ac_cv_func_malloc_0_nonnull=yes" | |
520 | "ac_cv_func_realloc_0_nonnull=yes") | |
521 | #:test-target "tests")) | |
522 | (synopsis "Convert PostScript to the printer's native format") | |
523 | (description | |
524 | "This package contains filter scripts used by the printer spoolers to | |
525 | convert the incoming PostScript data into the printer's native format using a | |
526 | printer/driver specific, but spooler-independent PPD file.") | |
527 | (license license:gpl2+))) | |
5db0a1cd LC |
528 | |
529 | (define-public foo2zjs | |
530 | (package | |
531 | ;; The tarball is called "foo2zjs", but the web page talks about | |
532 | ;; "foo2xqx". Go figure! | |
533 | (name "foo2zjs") | |
534 | (version "201709") | |
535 | (source (origin | |
536 | (method url-fetch) | |
537 | ;; XXX: This is an unversioned URL! | |
538 | (uri "http://foo2zjs.rkkda.com/foo2zjs.tar.gz") | |
539 | (sha256 | |
540 | (base32 | |
541 | "0amjj3jr6s6h7crzxyx11v31sj0blz7k5c2vycz4gn8cxlmk3c7w")))) | |
542 | (build-system gnu-build-system) | |
543 | (arguments | |
544 | '(#:phases (modify-phases %standard-phases | |
545 | (replace 'configure | |
546 | (lambda* (#:key outputs #:allow-other-keys) | |
547 | (substitute* (find-files "." "^Makefile$") | |
548 | ;; Set the installation directory. | |
549 | (("^PREFIX[[:blank:]]*=.*$") | |
550 | (string-append "PREFIX = " | |
551 | (assoc-ref outputs "out") | |
552 | "\n")) | |
553 | (("^UDEVBIN[[:blank:]]*=.*$") | |
554 | "UDEVBIN = $(PREFIX)/bin\n") | |
555 | ;; Don't try to chown/chgrp the installed files. | |
556 | (("-oroot") | |
557 | "") | |
558 | (("-glp") | |
559 | "") | |
560 | ;; Placate the dependency checks. | |
561 | (("/usr/include/stdio.h") | |
562 | "/etc/passwd") | |
563 | (("/usr/") | |
564 | "$(PREFIX)/") | |
565 | ;; Ensure fixed timestamps in man pages. | |
566 | (("^MODTIME[[:blank:]]*=.*$") | |
567 | "MODTIME = echo Thu Jan 01 01:00:00 1970\n")) | |
568 | #t)) | |
569 | (add-after 'install 'remove-pdf | |
570 | (lambda* (#:key outputs #:allow-other-keys) | |
571 | ;; Remove 'manual.pdf' which is (1) useless (it's a | |
572 | ;; concatenation of man pages), and (2) not | |
573 | ;; bit-reproducible due to <https://bugs.gnu.org/27593>. | |
574 | (let ((out (assoc-ref outputs "out"))) | |
575 | (for-each delete-file | |
576 | (find-files out "^manual\\.pdf$")) | |
577 | #t)))) | |
578 | #:parallel-build? #f ;broken makefile | |
579 | #:tests? #f ;no tests | |
580 | #:make-flags '("CC=gcc"))) | |
581 | (inputs | |
582 | `(("ghostscript" ,ghostscript) | |
583 | ("foomatic-filters" ,foomatic-filters))) ;for 'foomatic-rip' | |
584 | (native-inputs | |
585 | `(("bc" ,bc) | |
586 | ("groff" ,groff))) | |
587 | (home-page "http://foo2xqx.rkkda.com/") | |
588 | (synopsis "Printer driver for XQX stream protocol") | |
589 | (description | |
590 | "This package provides a printer driver notably for the ZJS and XQX | |
591 | protocols, which cover printers made by Konica, HP (LaserJet), Oki, Samsung, | |
592 | and more. See @file{README} for details.") | |
593 | (license license:gpl2+))) | |
011f5769 DNB |
594 | |
595 | (define-public escpr | |
596 | (package | |
597 | (name "escpr") | |
598 | (version "1.6.17") | |
599 | ;; XXX: This currently works. But it will break as soon as a newer | |
600 | ;; version is available since the URLs for older versions are not | |
601 | ;; preserved. An alternative source will be added as soon as | |
602 | ;; available. | |
603 | (source (origin | |
604 | (method url-fetch) | |
605 | ;; The uri has to be chopped up in order to satisfy guix lint. | |
606 | (uri (string-append "https://download3.ebz.epson.net/dsc/f/03/00/06/66/09/" | |
607 | "4ac2bf69bb1ddf4a9ad525596615cbb40fe4dad5/" | |
608 | "epson-inkjet-printer-escpr-1.6.17-1lsb3.2.tar.gz")) | |
609 | (sha256 | |
610 | (base32 | |
611 | "0m6v1wdavw4r25jfywqchsx0v9ss1l5fr8vq9d0d8cmjnz8mqblv")))) | |
612 | (build-system gnu-build-system) | |
613 | (arguments | |
614 | `(#:configure-flags | |
615 | `(,(string-append "--prefix=" | |
616 | (assoc-ref %outputs "out")) | |
617 | ,(string-append "--with-cupsfilterdir=" | |
618 | (assoc-ref %outputs "out") "/lib/cups/filter") | |
619 | ,(string-append "--with-cupsppddir=" | |
620 | (assoc-ref %outputs "out") "/share/ppd")))) | |
621 | (inputs `(("cups" ,cups-minimal))) | |
622 | (synopsis "ESC/P-R printer driver") | |
623 | (description | |
624 | "This package provides a filter for the Common UNIX Printing | |
625 | System (CUPS). It offers high-quality printing with Seiko Epson color ink jet | |
626 | printers. It can only be used with printers that support the Epson ESC/P-R | |
627 | language.") | |
628 | (home-page "http://download.ebz.epson.net/dsc/search/01/search") | |
629 | (license license:gpl2+))) |