gnu: foo2zjs: Fix installation.

* gnu/packages/cups.scm (foo2zjs)[inputs]: Add coreutils and sed.
[arguments]: Add new phases ''make-install-dirs', 'wrap-wrappers', and
'install-cups-filters-symlinks'.

Signed-off-by: Leo Famulari <leo@famulari.name>
This commit is contained in:
Boris A. Dekshteyn 2020-12-15 16:47:08 -05:00 committed by Leo Famulari
parent d88ff09ea3
commit cf066b7a4e
No known key found for this signature in database
GPG key ID: 2646FA30BACA7F08

View file

@ -28,6 +28,7 @@ (define-module (gnu packages cups)
#:use-module (gnu packages algebra)
#:use-module (gnu packages autotools)
#:use-module (gnu packages avahi)
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages fonts) ; font-dejavu
#:use-module (gnu packages fontutils)
@ -716,6 +717,41 @@ (define-public foo2zjs
(("^MODTIME[[:blank:]]*=.*$")
"MODTIME = echo Thu Jan 01 01:00:00 1970\n"))
#t))
(add-before 'install 'make-install-dirs
(lambda* (#:key outputs #:allow-other-keys)
;; Make missing install dirs
(let ((out (assoc-ref outputs "out"))
(dirs '("/share/cups/model"
"/share/foomatic/db/source/opt"
"/share/foomatic/db/source/printer"
"/share/foomatic/db/source/driver"
"/lib/cups/filter")))
(for-each (lambda (dir)
(mkdir-p (string-append out dir)))
dirs))))
(add-after 'install 'wrap-wrappers
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out"))
(ghostscript (assoc-ref inputs "ghostscript"))
(coreutils (assoc-ref inputs "coreutils"))
(sed (assoc-ref inputs "sed")))
(for-each (lambda (file)
(wrap-program file
`("PATH" ":" prefix
(,(string-append ghostscript "/bin:"
coreutils "/bin:"
sed "/bin")))))
(find-files (string-append
out "/bin") "wrapper$")))))
(add-after 'install 'install-cups-filters-symlinks
(lambda* (#:key inputs outputs #:allow-other-keys)
(let ((out (assoc-ref outputs "out")))
(for-each
(lambda (file)
(symlink file
(string-append out "/lib/cups/filter/"
(basename file))))
(find-files (string-append out "/bin"))))))
(add-after 'install 'remove-pdf
(lambda* (#:key outputs #:allow-other-keys)
;; Remove 'manual.pdf' which is (1) useless (it's a
@ -729,7 +765,9 @@ (define-public foo2zjs
#:tests? #f ;no tests
#:make-flags '("CC=gcc")))
(inputs
`(("ghostscript" ,ghostscript)
`(("coreutils" ,coreutils)
("sed" ,sed)
("ghostscript" ,ghostscript)
("foomatic-filters" ,foomatic-filters))) ;for 'foomatic-rip'
(native-inputs
`(("bc" ,bc)