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