Commit | Line | Data |
---|---|---|
bf4018fb AE |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> | |
35a12b47 | 3 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
01aae5fc | 4 | ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net> |
958d25ad | 5 | ;;; Copyright © 2013, 2015, 2016 Ludovic Courtès <ludo@gnu.org> |
bf4018fb AE |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
10 | ;;; under the terms of the GNU General Public License as published by | |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
14 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
22 | (define-module (gnu packages ghostscript) | |
23 | #:use-module (gnu packages) | |
01aae5fc | 24 | #:use-module (gnu packages autotools) |
bf4018fb | 25 | #:use-module (gnu packages compression) |
a86177d6 | 26 | #:use-module (gnu packages fontutils) |
e55354b8 | 27 | #:use-module (gnu packages image) |
bf4018fb AE |
28 | #:use-module (gnu packages perl) |
29 | #:use-module (gnu packages pkg-config) | |
30 | #:use-module (gnu packages python) | |
31 | #:use-module (gnu packages tcl) | |
7a75b02a | 32 | #:use-module (gnu packages xorg) |
b5b73a82 | 33 | #:use-module ((guix licenses) #:prefix license:) |
bf4018fb AE |
34 | #:use-module (guix packages) |
35 | #:use-module (guix download) | |
36 | #:use-module (guix build-system gnu)) | |
37 | ||
38 | (define-public lcms | |
39 | (package | |
40 | (name "lcms") | |
6b282cc9 | 41 | (version "2.6") |
bf4018fb AE |
42 | (source (origin |
43 | (method url-fetch) | |
de67e922 LF |
44 | (uri (string-append "mirror://sourceforge/lcms/lcms/" version |
45 | "/lcms2-" version ".tar.gz")) | |
bf4018fb | 46 | (sha256 (base32 |
6b282cc9 | 47 | "1c8lgq8gfs3nyplvbx9k8wzfj6r2bqi3f611vb1m8z3476454wji")))) |
bf4018fb AE |
48 | (build-system gnu-build-system) |
49 | (inputs `(("libjpeg-8" ,libjpeg-8) | |
50 | ("libtiff" ,libtiff) | |
51 | ("zlib" ,zlib))) | |
52 | (synopsis "Little CMS, a small-footprint colour management engine") | |
53 | (description | |
54 | "Little CMS is a small-footprint colour management engine, with special | |
35b9e423 | 55 | focus on accuracy and performance. It uses the International Color |
bf4018fb AE |
56 | Consortium standard (ICC), approved as ISO 15076-1.") |
57 | (license license:x11) | |
58 | (home-page "http://www.littlecms.com/"))) | |
59 | ||
60 | (define-public libpaper | |
61 | (package | |
62 | (name "libpaper") | |
63 | (version "1.1.24") | |
64 | (source (origin | |
65 | (method url-fetch) | |
66 | (uri (string-append | |
48fa9312 EF |
67 | ;; Debian moved their libpaper-1.1.24 to archive.debian.net |
68 | ;; but in the move the hash of their tarball changed. | |
69 | "http://pkgs.fedoraproject.org/repo/pkgs/libpaper/libpaper_" | |
70 | version ".tar.gz/5bc87d494ba470aba54f6d2d51471834/libpaper_" | |
bf4018fb AE |
71 | version ".tar.gz")) |
72 | (sha256 (base32 | |
73 | "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q")))) | |
74 | (build-system gnu-build-system) | |
35b9e423 | 75 | (synopsis "Library for handling paper sizes") |
bf4018fb AE |
76 | (description |
77 | "The paper library and accompanying files are intended to provide a simple | |
78 | way for applications to take actions based on a system- or user-specified | |
79 | paper size.") | |
80 | (license license:gpl2) | |
48fa9312 | 81 | (home-page "https://packages.qa.debian.org/libp/libpaper.html"))) |
bf4018fb | 82 | |
87ec7a7a AE |
83 | (define-public psutils |
84 | (package | |
85 | (name "psutils") | |
86 | (version "17") | |
87 | (source (origin | |
88 | (method url-fetch) | |
89 | (uri "ftp://ftp.knackered.org/pub/psutils/psutils.tar.gz") | |
90 | (sha256 (base32 | |
91 | "1r4ab1fvgganm02kmm70b2r1azwzbav2am41gbigpa2bb1wynlrq")))) | |
92 | (build-system gnu-build-system) | |
93 | (inputs `(("perl" ,perl))) | |
94 | (arguments | |
95 | `(#:tests? #f ; none provided | |
96 | #:phases | |
97 | (alist-replace | |
98 | 'configure | |
99 | (lambda* (#:key inputs outputs #:allow-other-keys #:rest args) | |
100 | (let ((perl (assoc-ref inputs "perl")) | |
101 | (out (assoc-ref outputs "out"))) | |
102 | (copy-file "Makefile.unix" "Makefile") | |
103 | (substitute* "Makefile" | |
104 | (("/usr/local/bin/perl") (string-append perl "/bin/perl"))) | |
105 | (substitute* "Makefile" | |
106 | (("/usr/local") out)) | |
107 | ;; for the install phase | |
108 | (substitute* "Makefile" | |
109 | (("-mkdir") "mkdir -p")) | |
110 | ;; drop installation of non-free files | |
111 | (substitute* "Makefile" | |
112 | ((" install.include") "")))) | |
113 | %standard-phases))) | |
35b9e423 | 114 | (synopsis "Collection of utilities for manipulating PostScript documents") |
87ec7a7a AE |
115 | (description |
116 | "PSUtils is a collection of utilities for manipulating PostScript | |
35b9e423 | 117 | documents. Programs included are psnup, for placing out several logical pages |
87ec7a7a AE |
118 | on a single sheet of paper, psselect, for selecting pages from a document, |
119 | pstops, for general imposition, psbook, for signature generation for booklet | |
120 | printing, and psresize, for adjusting page sizes.") | |
166191b3 | 121 | (license (license:non-copyleft "file://LICENSE" |
87ec7a7a AE |
122 | "See LICENSE in the distribution.")) |
123 | (home-page "http://knackered.org/angus/psutils/"))) | |
124 | ||
bf4018fb AE |
125 | (define-public ghostscript |
126 | (package | |
127 | (name "ghostscript") | |
a6e81858 | 128 | (version "9.14.0") |
bf4018fb AE |
129 | (source (origin |
130 | (method url-fetch) | |
131 | (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-" | |
132 | version ".tar.xz")) | |
1d386b2d LC |
133 | (sha256 |
134 | (base32 | |
135 | "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1")) | |
fc1adab1 AK |
136 | (patches (search-patches "ghostscript-CVE-2015-3228.patch" |
137 | "ghostscript-runpath.patch")) | |
9161ba81 LC |
138 | (modules '((guix build utils))) |
139 | (snippet | |
140 | ;; Honor --docdir. | |
141 | '(substitute* "Makefile.in" | |
142 | (("^docdir=.*$") "docdir = @docdir@\n") | |
143 | (("^exdir=.*$") "exdir = $(docdir)/examples\n"))))) | |
bf4018fb | 144 | (build-system gnu-build-system) |
9161ba81 | 145 | (outputs '("out" "doc")) ;16 MiB of HTML/PS doc + examples |
bf4018fb AE |
146 | (inputs `(("freetype" ,freetype) |
147 | ("lcms" ,lcms) | |
148 | ("libjpeg-8" ,libjpeg-8) | |
149 | ("libpng" ,libpng) | |
150 | ("libpaper" ,libpaper) | |
151 | ("libtiff" ,libtiff) | |
bf4018fb | 152 | ("zlib" ,zlib))) |
c4c4cc05 JD |
153 | (native-inputs |
154 | `(("perl" ,perl) | |
155 | ("pkg-config" ,pkg-config) ; needed to find libtiff | |
156 | ("python" ,python-wrapper) | |
157 | ("tcl" ,tcl))) | |
bf4018fb | 158 | (arguments |
958d25ad LC |
159 | `(#:disallowed-references ("doc") |
160 | #:phases | |
c17b2adf LC |
161 | (modify-phases %standard-phases |
162 | (add-after 'configure 'patch-config-files | |
163 | (lambda _ | |
164 | (substitute* "base/all-arch.mak" | |
165 | (("/bin/sh") (which "bash"))) | |
166 | (substitute* "base/unixhead.mak" | |
167 | (("/bin/sh") (which "bash"))))) | |
9161ba81 LC |
168 | (add-after 'configure 'remove-doc-reference |
169 | (lambda _ | |
170 | ;; Don't retain a reference to the 'doc' output in 'gs'. | |
171 | ;; The only use of this definition is in the output of | |
172 | ;; 'gs --help', so this change is fine. | |
173 | (substitute* "base/gscdef.c" | |
174 | (("GS_DOCDIR") | |
175 | "\"~/.guix-profile/share/doc/ghostscript\"")))) | |
eb354bda LC |
176 | (replace 'build |
177 | (lambda _ | |
178 | ;; Build 'libgs.so', but don't build the statically-linked 'gs' | |
179 | ;; binary (saves 18 MiB). | |
180 | (zero? (system* "make" "so" "-j" | |
181 | (number->string (parallel-job-count)))))) | |
182 | (replace 'install | |
183 | (lambda _ | |
184 | (zero? (system* "make" "soinstall"))))))) | |
f50d2669 | 185 | (synopsis "PostScript and PDF interpreter") |
bf4018fb | 186 | (description |
a22dc0c4 LC |
187 | "Ghostscript is an interpreter for the PostScript language and the PDF |
188 | file format. It also includes a C library that implements the graphics | |
189 | capabilities of the PostScript language. It supports a wide variety of | |
190 | output file formats and printers.") | |
a6e81858 | 191 | (license license:agpl3+) |
bf4018fb | 192 | (home-page "http://www.gnu.org/software/ghostscript/"))) |
1f7c6a1f | 193 | |
7a75b02a MW |
194 | (define-public ghostscript/x |
195 | (package (inherit ghostscript) | |
196 | (name (string-append (package-name ghostscript) "-with-x")) | |
197 | (inputs `(("libxext" ,libxext) | |
198 | ("libxt" ,libxt) | |
199 | ,@(package-inputs ghostscript))))) | |
200 | ||
01aae5fc RW |
201 | (define-public ijs |
202 | (package | |
203 | (name "ijs") | |
204 | (version "9.14.0") | |
205 | (source (origin | |
206 | (method url-fetch) | |
207 | (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-" | |
208 | version ".tar.xz")) | |
209 | (sha256 (base32 | |
210 | "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1")))) | |
211 | (build-system gnu-build-system) | |
212 | (native-inputs | |
213 | `(("libtool" ,libtool) | |
214 | ("automake" ,automake) | |
215 | ("autoconf" ,autoconf))) | |
216 | (arguments | |
217 | `(#:phases | |
218 | (alist-cons-after | |
219 | 'unpack 'autogen | |
220 | (lambda _ | |
221 | ;; need to regenerate macros | |
222 | (system* "autoreconf" "-if") | |
223 | ;; do not run configure | |
224 | (substitute* "autogen.sh" | |
225 | (("^.*\\$srcdir/configure.*") "")) | |
226 | (system* "bash" "autogen.sh") | |
227 | ||
228 | ;; create configure script in ./ijs/ | |
229 | (chdir "ijs") | |
230 | ;; do not run configure | |
231 | (substitute* "autogen.sh" | |
232 | (("^.*\\$srcdir/configure.*") "") | |
233 | (("^ + && echo Now type.*$") "")) | |
234 | (zero? (system* "bash" "autogen.sh"))) | |
235 | %standard-phases))) | |
236 | (synopsis "IJS driver framework for inkjet and other raster devices") | |
237 | (description | |
238 | "IJS is a protocol for transmission of raster page images. This package | |
239 | provides the reference implementation of the raster printer driver | |
240 | architecture.") | |
241 | (license license:expat) | |
242 | (home-page "http://www.gnu.org/software/ghostscript/"))) | |
243 | ||
1f7c6a1f AE |
244 | (define-public gs-fonts |
245 | (package | |
246 | (name "gs-fonts") | |
247 | (version "8.11") | |
248 | (source (origin | |
249 | (method url-fetch) | |
250 | (uri (string-append "mirror://sourceforge/gs-fonts/gs-fonts/" | |
251 | version | |
252 | "%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-" | |
253 | version | |
254 | ".tar.gz")) | |
255 | (sha256 (base32 | |
256 | "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf")))) | |
257 | (build-system gnu-build-system) | |
258 | (arguments | |
259 | `(#:tests? #f ; nothing to check, just files to copy | |
260 | #:modules ((guix build gnu-build-system) | |
261 | (guix build utils) | |
262 | (srfi srfi-1)) ; for alist-delete | |
263 | #:phases | |
264 | (alist-delete | |
265 | 'configure | |
266 | (alist-delete | |
267 | 'build | |
268 | (alist-replace | |
269 | 'install | |
270 | (lambda* (#:key outputs #:allow-other-keys) | |
271 | (let* ((out (assoc-ref outputs "out")) | |
272 | (dir (string-append out "/share/fonts/type1/ghostscript"))) | |
273 | (mkdir-p dir) | |
274 | (for-each | |
275 | (lambda (file) | |
276 | (copy-file file (string-append dir "/" file))) | |
277 | (find-files "." "pfb|afm")))) | |
278 | %standard-phases))))) | |
35b9e423 | 279 | (synopsis "Free replacements for the PostScript fonts") |
1f7c6a1f | 280 | (description |
35b9e423 EB |
281 | "Ghostscript fonts provides fonts and font metrics customarily distributed with |
282 | Ghostscript. It currently includes the 35 standard PostScript fonts.") | |
1f7c6a1f AE |
283 | (license license:gpl2) |
284 | (home-page "http://sourceforge.net/projects/gs-fonts/"))) | |
c5ea1201 | 285 | |
7cf2a2a1 AE |
286 | (define-public libspectre |
287 | (package | |
288 | (name "libspectre") | |
289 | (version "0.2.7") | |
290 | (source (origin | |
291 | (method url-fetch) | |
5cc3096c | 292 | (uri (string-append "https://libspectre.freedesktop.org/releases/libspectre-" |
7cf2a2a1 AE |
293 | version ".tar.gz")) |
294 | (sha256 (base32 | |
295 | "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8")))) | |
296 | (build-system gnu-build-system) | |
c4c4cc05 JD |
297 | (inputs `(("ghostscript" ,ghostscript))) |
298 | (native-inputs `(("pkg-config" ,pkg-config))) | |
35b9e423 | 299 | (synopsis "Postscript rendering library") |
7cf2a2a1 AE |
300 | (description |
301 | "libspectre is a small library for rendering Postscript documents. | |
302 | It provides a convenient easy to use API for handling and rendering | |
303 | Postscript documents.") | |
304 | (license license:gpl2+) | |
305 | (home-page "http://www.freedesktop.org/wiki/Software/libspectre"))) |