Revert "doc: Drop documentation of deprecated procedures."
[jackhill/guix/guix.git] / gnu / packages / ghostscript.scm
CommitLineData
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>
7a75b02a 5;;; Copyright © 2013, 2015 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)
44 (uri (string-append
10478523 45 "mirror://sourceforge/lcms/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 55focus on accuracy and performance. It uses the International Color
bf4018fb
AE
56Consortium 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
67 "http://ftp.de.debian.org/debian/pool/main/libp/libpaper/libpaper_"
68 version ".tar.gz"))
69 (sha256 (base32
70 "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
71 (build-system gnu-build-system)
35b9e423 72 (synopsis "Library for handling paper sizes")
bf4018fb
AE
73 (description
74 "The paper library and accompanying files are intended to provide a simple
75way for applications to take actions based on a system- or user-specified
76paper size.")
77 (license license:gpl2)
78 (home-page "http://packages.qa.debian.org/libp/libpaper.html")))
79
87ec7a7a
AE
80(define-public psutils
81 (package
82 (name "psutils")
83 (version "17")
84 (source (origin
85 (method url-fetch)
86 (uri "ftp://ftp.knackered.org/pub/psutils/psutils.tar.gz")
87 (sha256 (base32
88 "1r4ab1fvgganm02kmm70b2r1azwzbav2am41gbigpa2bb1wynlrq"))))
89 (build-system gnu-build-system)
90 (inputs `(("perl" ,perl)))
91 (arguments
92 `(#:tests? #f ; none provided
93 #:phases
94 (alist-replace
95 'configure
96 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
97 (let ((perl (assoc-ref inputs "perl"))
98 (out (assoc-ref outputs "out")))
99 (copy-file "Makefile.unix" "Makefile")
100 (substitute* "Makefile"
101 (("/usr/local/bin/perl") (string-append perl "/bin/perl")))
102 (substitute* "Makefile"
103 (("/usr/local") out))
104 ;; for the install phase
105 (substitute* "Makefile"
106 (("-mkdir") "mkdir -p"))
107 ;; drop installation of non-free files
108 (substitute* "Makefile"
109 ((" install.include") ""))))
110 %standard-phases)))
35b9e423 111 (synopsis "Collection of utilities for manipulating PostScript documents")
87ec7a7a
AE
112 (description
113 "PSUtils is a collection of utilities for manipulating PostScript
35b9e423 114documents. Programs included are psnup, for placing out several logical pages
87ec7a7a
AE
115on a single sheet of paper, psselect, for selecting pages from a document,
116pstops, for general imposition, psbook, for signature generation for booklet
117printing, and psresize, for adjusting page sizes.")
166191b3 118 (license (license:non-copyleft "file://LICENSE"
87ec7a7a
AE
119 "See LICENSE in the distribution."))
120 (home-page "http://knackered.org/angus/psutils/")))
121
bf4018fb
AE
122(define-public ghostscript
123 (package
124 (name "ghostscript")
a6e81858 125 (version "9.14.0")
bf4018fb
AE
126 (source (origin
127 (method url-fetch)
128 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
129 version ".tar.xz"))
1d386b2d
LC
130 (sha256
131 (base32
132 "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1"))
35a12b47
MW
133 (patches (map search-patch '("ghostscript-CVE-2015-3228.patch"
134 "ghostscript-runpath.patch")))
9161ba81
LC
135 (modules '((guix build utils)))
136 (snippet
137 ;; Honor --docdir.
138 '(substitute* "Makefile.in"
139 (("^docdir=.*$") "docdir = @docdir@\n")
140 (("^exdir=.*$") "exdir = $(docdir)/examples\n")))))
bf4018fb 141 (build-system gnu-build-system)
9161ba81 142 (outputs '("out" "doc")) ;16 MiB of HTML/PS doc + examples
bf4018fb
AE
143 (inputs `(("freetype" ,freetype)
144 ("lcms" ,lcms)
145 ("libjpeg-8" ,libjpeg-8)
146 ("libpng" ,libpng)
147 ("libpaper" ,libpaper)
148 ("libtiff" ,libtiff)
bf4018fb 149 ("zlib" ,zlib)))
c4c4cc05
JD
150 (native-inputs
151 `(("perl" ,perl)
152 ("pkg-config" ,pkg-config) ; needed to find libtiff
153 ("python" ,python-wrapper)
154 ("tcl" ,tcl)))
bf4018fb
AE
155 (arguments
156 `(#:phases
c17b2adf
LC
157 (modify-phases %standard-phases
158 (add-after 'configure 'patch-config-files
159 (lambda _
160 (substitute* "base/all-arch.mak"
161 (("/bin/sh") (which "bash")))
162 (substitute* "base/unixhead.mak"
163 (("/bin/sh") (which "bash")))))
9161ba81
LC
164 (add-after 'configure 'remove-doc-reference
165 (lambda _
166 ;; Don't retain a reference to the 'doc' output in 'gs'.
167 ;; The only use of this definition is in the output of
168 ;; 'gs --help', so this change is fine.
169 (substitute* "base/gscdef.c"
170 (("GS_DOCDIR")
171 "\"~/.guix-profile/share/doc/ghostscript\""))))
c17b2adf
LC
172 (add-after 'build 'build-so
173 (lambda _
174 (zero? (system* "make" "so"))))
175 (add-after 'install 'install-so
176 (lambda _
177 (zero? (system* "make" "install-so")))))))
f50d2669 178 (synopsis "PostScript and PDF interpreter")
bf4018fb 179 (description
a22dc0c4
LC
180 "Ghostscript is an interpreter for the PostScript language and the PDF
181file format. It also includes a C library that implements the graphics
182capabilities of the PostScript language. It supports a wide variety of
183output file formats and printers.")
a6e81858 184 (license license:agpl3+)
bf4018fb 185 (home-page "http://www.gnu.org/software/ghostscript/")))
1f7c6a1f 186
7a75b02a
MW
187(define-public ghostscript/x
188 (package (inherit ghostscript)
189 (name (string-append (package-name ghostscript) "-with-x"))
190 (inputs `(("libxext" ,libxext)
191 ("libxt" ,libxt)
192 ,@(package-inputs ghostscript)))))
193
01aae5fc
RW
194(define-public ijs
195 (package
196 (name "ijs")
197 (version "9.14.0")
198 (source (origin
199 (method url-fetch)
200 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
201 version ".tar.xz"))
202 (sha256 (base32
203 "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1"))))
204 (build-system gnu-build-system)
205 (native-inputs
206 `(("libtool" ,libtool)
207 ("automake" ,automake)
208 ("autoconf" ,autoconf)))
209 (arguments
210 `(#:phases
211 (alist-cons-after
212 'unpack 'autogen
213 (lambda _
214 ;; need to regenerate macros
215 (system* "autoreconf" "-if")
216 ;; do not run configure
217 (substitute* "autogen.sh"
218 (("^.*\\$srcdir/configure.*") ""))
219 (system* "bash" "autogen.sh")
220
221 ;; create configure script in ./ijs/
222 (chdir "ijs")
223 ;; do not run configure
224 (substitute* "autogen.sh"
225 (("^.*\\$srcdir/configure.*") "")
226 (("^ + && echo Now type.*$") ""))
227 (zero? (system* "bash" "autogen.sh")))
228 %standard-phases)))
229 (synopsis "IJS driver framework for inkjet and other raster devices")
230 (description
231 "IJS is a protocol for transmission of raster page images. This package
232provides the reference implementation of the raster printer driver
233architecture.")
234 (license license:expat)
235 (home-page "http://www.gnu.org/software/ghostscript/")))
236
1f7c6a1f
AE
237(define-public gs-fonts
238 (package
239 (name "gs-fonts")
240 (version "8.11")
241 (source (origin
242 (method url-fetch)
243 (uri (string-append "mirror://sourceforge/gs-fonts/gs-fonts/"
244 version
245 "%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-"
246 version
247 ".tar.gz"))
248 (sha256 (base32
249 "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf"))))
250 (build-system gnu-build-system)
251 (arguments
252 `(#:tests? #f ; nothing to check, just files to copy
253 #:modules ((guix build gnu-build-system)
254 (guix build utils)
255 (srfi srfi-1)) ; for alist-delete
256 #:phases
257 (alist-delete
258 'configure
259 (alist-delete
260 'build
261 (alist-replace
262 'install
263 (lambda* (#:key outputs #:allow-other-keys)
264 (let* ((out (assoc-ref outputs "out"))
265 (dir (string-append out "/share/fonts/type1/ghostscript")))
266 (mkdir-p dir)
267 (for-each
268 (lambda (file)
269 (copy-file file (string-append dir "/" file)))
270 (find-files "." "pfb|afm"))))
271 %standard-phases)))))
35b9e423 272 (synopsis "Free replacements for the PostScript fonts")
1f7c6a1f 273 (description
35b9e423
EB
274 "Ghostscript fonts provides fonts and font metrics customarily distributed with
275Ghostscript. It currently includes the 35 standard PostScript fonts.")
1f7c6a1f
AE
276 (license license:gpl2)
277 (home-page "http://sourceforge.net/projects/gs-fonts/")))
c5ea1201 278
7cf2a2a1
AE
279(define-public libspectre
280 (package
281 (name "libspectre")
282 (version "0.2.7")
283 (source (origin
284 (method url-fetch)
285 (uri (string-append "http://libspectre.freedesktop.org/releases/libspectre-"
286 version ".tar.gz"))
287 (sha256 (base32
288 "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8"))))
289 (build-system gnu-build-system)
c4c4cc05
JD
290 (inputs `(("ghostscript" ,ghostscript)))
291 (native-inputs `(("pkg-config" ,pkg-config)))
35b9e423 292 (synopsis "Postscript rendering library")
7cf2a2a1
AE
293 (description
294 "libspectre is a small library for rendering Postscript documents.
295It provides a convenient easy to use API for handling and rendering
296Postscript documents.")
297 (license license:gpl2+)
298 (home-page "http://www.freedesktop.org/wiki/Software/libspectre")))