Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / ghostscript.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Ludovic Courtès <ludo@gnu.org>
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)
24 #:use-module (gnu packages autotools)
25 #:use-module (gnu packages compression)
26 #:use-module (gnu packages fontutils)
27 #:use-module (gnu packages image)
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)
32 #:use-module ((guix licenses) #:prefix license:)
33 #:use-module (guix packages)
34 #:use-module (guix download)
35 #:use-module (guix build-system gnu))
36
37 (define-public lcms
38 (package
39 (name "lcms")
40 (version "2.6")
41 (source (origin
42 (method url-fetch)
43 (uri (string-append
44 "mirror://sourceforge/lcms/lcms2-" version ".tar.gz"))
45 (sha256 (base32
46 "1c8lgq8gfs3nyplvbx9k8wzfj6r2bqi3f611vb1m8z3476454wji"))))
47 (build-system gnu-build-system)
48 (inputs `(("libjpeg-8" ,libjpeg-8)
49 ("libtiff" ,libtiff)
50 ("zlib" ,zlib)))
51 (synopsis "Little CMS, a small-footprint colour management engine")
52 (description
53 "Little CMS is a small-footprint colour management engine, with special
54 focus on accuracy and performance. It uses the International Color
55 Consortium standard (ICC), approved as ISO 15076-1.")
56 (license license:x11)
57 (home-page "http://www.littlecms.com/")))
58
59 (define-public libpaper
60 (package
61 (name "libpaper")
62 (version "1.1.24")
63 (source (origin
64 (method url-fetch)
65 (uri (string-append
66 "http://ftp.de.debian.org/debian/pool/main/libp/libpaper/libpaper_"
67 version ".tar.gz"))
68 (sha256 (base32
69 "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
70 (build-system gnu-build-system)
71 (synopsis "Library for handling paper sizes")
72 (description
73 "The paper library and accompanying files are intended to provide a simple
74 way for applications to take actions based on a system- or user-specified
75 paper size.")
76 (license license:gpl2)
77 (home-page "http://packages.qa.debian.org/libp/libpaper.html")))
78
79 (define-public psutils
80 (package
81 (name "psutils")
82 (version "17")
83 (source (origin
84 (method url-fetch)
85 (uri "ftp://ftp.knackered.org/pub/psutils/psutils.tar.gz")
86 (sha256 (base32
87 "1r4ab1fvgganm02kmm70b2r1azwzbav2am41gbigpa2bb1wynlrq"))))
88 (build-system gnu-build-system)
89 (inputs `(("perl" ,perl)))
90 (arguments
91 `(#:tests? #f ; none provided
92 #:phases
93 (alist-replace
94 'configure
95 (lambda* (#:key inputs outputs #:allow-other-keys #:rest args)
96 (let ((perl (assoc-ref inputs "perl"))
97 (out (assoc-ref outputs "out")))
98 (copy-file "Makefile.unix" "Makefile")
99 (substitute* "Makefile"
100 (("/usr/local/bin/perl") (string-append perl "/bin/perl")))
101 (substitute* "Makefile"
102 (("/usr/local") out))
103 ;; for the install phase
104 (substitute* "Makefile"
105 (("-mkdir") "mkdir -p"))
106 ;; drop installation of non-free files
107 (substitute* "Makefile"
108 ((" install.include") ""))))
109 %standard-phases)))
110 (synopsis "Collection of utilities for manipulating PostScript documents")
111 (description
112 "PSUtils is a collection of utilities for manipulating PostScript
113 documents. Programs included are psnup, for placing out several logical pages
114 on a single sheet of paper, psselect, for selecting pages from a document,
115 pstops, for general imposition, psbook, for signature generation for booklet
116 printing, and psresize, for adjusting page sizes.")
117 (license (license:non-copyleft "file://LICENSE"
118 "See LICENSE in the distribution."))
119 (home-page "http://knackered.org/angus/psutils/")))
120
121 (define-public ghostscript
122 (package
123 (name "ghostscript")
124 (version "9.14.0")
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
128 version ".tar.xz"))
129 (sha256
130 (base32
131 "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1"))
132 (patches (list (search-patch "ghostscript-runpath.patch")))))
133 (build-system gnu-build-system)
134 (inputs `(("freetype" ,freetype)
135 ("lcms" ,lcms)
136 ("libjpeg-8" ,libjpeg-8)
137 ("libpng" ,libpng)
138 ("libpaper" ,libpaper)
139 ("libtiff" ,libtiff)
140 ("zlib" ,zlib)))
141 (native-inputs
142 `(("perl" ,perl)
143 ("pkg-config" ,pkg-config) ; needed to find libtiff
144 ("python" ,python-wrapper)
145 ("tcl" ,tcl)))
146 (arguments
147 `(#:phases
148 (modify-phases %standard-phases
149 (add-after 'configure 'patch-config-files
150 (lambda _
151 (substitute* "base/all-arch.mak"
152 (("/bin/sh") (which "bash")))
153 (substitute* "base/unixhead.mak"
154 (("/bin/sh") (which "bash")))))
155 (add-after 'build 'build-so
156 (lambda _
157 (zero? (system* "make" "so"))))
158 (add-after 'install 'install-so
159 (lambda _
160 (zero? (system* "make" "install-so")))))))
161 (synopsis "PostScript and PDF interpreter")
162 (description
163 "Ghostscript is an interpreter for the PostScript language and the PDF
164 file format. It also includes a C library that implements the graphics
165 capabilities of the PostScript language. It supports a wide variety of
166 output file formats and printers.")
167 (license license:agpl3+)
168 (home-page "http://www.gnu.org/software/ghostscript/")))
169
170 (define-public ijs
171 (package
172 (name "ijs")
173 (version "9.14.0")
174 (source (origin
175 (method url-fetch)
176 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
177 version ".tar.xz"))
178 (sha256 (base32
179 "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1"))))
180 (build-system gnu-build-system)
181 (native-inputs
182 `(("libtool" ,libtool)
183 ("automake" ,automake)
184 ("autoconf" ,autoconf)))
185 (arguments
186 `(#:phases
187 (alist-cons-after
188 'unpack 'autogen
189 (lambda _
190 ;; need to regenerate macros
191 (system* "autoreconf" "-if")
192 ;; do not run configure
193 (substitute* "autogen.sh"
194 (("^.*\\$srcdir/configure.*") ""))
195 (system* "bash" "autogen.sh")
196
197 ;; create configure script in ./ijs/
198 (chdir "ijs")
199 ;; do not run configure
200 (substitute* "autogen.sh"
201 (("^.*\\$srcdir/configure.*") "")
202 (("^ + && echo Now type.*$") ""))
203 (zero? (system* "bash" "autogen.sh")))
204 %standard-phases)))
205 (synopsis "IJS driver framework for inkjet and other raster devices")
206 (description
207 "IJS is a protocol for transmission of raster page images. This package
208 provides the reference implementation of the raster printer driver
209 architecture.")
210 (license license:expat)
211 (home-page "http://www.gnu.org/software/ghostscript/")))
212
213 (define-public gs-fonts
214 (package
215 (name "gs-fonts")
216 (version "8.11")
217 (source (origin
218 (method url-fetch)
219 (uri (string-append "mirror://sourceforge/gs-fonts/gs-fonts/"
220 version
221 "%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-"
222 version
223 ".tar.gz"))
224 (sha256 (base32
225 "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf"))))
226 (build-system gnu-build-system)
227 (arguments
228 `(#:tests? #f ; nothing to check, just files to copy
229 #:modules ((guix build gnu-build-system)
230 (guix build utils)
231 (srfi srfi-1)) ; for alist-delete
232 #:phases
233 (alist-delete
234 'configure
235 (alist-delete
236 'build
237 (alist-replace
238 'install
239 (lambda* (#:key outputs #:allow-other-keys)
240 (let* ((out (assoc-ref outputs "out"))
241 (dir (string-append out "/share/fonts/type1/ghostscript")))
242 (mkdir-p dir)
243 (for-each
244 (lambda (file)
245 (copy-file file (string-append dir "/" file)))
246 (find-files "." "pfb|afm"))))
247 %standard-phases)))))
248 (synopsis "Free replacements for the PostScript fonts")
249 (description
250 "Ghostscript fonts provides fonts and font metrics customarily distributed with
251 Ghostscript. It currently includes the 35 standard PostScript fonts.")
252 (license license:gpl2)
253 (home-page "http://sourceforge.net/projects/gs-fonts/")))
254
255 (define-public libspectre
256 (package
257 (name "libspectre")
258 (version "0.2.7")
259 (source (origin
260 (method url-fetch)
261 (uri (string-append "http://libspectre.freedesktop.org/releases/libspectre-"
262 version ".tar.gz"))
263 (sha256 (base32
264 "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8"))))
265 (build-system gnu-build-system)
266 (inputs `(("ghostscript" ,ghostscript)))
267 (native-inputs `(("pkg-config" ,pkg-config)))
268 (synopsis "Postscript rendering library")
269 (description
270 "libspectre is a small library for rendering Postscript documents.
271 It provides a convenient easy to use API for handling and rendering
272 Postscript documents.")
273 (license license:gpl2+)
274 (home-page "http://www.freedesktop.org/wiki/Software/libspectre")))