;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015, 2019, 2021 Ricardo Wurmus ;;; Copyright © 2015, 2016, 2017, 2019, 2021 Ludovic Courtès ;;; Copyright © 2015-2018, 2023 Efraim Flashner ;;; Copyright © 2016 Danny Milosavljevic ;;; Copyright © 2017 Leo Famulari ;;; Copyright © 2017 Mark H Weaver ;;; Copyright © 2017–2022 Tobias Geerinckx-Rice ;;; Copyright © 2020 Marius Bakke ;;; Copyright © 2021, 2023 Maxim Cournoyer ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be u
aboutsummaryrefslogtreecommitdiff
blob: a14ac87aa2640212774055d8fc8912b7d7a7dc93 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Ricardo Wurmus <rekado@elephly.net>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages irods)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system cmake)
  #:use-module (guix utils)
  #:use-module (gnu packages)
  #:use-module (gnu packages backup)
  #:use-module (gnu packages base)
  #:use-module (gnu packages boost)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages cpp)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages kerberos)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages llvm)
  #:use-module (gnu packages logging)
  #:use-module (gnu packages man)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages pretty-print)
  #:use-module (gnu packages python)
  #:use-module (gnu packages serialization)
  #:use-module (gnu packages tls)
  #:use-module (srfi srfi-1))

(define-public irods
  (package
    (name "irods")
    (version "4.2.8")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/irods/irods/releases/download/"
                                  version "/irods-" version ".tar.gz"))
              (sha256
               (base32
                "0ny54c3r0j692rvbr4iibg7xgd2i7g9x8yyrw04j889bywix14rc"))))
    (build-system cmake-build-system)
    (arguments
     `(#:configure-flags
       (list
        "-DCMAKE_BUILD_TYPE=Release"
        (string-append "-DCMAKE_MODULE_LINKER_FLAGS=-Wl,-rpath="
                       (assoc-ref %outputs "out") "/lib")
        (string-append "-DCMAKE_SHARED_LINKER_FLAGS=-Wl,-rpath="
                       (assoc-ref %outputs "out") "/lib")
        (string-append "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath="
                       (assoc-ref %outputs "out") "/lib")

        ;; Configuration aborts if no generator format is set
        "-DCPACK_GENERATOR=TGZ"

        ;; Configuration attempts to guess the distribution with Python.
        "-DIRODS_LINUX_DISTRIBUTION_NAME=guix"
        "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=1"

        (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG="
                       (assoc-ref %build-inputs "clang"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME="
                       (assoc-ref %build-inputs "clang-runtime"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ="
                       (assoc-ref %build-inputs "cppzmq"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE="
                       (assoc-ref %build-inputs "libarchive"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_AVRO="
                       (assoc-ref %build-inputs "avro-cpp"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_BOOST="
                       (assoc-ref %build-inputs "boost"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_ZMQ="
                       (assoc-ref %build-inputs "zeromq"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_JSON="
                       (assoc-ref %build-inputs "json"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_CATCH2="
                       (assoc-ref %build-inputs "catch2"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_NANODBC="
                       (assoc-ref %build-inputs "nanodbc"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_FMT="
                       (assoc-ref %build-inputs "fmt")))

       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'unset-Werror
           (lambda _
             ;; -Werror kills the build due to a comparison REQUIRE(errs.size() == err->len);
             ;; in unit_tests/src/test_irods_lifetime_manager.cpp
             (substitute* "CMakeLists.txt"
               (("-Werror") ""))))
         (add-after 'unpack 'remove-FHS-and-prefix-assumptions
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* '("CMakeLists.txt"
                            "cmake/server.cmake"
                            "cmake/development_library.cmake"
                            "cmake/runtime_library.cmake")
               (("usr/") ""))
             (substitute* "lib/core/src/irods_default_paths.cpp"
               (("path.append\\(\"usr\"\\)") "path")
               (("path.remove_filename\\(\\).remove_filename\\(\\).remove_filename\\(\\)")
                "path.remove_filename().remove_filename()"))
             (substitute* "scripts/irods/paths.py"
               (("'usr', 'lib', 'irods'") "'lib', 'irods'"))
             (substitute* "scripts/irods/pypyodbc.py"
               (("\"/usr/lib/libodbc.so\"")
                (search-input-file inputs "/lib/libodbc.so")))))
         (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((gcc (assoc-ref inputs  "gcc")))
               (setenv "CPLUS_INCLUDE_PATH"
                       (string-join
                        (cons* (search-input-directory inputs "/include/c++/v1")
                               (search-input-directory inputs "/include/catch2")
                               (search-input-directory inputs "/include/nlohmann")
                               ;; Hide GCC's C++ headers so that they do not interfere with
                               ;; the Clang headers.
                               (delete (string-append gcc "/include/c++")
                                       (string-split (getenv "CPLUS_INCLUDE_PATH")
                                                     #\:)))
                        ":"))
               (format #true
                       "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
                       (getenv "CPLUS_INCLUDE_PATH"))))))))
    (inputs
     `(("avro-cpp" ,avro-cpp-1.9-for-irods)
       ("boost" ,boost-for-irods)
       ("cppzmq" ,cppzmq)
       ("fmt" ,fmt-6)
       ("json" ,nlohmann-json)
       ("libarchive" ,libarchive)
       ("libcxxabi" ,libcxxabi-6) ; we need this for linking with -lc++abi
       ("linux-pam" ,linux-pam)
       ("mit-krb5" ,mit-krb5)
       ("nanodbc" ,nanodbc-for-irods)
       ("openssl" ,openssl)
       ("python" ,python-wrapper)
       ("unixodbc" ,unixodbc)
       ("zeromq" ,zeromq)))
    (native-inputs
     `(("catch2" ,catch2)
       ("clang" ,clang-toolchain-6)
       ("clang-runtime" ,clang-runtime-6)
       ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)))
    (home-page "https://irods.org")
    (synopsis "Data management software")
    (description "The Integrated Rule-Oriented Data System (iRODS) is data
management software.  iRODS virtualizes data storage resources, so users can
take control of their data, regardless of where and on what device the data is
stored.")
    (license license:bsd-3)))

(define-public irods-client-icommands
  (package
    (name "irods-client-icommands")
    (version "4.2.8")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/irods/irods_client_icommands")
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "069n647p5ypf44gim8z26mwayg5lzgk7r9qyyqd8f9n7h0p4jxpn"))))
    (build-system cmake-build-system)
    (arguments
     `(#:tests? #false ; not clear how to run tests
       #:configure-flags
       (list
        "-DCMAKE_BUILD_TYPE=Release"

        ;; Configuration attempts to guess the distribution with Python.
        "-DIRODS_LINUX_DISTRIBUTION_NAME=guix"
        "-DIRODS_LINUX_DISTRIBUTION_VERSION_MAJOR=1"

        (string-append "-DIRODS_DIR="
                       (assoc-ref %build-inputs "irods")
                       "/lib/irods/cmake")
        (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG="
                       (assoc-ref %build-inputs "clang"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_CLANG_RUNTIME="
                       (assoc-ref %build-inputs "clang-runtime"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_CPPZMQ="
                       (assoc-ref %build-inputs "cppzmq"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_ARCHIVE="
                       (assoc-ref %build-inputs "libarchive"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_AVRO="
                       (assoc-ref %build-inputs "avro-cpp"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_BOOST="
                       (assoc-ref %build-inputs "boost"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_ZMQ="
                       (assoc-ref %build-inputs "zeromq"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_JSON="
                       (assoc-ref %build-inputs "json"))
        (string-append "-DIRODS_EXTERNALS_FULLPATH_FMT="
                       (assoc-ref %build-inputs "fmt")))

       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'unset-Werror ;
           (lambda _                           ;
             ;; -Werror kills the build due to a deprecation warning
             (substitute* "CMakeLists.txt" ;
               (("-Werror") ""))))
         (add-after 'unpack 'remove-/usr-prefix
           (lambda _
             (substitute* "CMakeLists.txt"
               (("usr/") ""))))
         (add-after 'set-paths 'adjust-CPLUS_INCLUDE_PATH
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((gcc (assoc-ref inputs  "gcc")))
               (setenv "CPLUS_INCLUDE_PATH"
                       (string-join
                        (cons* (search-input-directory inputs
                                                       "include/c++/v1")
                               (search-input-directory inputs
                                                       "include/nlohmann")
                               ;; Hide GCC's C++ headers so that they do not interfere with
                               ;; the Clang headers.
                               (delete (string-append gcc "/include/c++")
                                       (string-split (getenv "CPLUS_INCLUDE_PATH")
                                                     #\:)))
                        ":"))
               (format #true
                       "environment variable `CPLUS_INCLUDE_PATH' changed to ~a~%"
                       (getenv "CPLUS_INCLUDE_PATH"))))))))
    (inputs
     `(("avro-cpp" ,avro-cpp-1.9-for-irods)
       ("boost" ,boost-for-irods)
       ("cppzmq" ,cppzmq)
       ("fmt" ,fmt-6)
       ("irods" ,irods)
       ("json" ,nlohmann-json)
       ("libarchive" ,libarchive)
       ("libcxxabi" ,libcxxabi-6)     ; we need this for linking with -lc++abi
       ("mit-krb5" ,mit-krb5)
       ("openssl" ,openssl)
       ("zeromq" ,zeromq)))
    (native-inputs
     `(("clang" ,clang-toolchain-6)
       ("clang-runtime" ,clang-runtime-6)
       ("libcxx+libcxxabi" ,libcxx+libcxxabi-6)
       ("help2man" ,help2man)
       ("which" ,which)))
    (home-page "https://irods.org")
    (synopsis "Data management software")
    (description "The Integrated Rule-Oriented Data System (iRODS) is data
management software.  iRODS virtualizes data storage resources, so users can
take control of their data, regardless of where and on what device the data is
stored.")
    (license license:bsd-3)))
tring-append prefix ": ; \\\n")) ;; Remove the lines adding file targets altogether. (("^\\@FULL_BUILD_TRUE\\@.*libImageProcessor.*") "")) ;; Install binaries under libexec/hplip instead of ;; share/hplip; that'll at least ensure they get stripped. ;; It's not even clear that they're of any use though... (substitute* "Makefile.in" (("^dat2drvdir =.*") "dat2drvdir = $(pkglibexecdir)\n") (("^locatedriverdir =.*") "locatedriverdir = $(pkglibexecdir)\n")))))) (outputs (list "out" "ppd")) (build-system gnu-build-system) (arguments (list #:imported-modules `((guix build python-build-system) ,@%gnu-build-system-modules) #:modules '((guix build gnu-build-system) (guix build utils) ((guix build python-build-system) #:prefix python:)) #:configure-flags #~(list "--disable-imageProcessor-build" "--disable-network-build" (string-append "--prefix=" #$output) (string-append "--sysconfdir=" #$output "/etc") (string-append "LDFLAGS=-Wl,-rpath=" #$output "/lib") ;; Disable until mime.types merging works (FIXME). "--disable-fax-build" "--enable-new-hpcups" ;; TODO add foomatic drv install eventually. ;; TODO --enable-policykit eventually. (string-append "--with-cupsfilterdir=" #$output "/lib/cups/filter") (string-append "--with-cupsbackenddir=" #$output "/lib/cups/backend") (string-append "--with-hpppddir=" #$output:ppd "/share/ppd/HP") (string-append "--with-icondir=" #$output "/share/applications") (string-append "--with-systraydir=" #$output "/etc/xdg") "--enable-qt5" "--disable-qt4") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'fix-hard-coded-file-names (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out #$output) ;; FIXME: use merged ppds (I think actually only ;; drvs need to be merged). (cupsdir #$(this-package-input "cups-minimal"))) (substitute* (find-files "." "\\.py$") ;; Refer to the correct default configuration file name. (("/etc/hp/hplip.conf") (string-append out "/etc/hp/hplip.conf"))) (substitute* "base/g.py" (("'/usr/share;[^']*'") (string-append "'" cupsdir "/share'")) (("'/etc/hp/hplip.conf'") (string-append "'" out "/etc/hp/hplip.conf" "'"))) (substitute* "Makefile.in" (("[[:blank:]]check-plugin\\.py[[:blank:]]") " ") ;; FIXME Use beginning-of-word in regexp. (("[[:blank:]]plugin\\.py[[:blank:]]") " ") (("/usr/include/libusb-1.0") (search-input-directory inputs "/include/libusb-1.0")) (("hplip_statedir =.*$") ;; Don't bail out while trying to create ;; /var/lib/hplip. We can safely change its value ;; here because it's hard-coded in the code anyway. "hplip_statedir = $(prefix)\n") (("hplip_confdir = /etc/hp") ;; This is only used for installing the default config. (string-append "hplip_confdir = " out "/etc/hp")) (("halpredir = /usr/share/hal/fdi/preprobe/10osvendor") ;; We don't use hal. (string-append "halpredir = " out "/share/hal/fdi/preprobe/10osvendor")) (("rulesdir = /etc/udev/rules.d") ;; udev rules will be merged by base service. (string-append "rulesdir = " out "/lib/udev/rules.d")) (("rulessystemdir = /usr/lib/systemd/system") ;; We don't use systemd. (string-append "rulessystemdir = " out "/lib/systemd/system")) (("/etc/sane.d") (string-append out "/etc/sane.d")))))) (add-after 'install 'install-models-dat (lambda* (#:key outputs #:allow-other-keys) (install-file "data/models/models.dat" (string-append #$output "/share/hplip/data/models")))) (add-after 'install 'wrap-binaries ;; Scripts in /bin are all symlinks to .py files in /share/hplip. ;; Symlinks are immune to the Python build system's 'WRAP phase, ;; and the .py files can't be wrapped because they are reused as ;; modules. Replacing the symlinks in /bin with copies and ;; wrapping them also doesn't work (“ModuleNotFoundError: ;; No module named 'base'”). Behold: a custom WRAP-PROGRAM. (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) (bin (string-append out "/bin")) (site (python:site-packages inputs outputs))) (with-directory-excursion bin (for-each (lambda (file) (let ((target (readlink file))) (delete-file file) (with-output-to-file file (lambda _ (format #t "#!~a~@ export GUIX_PYTHONPATH=\"~a:~a\"~@ exec -a \"$0\" \"~a/~a\" \"$@\"~%" (which "bash") site (getenv "GUIX_PYTHONPATH") bin target))) (chmod file #o755))) (find-files "." (lambda (file stat) (eq? 'symlink (stat:type stat)))))))))))) ;; Note that the error messages printed by the tools in the case of ;; missing dependencies are often downright misleading. ;; TODO: hp-toolbox still fails to start with: ;; from dbus.mainloop.pyqt5 import DBusQtMainLoop ;; ModuleNotFoundError: No module named 'dbus.mainloop.pyqt5' (native-inputs (list perl pkg-config)) (inputs (list cups-minimal dbus libjpeg-turbo libusb python python-dbus python-pygobject python-pyqt python-wrapper sane-backends-minimal zlib)) (home-page "https://developers.hp.com/hp-linux-imaging-and-printing") (synopsis "HP printer drivers") (description "Hewlett-Packard printer drivers and PostScript Printer Descriptions (@dfn{PPD}s).") ;; The 'COPYING' file lists directories where each of these 3 licenses ;; applies. (license (list license:gpl2+ license:bsd-3 license:expat)))) (define-public hplip-minimal (package/inherit hplip (name "hplip-minimal") (arguments (substitute-keyword-arguments (package-arguments hplip) ((#:configure-flags cf) ;; Produce a "light build", meaning that only the printer (CUPS) and ;; scanner (SANE) support gets built, without all the 'hp-*' ;; command-line tools. #~(cons "--enable-lite-build" (delete "--enable-qt5" #$cf))) ((#:phases phases) ;; The 'wrap-binaries' is not needed here since the 'hp-*' programs ;; are not installed. #~(alist-delete 'wrap-binaries #$phases)))) (inputs (remove (match-lambda ((label . _) (string-prefix? "python" label))) (package-inputs hplip))) (synopsis "GUI-less version of hplip"))) (define-public foomatic-filters (package (name "foomatic-filters") (version "4.0.17") (source (origin (method url-fetch) (uri (string-append "http://www.openprinting.org/download/foomatic/" "foomatic-filters-" version ".tar.gz")) (sha256 (base32 "1qrkgbm5jay2r7sh9qbyf0aiyrsl1mdc844hxf7fhw95a0zfbqm2")) (patches (search-patches "foomatic-filters-CVE-2015-8327.patch" "foomatic-filters-CVE-2015-8560.patch")))) (build-system gnu-build-system) (home-page "https://openprinting.github.io/projects/02-foomatic/") (native-inputs (list perl pkg-config)) (inputs (list dbus a2ps)) (arguments '( ;; Specify the installation directories. #:configure-flags (list (string-append "ac_cv_path_CUPS_BACKENDS=" (assoc-ref %outputs "out") "/lib/cups/backend") (string-append "ac_cv_path_CUPS_FILTERS=" (assoc-ref %outputs "out") "/lib/cups/filter") (string-append "ac_cv_path_PPR_INTERFACES=" (assoc-ref %outputs "out") "/lib/ppr/interfaces") (string-append "ac_cv_path_PPR_LIB=" (assoc-ref %outputs "out") "/lib/ppr/lib") "CFLAGS=-fcommon" ;; For some reason these are misdiagnosed. "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes") #:test-target "tests")) (synopsis "Convert PostScript to the printer's native format") (description "This package contains filter scripts used by the printer spoolers to convert the incoming PostScript data into the printer's native format using a printer/driver specific, but spooler-independent PPD file.") (license license:gpl2+))) (define-public foo2zjs (package (name "foo2zjs") (version "20200610.1") (source (origin (method url-fetch) ;; The upstream tarball is unversioned: use a stable snapshot. (uri (string-append "https://web.archive.org/web/20210224094943if_/" "http://foo2zjs.rkkda.com/foo2zjs.tar.gz")) (sha256 (base32 "03ncif50n7ck7drggqxbc7w0kgzdb90ha0dbvqk98ky8lw3k76xd")))) (build-system gnu-build-system) (arguments '(#:phases (modify-phases %standard-phases (replace 'configure (lambda* (#:key outputs #:allow-other-keys) (substitute* (find-files "." "^Makefile$") ;; Set the installation directory. (("^PREFIX[[:blank:]]*=.*$") (string-append "PREFIX = " (assoc-ref outputs "out") "\n")) (("^UDEVBIN[[:blank:]]*=.*$") "UDEVBIN = $(PREFIX)/bin\n") ;; Don't try to chown/chgrp the installed files. (("-oroot") "") (("-glp") "") ;; Placate the dependency checks. (("/usr/include/stdio.h") "/etc/passwd") (("/usr/") "$(PREFIX)/") ;; Ensure fixed timestamps in man pages. (("^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 ;; concatenation of man pages), and (2) not ;; bit-reproducible due to . (let ((out (assoc-ref outputs "out"))) (for-each delete-file (find-files out "^manual\\.pdf$")) #t)))) #:parallel-build? #f ;broken makefile #:tests? #f ;no tests #:make-flags '("CC=gcc"))) (inputs (list coreutils sed ghostscript foomatic-filters)) ;for 'foomatic-rip' (native-inputs (list bc groff)) ;; The domain has expired and no one has meaningfully taken up the torch. (home-page (string-append "https://web.archive.org/web/20210129024712/" "http://foo2zjs.rkkda.com/")) (synopsis "Printer driver for ZjStream-based printers") (description "foo2zjs is a printer driver for printers that use the Zenographics ZjStream wire protocol for their print data, often erroneously referred to as winprinters or GDI printers. It supports Minolta/QMS@tie{}Magicolor, Minolta@tie{}Color@tie{}PageWorks/Pro, HP@tie{}LaserJet, and possibly other printers. See @file{README} for details.") (license (list license:expat ; icc2ps/*.[ch] license:gpl2+)))) ; everything else (define-public epson-inkjet-printer-escpr (package (name "epson-inkjet-printer-escpr") (version "1.7.24") ;; XXX: This currently works. But it will break as soon as a newer version ;; is available since the URLs for older versions are not preserved. Since ;; 1.8.0, source tarballs have been discontinued and only a ‘source RPM’ is ;; available. (source (origin (method url-fetch) (uri (string-append "https://download3.ebz.epson.net/dsc/f/03/00/14/31/" "90/d2f5b28fcfaa0a1d1753eac5703aa5d88004ce06/" "epson-inkjet-printer-escpr-1.7.24-1lsb3.2.tar.gz")) (sha256 (base32 "0bwff3p6d0xgghf3bicylbxkv9vxz3gjjbr0iafyxz23kalzz9qj")))) (build-system gnu-build-system) (arguments (list #:modules `((srfi srfi-26) ,@%gnu-build-system-modules) #:configure-flags #~(list "--disable-static" (string-append "--prefix=" #$output) (string-append "--with-cupsfilterdir=" #$output "/lib/cups/filter") (string-append "--with-cupsppddir=" #$output "/share/cups/model")) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-autotools-version-requirement (lambda _ (substitute* "aclocal.m4" (("1\\.15") #$(package-version automake))) (substitute* "configure" (("^(ACLOCAL=).*" _ match) (string-append match "aclocal")) (("^(AUTOMAKE=).*" _ match) (string-append match "automake"))))) (add-after 'install 'compress-PPDs (lambda _ (with-directory-excursion #$output (for-each (cut invoke "gzip" "-9" <>) (find-files "share/cups" "\\.ppd$")))))))) (native-inputs (list autoconf automake)) (inputs (list cups-minimal)) (synopsis "ESC/P-R printer driver") (description "This package provides a filter for @acronym{CUPS, the Common UNIX Printing System} that offers high-quality printing with Seiko@tie{}Epson color ink jet printers. It can be used only with printers that support the Epson@tie{}ESC/P-R language.") (home-page "https://download.ebz.epson.net/dsc/search/01/search/?OSC=LX") (license license:gpl2+))) (define-public splix ;; Last released in 2009 . ;; Last SVN commit was 2013 . ;; Use a more maintained fork with several bug fixes and support for newer ;; printer models. (let ((commit "76268c4dd7dbc8218ea7426401104c3b40cc707a") (revision "315")) (package (name "splix") (version (git-version "2.0.0" revision commit)) (source (origin (method git-fetch) (uri (git-reference (url "https://gitlab.com/ScumCoder/splix") (commit commit))) (file-name (git-file-name name version)) (sha256 (base32 "1mxsvllwwr1v8sgrax0b7gkajjhnm0l06s67spmaxz47lyll1qab")))) (build-system gnu-build-system) ;; PPDs have been obsolete since CUPS 1.2 and make up 90% of total size. (outputs (list "out" "ppd")) (arguments `(#:modules ((srfi srfi-26) ,@%gnu-build-system-modules) #:make-flags (list (string-append "CUPSDRV=" (assoc-ref %outputs "out") "/share/cups/drv") (string-append "CUPSFILTER=" (assoc-ref %outputs "out") "/lib/cups/filter") (string-append "CUPSPPD=" (assoc-ref %outputs "ppd") "/share/cups/model") "CACHESIZE=100" ; pages in RAM, ±300 KiB each "THREADS=4") ; compress and print faster #:phases (modify-phases %standard-phases (add-after 'unpack 'enter-subdirectory ;; The git repository replicates the top-level SVN layout. (lambda _ (chdir "splix") #t)) (delete 'configure) ; no configure script (add-before 'build 'build-.drv-files (lambda* (#:key make-flags #:allow-other-keys) (apply invoke "make" "drv" make-flags))) (add-after 'install 'install-.drv-files (lambda* (#:key make-flags #:allow-other-keys) (apply invoke "make" "install" "DRV_ONLY=1" make-flags))) (add-after 'install 'compress-PPDs (lambda* (#:key outputs #:allow-other-keys) (let ((ppd (assoc-ref outputs "ppd"))) (for-each (cut invoke "gzip" "-9" <>) (find-files ppd "\\.ppd$")))))) #:tests? #f)) ; no test suite (inputs `(("cups" ,cups-minimal) ("jbigkit" ,jbigkit) ("zlib" ,zlib))) (synopsis "QPDL (SPL2) printer driver") (description "SpliX is a set of CUPS drivers for printers that speak @acronym{QPDL, Quick Page Description Language}, also called @acronym{SPL2, Samsung Printer Language version 2}. These include many laser printers sold by Samsung, Xerox, Lexmark, Toshiba, and Dell. Colour printers need colour profile files to get better results. These @file{cms} files are provided by the printer's manufacturer and must be obtained and installed separately.") (home-page "http://splix.ap2c.org/") (license license:gpl2)))) (define-public python-pycups (package (name "python-pycups") (version "1.9.74") (source (origin (method url-fetch) (uri (pypi-uri "pycups" version ".tar.bz2")) (sha256 (base32 "1ffp7sswhdsfpy88zg0cc8kl04wygkjs01rlm9f0spbwk8jhy2c6")))) (build-system python-build-system) (arguments '(;; Tests require CUPS to be running #:tests? #f)) (inputs (list cups)) (home-page "https://github.com/zdohnal/pycups") (synopsis "Python bindings for libcups") (description "This package provides Python bindings for libcups, wrapping the CUPS API.") (license license:gpl2+)))