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 | 48 | |
95264cc6 AW |
49 | ;; Delay to avoid module circularity problems. |
50 | (define ghostscript/cups | |
51 | (delay | |
7020a6ab | 52 | (package/inherit ghostscript |
95264cc6 AW |
53 | (name "ghostscript-with-cups") |
54 | (inputs `(("cups" ,cups-minimal) | |
55 | ,@(package-inputs ghostscript)))))) | |
56 | ||
51002318 RW |
57 | (define-public cups-filters |
58 | (package | |
59 | (name "cups-filters") | |
3d695e6a | 60 | (version "1.17.7") |
4ab016e0 | 61 | (source(origin |
51002318 RW |
62 | (method url-fetch) |
63 | (uri | |
64 | (string-append "http://openprinting.org/download/cups-filters/" | |
65 | "cups-filters-" version ".tar.xz")) | |
66 | (sha256 | |
67 | (base32 | |
3d695e6a | 68 | "1mg397kgfx0rs9j852f8ppmvaz2al5l75ildbgiqg6j3gwq5jssw")) |
51002318 RW |
69 | (modules '((guix build utils))) |
70 | (snippet | |
71 | ;; install backends, banners and filters to cups-filters output | |
72 | ;; directory, not the cups server directory | |
085cca5b AW |
73 | '(begin |
74 | (substitute* "Makefile.in" | |
75 | (("CUPS_DATADIR = @CUPS_DATADIR@") | |
76 | "CUPS_DATADIR = $(PREFIX)/share/cups") | |
77 | (("pkgcupsserverrootdir = \\$\\(CUPS_SERVERROOT\\)") | |
78 | "pkgcupsserverrootdir = $(PREFIX)") | |
79 | ;; Choose standard directories notably so that binaries are | |
80 | ;; stripped. | |
81 | (("pkgbackenddir = \\$\\(CUPS_SERVERBIN\\)/backend") | |
82 | "pkgbackenddir = $(PREFIX)/lib/cups/backend") | |
83 | (("pkgfilterdir = \\$\\(CUPS_SERVERBIN\\)/filter") | |
84 | "pkgfilterdir = $(PREFIX)/lib/cups/filter")) | |
85 | ;; Find bannertopdf data such as the print test page in our | |
86 | ;; output directory, not CUPS's prefix. | |
87 | (substitute* "configure" | |
88 | (("\\{CUPS_DATADIR\\}/data") | |
89 | "{prefix}/share/cups/data")))))) | |
51002318 RW |
90 | (build-system gnu-build-system) |
91 | (arguments | |
92 | `(#:make-flags (list (string-append "PREFIX=" %output)) | |
93 | #:configure-flags | |
f8489f16 | 94 | `("--disable-driverless" ; TODO: enable this |
79e90f05 | 95 | "--disable-mutool" ; depends on yet another PDF library (mupdf) |
b2639670 LC |
96 | |
97 | ;; Look for the "domain socket of CUPS" in /var/run/cups. | |
98 | "--localstatedir=/var" | |
99 | ||
f40aef6b LC |
100 | ;; Free software for the win. |
101 | "--with-acroread-path=evince" | |
102 | ||
f8489f16 | 103 | ,(string-append "--with-test-font-path=" |
51002318 RW |
104 | (assoc-ref %build-inputs "font-dejavu") |
105 | "/share/fonts/truetype/DejaVuSans.ttf") | |
95264cc6 AW |
106 | ,(string-append "--with-gs-path=" |
107 | (assoc-ref %build-inputs "ghostscript") | |
108 | "/bin/gsc") | |
f8489f16 EF |
109 | ,(string-append "--with-shell=" |
110 | (assoc-ref %build-inputs "bash") | |
111 | "/bin/bash") | |
51002318 | 112 | ,(string-append "--with-rcdir=" |
1728c411 LC |
113 | (assoc-ref %outputs "out") "/etc/rc.d")) |
114 | ||
115 | #:phases (modify-phases %standard-phases | |
116 | (add-after 'unpack 'patch-foomatic-hardcoded-file-names | |
117 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
118 | ;; Foomatic has hardcoded file names we need to fix. | |
119 | (let ((out (assoc-ref outputs "out")) | |
120 | (gs (assoc-ref inputs "ghostscript"))) | |
121 | (substitute* "filter/foomatic-rip/foomaticrip.c" | |
122 | (("/usr/local/lib/cups/filter") | |
123 | (string-append out "/lib/cups/filter"))) | |
124 | #t))) | |
125 | (add-after 'install 'wrap-filters | |
126 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
127 | ;; Some filters expect to find 'gs' in $PATH. We cannot | |
128 | ;; just hard-code its absolute file name in the source | |
129 | ;; because foomatic-rip, for example, has tests like | |
130 | ;; 'startswith(cmd, "gs")'. | |
131 | (let ((out (assoc-ref outputs "out")) | |
132 | (ghostscript (assoc-ref inputs "ghostscript"))) | |
133 | (for-each (lambda (file) | |
134 | (wrap-program file | |
135 | `("PATH" ":" prefix | |
136 | (,(string-append ghostscript | |
137 | "/bin"))))) | |
138 | (find-files (string-append | |
139 | out "/lib/cups/filter"))) | |
140 | #t)))))) | |
51002318 | 141 | (native-inputs |
b76b1dcb AE |
142 | `(("glib" ,glib "bin") ; for gdbus-codegen |
143 | ("pkg-config" ,pkg-config))) | |
51002318 | 144 | (inputs |
7e214019 EF |
145 | `(("avahi" ,avahi) |
146 | ("fontconfig" ,fontconfig) | |
51002318 | 147 | ("freetype" ,freetype) |
f8489f16 | 148 | ("font-dejavu" ,font-dejavu) ; also needed by test suite |
95264cc6 | 149 | ("ghostscript" ,(force ghostscript/cups)) |
51002318 RW |
150 | ("ijs" ,ijs) |
151 | ("dbus" ,dbus) | |
152 | ("lcms" ,lcms) | |
f8489f16 | 153 | ("libjpeg" ,libjpeg) |
51002318 RW |
154 | ("libpng" ,libpng) |
155 | ("libtiff" ,libtiff) | |
156 | ("glib" ,glib) | |
157 | ("qpdf" ,qpdf) | |
158 | ("poppler" ,poppler) | |
159 | ("cups-minimal" ,cups-minimal))) | |
6c474253 | 160 | (home-page "https://wiki.linuxfoundation.org/openprinting/cups-filters") |
51002318 RW |
161 | (synopsis "OpenPrinting CUPS filters and backends") |
162 | (description | |
163 | "Contains backends, filters, and other software that was once part of the | |
164 | core CUPS distribution but is no longer maintained by Apple Inc. In addition | |
165 | it contains additional filters developed independently of Apple, especially | |
166 | filters for the PDF-centric printing workflow introduced by OpenPrinting.") | |
167 | ;; Different filters and backends have different licenses; see COPYING for | |
168 | ;; details | |
169 | (license (list license:gpl2 | |
170 | license:gpl2+ | |
171 | license:gpl3 | |
172 | license:gpl3+ | |
173 | license:lgpl2.0+ | |
174 | license:expat)))) | |
175 | ||
176 | ;; CUPS on non-MacOS systems requires cups-filters. Since cups-filters also | |
177 | ;; depends on CUPS libraries and binaries, cups-minimal has been added to | |
178 | ;; satisfy this dependency. | |
179 | (define-public cups-minimal | |
180 | (package | |
181 | (name "cups-minimal") | |
c23d8977 | 182 | (version "2.2.4") |
88dfd8b8 TGR |
183 | (source |
184 | (origin | |
185 | (method url-fetch) | |
186 | (uri (string-append "https://github.com/apple/cups/releases/download/v" | |
187 | version "/cups-" version "-source.tar.gz")) | |
188 | (sha256 | |
189 | (base32 | |
c23d8977 | 190 | "1k4qxafmapq6hzbkh273fdyzkj9alw6ppwz5k933bhsi4svlsvar")))) |
51002318 RW |
191 | (build-system gnu-build-system) |
192 | (arguments | |
193 | `(#:configure-flags | |
194 | '("--disable-launchd" | |
195 | "--disable-systemd" | |
196 | "--disable-avahi" | |
197 | "--disable-dnssd") | |
198 | ;; Seven tests fail, mostly because of files that are provided by the | |
199 | ;; cups-filters package. | |
200 | #:tests? #f | |
201 | #:phases | |
6ea06a0e LC |
202 | (modify-phases %standard-phases |
203 | (add-before 'configure 'patch-makedefs | |
204 | (lambda _ | |
205 | (substitute* "Makedefs.in" | |
206 | (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@") | |
207 | (("/bin/sh") (which "sh"))))) | |
d043ceed LF |
208 | ;; Make the compressed manpages writable so that the |
209 | ;; reset-gzip-timestamps phase does not error out. | |
210 | (add-before 'reset-gzip-timestamps 'make-manpages-writable | |
211 | (lambda* (#:key outputs #:allow-other-keys) | |
212 | (let* ((out (assoc-ref outputs "out")) | |
213 | (man (string-append out "/share/man"))) | |
214 | (for-each (lambda (file) (chmod file #o644)) | |
215 | (find-files man "\\.gz"))))) | |
6ea06a0e LC |
216 | (add-before 'build 'patch-tests |
217 | (lambda _ | |
218 | (substitute* "test/ippserver.c" | |
219 | (("# else /\\* HAVE_AVAHI \\*/") | |
220 | "#elif defined(HAVE_AVAHI)"))))))) | |
51002318 RW |
221 | (native-inputs |
222 | `(("pkg-config" ,pkg-config))) | |
223 | (inputs | |
224 | `(("zlib" ,zlib) | |
225 | ("gnutls" ,gnutls))) | |
d2a79db4 | 226 | (home-page "https://www.cups.org") |
51002318 RW |
227 | (synopsis "The Common Unix Printing System") |
228 | (description | |
229 | "CUPS is a printing system that uses the Internet Printing | |
230 | Protocol (IPP). It provides System V and BSD command-line interfaces, as well | |
231 | as a Web interface and a C programming interface to manage printers and print | |
232 | jobs. It supports printing to both local (parallel, serial, USB) and | |
233 | networked printers, and printers can be shared from one computer to another. | |
234 | Internally, CUPS uses PostScript Printer Description (PPD) files to describe | |
235 | printer capabilities and features and a wide variety of generic and | |
236 | device-specific programs to convert and print many types of files.") | |
237 | (license license:gpl2))) | |
238 | ||
239 | (define-public cups | |
240 | (package (inherit cups-minimal) | |
241 | (name "cups") | |
242 | (arguments | |
243 | `(;; Three tests fail: | |
244 | ;; * two tests in ipp-1.1.test related to "RFC 2911 section 3.2.6: | |
245 | ;; Get-Jobs Operation" | |
246 | ;; * test of number of error/warning messages, probably related to a | |
247 | ;; missing font. | |
248 | #:tests? #f | |
249 | #:configure-flags | |
250 | '("--disable-launchd" | |
251 | "--disable-systemd") | |
252 | #:phases | |
3064d176 EF |
253 | (modify-phases %standard-phases |
254 | (add-before 'configure 'patch-makedefs | |
255 | (lambda _ | |
256 | (substitute* "Makedefs.in" | |
257 | (("INITDIR.*=.*@INITDIR@") "INITDIR = @prefix@/@INITDIR@") | |
258 | (("/bin/sh") (which "sh"))))) | |
259 | (add-before 'check 'patch-tests | |
260 | (lambda _ | |
261 | (let ((filters (assoc-ref %build-inputs "cups-filters")) | |
262 | (catpath (string-append | |
263 | (assoc-ref %build-inputs "coreutils") "/bin/")) | |
264 | (testdir (string-append (getcwd) "/tmp/"))) | |
265 | (mkdir testdir) | |
266 | (substitute* "test/run-stp-tests.sh" | |
267 | ((" *BASE=/tmp/") (string-append "BASE=" testdir)) | |
51002318 | 268 | |
3064d176 EF |
269 | ;; allow installation of filters from output dir and from |
270 | ;; cups-filters | |
271 | (("for dir in /usr/libexec/cups/filter /usr/lib/cups/filter") | |
272 | (string-append | |
273 | "for dir in " | |
274 | (assoc-ref %outputs "out") "/lib/cups/filter " | |
275 | filters "/lib/cups/filter")) | |
51002318 | 276 | |
3064d176 EF |
277 | ;; check for charsets in cups-filters output |
278 | (("/usr/share/cups/charsets") | |
279 | (string-append filters "/share/cups/charsets")) | |
51002318 | 280 | |
3064d176 EF |
281 | ;; install additional required filters |
282 | (("instfilter texttopdf texttopdf pdf") | |
283 | (string-append | |
284 | "instfilter texttopdf texttopdf pdf;" | |
285 | "instfilter imagetoraster imagetoraster raster;" | |
286 | "instfilter gstoraster gstoraster raster;" | |
287 | "instfilter urftopdf urftopdf pdf;" | |
288 | "instfilter rastertopdf rastertopdf pdf;" | |
289 | "instfilter pstopdf pstopdf pdf")) | |
51002318 | 290 | |
3064d176 EF |
291 | ;; specify location of lpstat binary |
292 | (("description=\"`lpstat -l") | |
293 | "description=\"`../systemv/lpstat -l") | |
51002318 | 294 | |
3064d176 EF |
295 | ;; patch shebangs of embedded scripts |
296 | (("#!/bin/sh") (string-append "#!" (which "sh"))) | |
51002318 | 297 | |
3064d176 EF |
298 | ;; also link mime definitions from cups-filters |
299 | ;; to enable the additional filters for the test suite | |
300 | (("ln -s \\$root/conf/mime\\.types") | |
301 | (string-append | |
302 | "ln -s " filters | |
303 | "/share/cups/mime/cupsfilters.types $BASE/share/mime; " | |
304 | "ln -s $root/conf/mime.types")) | |
305 | (("ln -s \\$root/conf/mime\\.convs") | |
306 | (string-append | |
307 | "ln -s " filters | |
308 | "/share/cups/mime/cupsfilters.convs $BASE/share/mime; " | |
309 | "ln -s $root/conf/mime.convs"))) | |
51002318 | 310 | |
3064d176 EF |
311 | ;; fix search path for "cat" |
312 | (substitute* "cups/testfile.c" | |
313 | (("cupsFileFind\\(\"cat\", \"/bin\"") | |
314 | (string-append "cupsFileFind(\"cat\", \"" catpath "\"")) | |
315 | (("cupsFileFind\\(\"cat\", \"/bin:/usr/bin\"") | |
316 | (string-append "cupsFileFind(\"cat\", \"" catpath "\"")))))) | |
29796b3f LF |
317 | ;; Make the compressed manpages writable so that the |
318 | ;; reset-gzip-timestamps phase does not error out. | |
319 | (add-before 'reset-gzip-timestamps 'make-manpages-writable | |
320 | (lambda* (#:key outputs #:allow-other-keys) | |
321 | (let* ((out (assoc-ref outputs "out")) | |
322 | (man (string-append out "/share/man"))) | |
323 | (for-each (lambda (file) (chmod file #o644)) | |
324 | (find-files man "\\.gz"))))) | |
3064d176 EF |
325 | (add-after 'install 'install-cups-filters-symlinks |
326 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
327 | (let ((out (assoc-ref outputs "out")) | |
328 | (cups-filters (assoc-ref inputs "cups-filters"))) | |
329 | ;; charsets | |
330 | (symlink | |
331 | (string-append cups-filters "/share/cups/charsets") | |
332 | (string-append out "/share/charsets")) | |
51002318 | 333 | |
3064d176 EF |
334 | ;; mime types, driver file, ppds |
335 | (for-each | |
336 | (lambda (f) | |
337 | (symlink (string-append cups-filters f) | |
338 | (string-append out f))) | |
339 | '("/share/cups/mime/cupsfilters.types" | |
340 | "/share/cups/mime/cupsfilters.convs" | |
341 | "/share/cups/drv/cupsfilters.drv" | |
342 | "/share/ppd")) | |
51002318 | 343 | |
3064d176 EF |
344 | ;; filters |
345 | (for-each | |
346 | (lambda (f) | |
347 | (symlink f | |
348 | (string-append out "/lib/cups/filter" (basename f)))) | |
349 | (find-files (string-append cups-filters "/lib/cups/filter"))) | |
51002318 | 350 | |
3064d176 EF |
351 | ;; backends |
352 | (for-each | |
353 | (lambda (f) | |
354 | (symlink (string-append cups-filters f) | |
355 | (string-append out "/lib/cups/backend/" | |
356 | (basename f)))) | |
357 | '("/lib/cups/backend/parallel" | |
358 | "/lib/cups/backend/serial")) | |
51002318 | 359 | |
3064d176 EF |
360 | ;; banners |
361 | (let ((banners "/share/cups/banners")) | |
362 | (delete-file-recursively (string-append out banners)) | |
363 | (symlink (string-append cups-filters banners) | |
364 | (string-append out banners))) | |
51002318 | 365 | |
3064d176 EF |
366 | ;; assorted data |
367 | (let ((data "/share/cups/data")) | |
368 | (delete-file-recursively (string-append out data)) | |
369 | (symlink (string-append cups-filters data) | |
370 | (string-append out data))))))))) | |
51002318 RW |
371 | (inputs |
372 | `(("avahi" ,avahi) | |
373 | ("gnutls" ,gnutls) | |
374 | ("cups-filters" ,cups-filters) | |
375 | ("zlib" ,zlib))))) | |
2b56dc01 DM |
376 | |
377 | (define-public hplip | |
378 | (package | |
379 | (name "hplip") | |
980fe414 | 380 | (version "3.17.7") |
2b56dc01 DM |
381 | (source (origin |
382 | (method url-fetch) | |
de67e922 LF |
383 | (uri (string-append "mirror://sourceforge/hplip/hplip/" version |
384 | "/hplip-" version ".tar.gz")) | |
2b56dc01 DM |
385 | (sha256 |
386 | (base32 | |
980fe414 | 387 | "03a0vkbrzvgj15il9rvr93kf5pc706gxcjk6akbkzds0zmdbsxrm")))) |
2b56dc01 DM |
388 | (build-system gnu-build-system) |
389 | (home-page "http://hplipopensource.com/") | |
390 | (synopsis "HP Printer Drivers") | |
391 | (description "Hewlett-Packard Printer Drivers and PPDs.") | |
392 | ||
393 | ;; The 'COPYING' file lists directories where each of these 3 licenses | |
394 | ;; applies. | |
395 | (license (list license:gpl2+ license:bsd-3 license:expat)) | |
396 | ||
397 | ;; TODO install apparmor profile files eventually. | |
398 | (arguments | |
399 | `(#:configure-flags | |
400 | `("--disable-network-build" | |
401 | ,(string-append "--prefix=" (assoc-ref %outputs "out")) | |
402 | ,(string-append "--sysconfdir=" (assoc-ref %outputs "out") "/etc") | |
403 | ;; Disable until mime.types merging works (FIXME). | |
404 | "--disable-fax-build" | |
405 | "--enable-hpcups-install" | |
406 | "--enable-new-hpcups" | |
407 | "--enable-cups_ppd_install" | |
408 | "--enable-cups_drv_install" | |
409 | ;; TODO add foomatic drv install eventually. | |
410 | ;; TODO --enable-policykit eventually. | |
411 | ,(string-append "--with-cupsfilterdir=" | |
412 | (assoc-ref %outputs "out") "/lib/cups/filter") | |
413 | ,(string-append "--with-cupsbackenddir=" | |
414 | (assoc-ref %outputs "out") "/lib/cups/backend") | |
415 | ,(string-append "--with-icondir=" | |
416 | (assoc-ref %outputs "out") "/share/applications") | |
417 | ,(string-append "--with-systraydir=" | |
418 | (assoc-ref %outputs "out") "/etc/xdg")) | |
419 | ||
420 | #:imported-modules ((guix build python-build-system) | |
421 | ,@%gnu-build-system-modules) | |
422 | #:modules ((guix build gnu-build-system) | |
423 | (guix build utils) | |
424 | ((guix build python-build-system) #:prefix python:)) | |
425 | ||
426 | #:phases (modify-phases %standard-phases | |
427 | (add-after 'unpack 'fix-hard-coded-file-names | |
428 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
429 | (let ((out (assoc-ref outputs "out")) | |
430 | ;; FIXME: use merged ppds (I think actually only | |
431 | ;; drvs need to be merged). | |
432 | (cupsdir (assoc-ref inputs "cups-minimal"))) | |
433 | (substitute* "base/g.py" | |
434 | (("'/usr/share;[^']*'") | |
435 | (string-append "'" cupsdir "/share'")) | |
436 | (("'/etc/hp/hplip.conf'") | |
437 | (string-append "'" out | |
438 | "/etc/hp/hplip.conf" "'"))) | |
439 | ||
440 | (substitute* "Makefile.in" | |
441 | (("[[:blank:]]check-plugin\\.py[[:blank:]]") " ") | |
442 | ;; FIXME Use beginning-of-word in regexp. | |
443 | (("[[:blank:]]plugin\\.py[[:blank:]]") " ") | |
444 | (("/usr/include/libusb-1.0") | |
445 | (string-append (assoc-ref inputs "libusb") | |
446 | "/include/libusb-1.0")) | |
447 | (("^\tinstall-dist_hplip_stateDATA") | |
448 | ;; Remove dependencies on | |
449 | ;; 'install-dist_hplip_stateDATA' so we don't bail | |
450 | ;; out while trying to create /var/lib/hplip. | |
451 | "\t") | |
452 | (("hplip_confdir = /etc/hp") | |
453 | ;; This is only used for installing the default config. | |
454 | (string-append "hplip_confdir = " out | |
455 | "/etc/hp")) | |
456 | (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor") | |
457 | ;; Note: We don't use hal. | |
458 | (string-append "halpredir = " out | |
459 | "/share/hal/fdi/preprobe/10osvendor")) | |
460 | (("rulesdir = /etc/udev/rules.d") | |
461 | ;; udev rules will be merged by base service. | |
462 | (string-append "rulesdir = " out | |
463 | "/lib/udev/rules.d")) | |
464 | (("rulessystemdir = /usr/lib/systemd/system") | |
465 | ;; We don't use systemd. | |
466 | (string-append "rulessystemdir = " out | |
467 | "/lib/systemd/system")) | |
468 | (("/etc/sane.d") | |
469 | (string-append out "/etc/sane.d")))))) | |
470 | ||
471 | ;; Wrap bin/* so that the Python libs are found. | |
472 | (add-after 'install 'wrap-binaries | |
473 | (assoc-ref python:%standard-phases 'wrap))))) | |
474 | ||
475 | ;; Python3 support is available starting from hplip@3.15.2. | |
476 | (inputs `(("libjpeg" ,libjpeg) | |
477 | ("cups-minimal" ,cups-minimal) | |
478 | ("libusb" ,libusb) | |
32aa37a2 | 479 | ("sane-backends" ,sane-backends-minimal) |
2b56dc01 DM |
480 | ("dbus" ,dbus) |
481 | ("python-wrapper" ,python-wrapper) | |
482 | ("python" ,python) | |
483 | ;; TODO: Make hp-setup find python-dbus. | |
484 | ("python-dbus" ,python-dbus))) | |
485 | (native-inputs `(("pkg-config" ,pkg-config))))) | |
d02aabaf LC |
486 | |
487 | (define-public foomatic-filters | |
488 | (package | |
489 | (name "foomatic-filters") | |
490 | (version "4.0.12") | |
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 | |
498 | "17w26r15094j4fqifa7f7i7jad4gsy9zdlq69kffrykcw31qx3q8")) | |
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 | |
539 | ;; The tarball is called "foo2zjs", but the web page talks about | |
540 | ;; "foo2xqx". Go figure! | |
541 | (name "foo2zjs") | |
542 | (version "201709") | |
543 | (source (origin | |
544 | (method url-fetch) | |
545 | ;; XXX: This is an unversioned URL! | |
546 | (uri "http://foo2zjs.rkkda.com/foo2zjs.tar.gz") | |
547 | (sha256 | |
548 | (base32 | |
549 | "0amjj3jr6s6h7crzxyx11v31sj0blz7k5c2vycz4gn8cxlmk3c7w")))) | |
550 | (build-system gnu-build-system) | |
551 | (arguments | |
552 | '(#:phases (modify-phases %standard-phases | |
553 | (replace 'configure | |
554 | (lambda* (#:key outputs #:allow-other-keys) | |
555 | (substitute* (find-files "." "^Makefile$") | |
556 | ;; Set the installation directory. | |
557 | (("^PREFIX[[:blank:]]*=.*$") | |
558 | (string-append "PREFIX = " | |
559 | (assoc-ref outputs "out") | |
560 | "\n")) | |
561 | (("^UDEVBIN[[:blank:]]*=.*$") | |
562 | "UDEVBIN = $(PREFIX)/bin\n") | |
563 | ;; Don't try to chown/chgrp the installed files. | |
564 | (("-oroot") | |
565 | "") | |
566 | (("-glp") | |
567 | "") | |
568 | ;; Placate the dependency checks. | |
569 | (("/usr/include/stdio.h") | |
570 | "/etc/passwd") | |
571 | (("/usr/") | |
572 | "$(PREFIX)/") | |
573 | ;; Ensure fixed timestamps in man pages. | |
574 | (("^MODTIME[[:blank:]]*=.*$") | |
575 | "MODTIME = echo Thu Jan 01 01:00:00 1970\n")) | |
576 | #t)) | |
577 | (add-after 'install 'remove-pdf | |
578 | (lambda* (#:key outputs #:allow-other-keys) | |
579 | ;; Remove 'manual.pdf' which is (1) useless (it's a | |
580 | ;; concatenation of man pages), and (2) not | |
581 | ;; bit-reproducible due to <https://bugs.gnu.org/27593>. | |
582 | (let ((out (assoc-ref outputs "out"))) | |
583 | (for-each delete-file | |
584 | (find-files out "^manual\\.pdf$")) | |
585 | #t)))) | |
586 | #:parallel-build? #f ;broken makefile | |
587 | #:tests? #f ;no tests | |
588 | #:make-flags '("CC=gcc"))) | |
589 | (inputs | |
590 | `(("ghostscript" ,ghostscript) | |
591 | ("foomatic-filters" ,foomatic-filters))) ;for 'foomatic-rip' | |
592 | (native-inputs | |
593 | `(("bc" ,bc) | |
594 | ("groff" ,groff))) | |
595 | (home-page "http://foo2xqx.rkkda.com/") | |
596 | (synopsis "Printer driver for XQX stream protocol") | |
597 | (description | |
598 | "This package provides a printer driver notably for the ZJS and XQX | |
599 | protocols, which cover printers made by Konica, HP (LaserJet), Oki, Samsung, | |
600 | and more. See @file{README} for details.") | |
601 | (license license:gpl2+))) |