gnu: ghostscript: Use 'modify-phases'.
[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>
6b282cc9 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
01aae5fc 4;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
c17b2adf 5;;; Copyright © 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)
b5b73a82 32 #:use-module ((guix licenses) #:prefix license:)
bf4018fb
AE
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")
6b282cc9 40 (version "2.6")
bf4018fb
AE
41 (source (origin
42 (method url-fetch)
43 (uri (string-append
10478523 44 "mirror://sourceforge/lcms/lcms2-" version ".tar.gz"))
bf4018fb 45 (sha256 (base32
6b282cc9 46 "1c8lgq8gfs3nyplvbx9k8wzfj6r2bqi3f611vb1m8z3476454wji"))))
bf4018fb
AE
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
35b9e423 54focus on accuracy and performance. It uses the International Color
bf4018fb
AE
55Consortium 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)
35b9e423 71 (synopsis "Library for handling paper sizes")
bf4018fb
AE
72 (description
73 "The paper library and accompanying files are intended to provide a simple
74way for applications to take actions based on a system- or user-specified
75paper size.")
76 (license license:gpl2)
77 (home-page "http://packages.qa.debian.org/libp/libpaper.html")))
78
87ec7a7a
AE
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)))
35b9e423 110 (synopsis "Collection of utilities for manipulating PostScript documents")
87ec7a7a
AE
111 (description
112 "PSUtils is a collection of utilities for manipulating PostScript
35b9e423 113documents. Programs included are psnup, for placing out several logical pages
87ec7a7a
AE
114on a single sheet of paper, psselect, for selecting pages from a document,
115pstops, for general imposition, psbook, for signature generation for booklet
116printing, and psresize, for adjusting page sizes.")
166191b3 117 (license (license:non-copyleft "file://LICENSE"
87ec7a7a
AE
118 "See LICENSE in the distribution."))
119 (home-page "http://knackered.org/angus/psutils/")))
120
bf4018fb
AE
121(define-public ghostscript
122 (package
123 (name "ghostscript")
a6e81858 124 (version "9.14.0")
bf4018fb
AE
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
128 version ".tar.xz"))
129 (sha256 (base32
a6e81858 130 "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1"))))
bf4018fb
AE
131 (build-system gnu-build-system)
132 (inputs `(("freetype" ,freetype)
133 ("lcms" ,lcms)
134 ("libjpeg-8" ,libjpeg-8)
135 ("libpng" ,libpng)
136 ("libpaper" ,libpaper)
137 ("libtiff" ,libtiff)
bf4018fb 138 ("zlib" ,zlib)))
c4c4cc05
JD
139 (native-inputs
140 `(("perl" ,perl)
141 ("pkg-config" ,pkg-config) ; needed to find libtiff
142 ("python" ,python-wrapper)
143 ("tcl" ,tcl)))
bf4018fb
AE
144 (arguments
145 `(#:phases
c17b2adf
LC
146 (modify-phases %standard-phases
147 (add-after 'configure 'patch-config-files
148 (lambda _
149 (substitute* "base/all-arch.mak"
150 (("/bin/sh") (which "bash")))
151 (substitute* "base/unixhead.mak"
152 (("/bin/sh") (which "bash")))))
153 (add-after 'build 'build-so
154 (lambda _
155 (zero? (system* "make" "so"))))
156 (add-after 'install 'install-so
157 (lambda _
158 (zero? (system* "make" "install-so")))))))
f50d2669 159 (synopsis "PostScript and PDF interpreter")
bf4018fb 160 (description
a22dc0c4
LC
161 "Ghostscript is an interpreter for the PostScript language and the PDF
162file format. It also includes a C library that implements the graphics
163capabilities of the PostScript language. It supports a wide variety of
164output file formats and printers.")
a6e81858 165 (license license:agpl3+)
bf4018fb 166 (home-page "http://www.gnu.org/software/ghostscript/")))
1f7c6a1f 167
01aae5fc
RW
168(define-public ijs
169 (package
170 (name "ijs")
171 (version "9.14.0")
172 (source (origin
173 (method url-fetch)
174 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
175 version ".tar.xz"))
176 (sha256 (base32
177 "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1"))))
178 (build-system gnu-build-system)
179 (native-inputs
180 `(("libtool" ,libtool)
181 ("automake" ,automake)
182 ("autoconf" ,autoconf)))
183 (arguments
184 `(#:phases
185 (alist-cons-after
186 'unpack 'autogen
187 (lambda _
188 ;; need to regenerate macros
189 (system* "autoreconf" "-if")
190 ;; do not run configure
191 (substitute* "autogen.sh"
192 (("^.*\\$srcdir/configure.*") ""))
193 (system* "bash" "autogen.sh")
194
195 ;; create configure script in ./ijs/
196 (chdir "ijs")
197 ;; do not run configure
198 (substitute* "autogen.sh"
199 (("^.*\\$srcdir/configure.*") "")
200 (("^ + && echo Now type.*$") ""))
201 (zero? (system* "bash" "autogen.sh")))
202 %standard-phases)))
203 (synopsis "IJS driver framework for inkjet and other raster devices")
204 (description
205 "IJS is a protocol for transmission of raster page images. This package
206provides the reference implementation of the raster printer driver
207architecture.")
208 (license license:expat)
209 (home-page "http://www.gnu.org/software/ghostscript/")))
210
1f7c6a1f
AE
211(define-public gs-fonts
212 (package
213 (name "gs-fonts")
214 (version "8.11")
215 (source (origin
216 (method url-fetch)
217 (uri (string-append "mirror://sourceforge/gs-fonts/gs-fonts/"
218 version
219 "%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-"
220 version
221 ".tar.gz"))
222 (sha256 (base32
223 "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf"))))
224 (build-system gnu-build-system)
225 (arguments
226 `(#:tests? #f ; nothing to check, just files to copy
227 #:modules ((guix build gnu-build-system)
228 (guix build utils)
229 (srfi srfi-1)) ; for alist-delete
230 #:phases
231 (alist-delete
232 'configure
233 (alist-delete
234 'build
235 (alist-replace
236 'install
237 (lambda* (#:key outputs #:allow-other-keys)
238 (let* ((out (assoc-ref outputs "out"))
239 (dir (string-append out "/share/fonts/type1/ghostscript")))
240 (mkdir-p dir)
241 (for-each
242 (lambda (file)
243 (copy-file file (string-append dir "/" file)))
244 (find-files "." "pfb|afm"))))
245 %standard-phases)))))
35b9e423 246 (synopsis "Free replacements for the PostScript fonts")
1f7c6a1f 247 (description
35b9e423
EB
248 "Ghostscript fonts provides fonts and font metrics customarily distributed with
249Ghostscript. It currently includes the 35 standard PostScript fonts.")
1f7c6a1f
AE
250 (license license:gpl2)
251 (home-page "http://sourceforge.net/projects/gs-fonts/")))
c5ea1201 252
7cf2a2a1
AE
253(define-public libspectre
254 (package
255 (name "libspectre")
256 (version "0.2.7")
257 (source (origin
258 (method url-fetch)
259 (uri (string-append "http://libspectre.freedesktop.org/releases/libspectre-"
260 version ".tar.gz"))
261 (sha256 (base32
262 "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8"))))
263 (build-system gnu-build-system)
c4c4cc05
JD
264 (inputs `(("ghostscript" ,ghostscript)))
265 (native-inputs `(("pkg-config" ,pkg-config)))
35b9e423 266 (synopsis "Postscript rendering library")
7cf2a2a1
AE
267 (description
268 "libspectre is a small library for rendering Postscript documents.
269It provides a convenient easy to use API for handling and rendering
270Postscript documents.")
271 (license license:gpl2+)
272 (home-page "http://www.freedesktop.org/wiki/Software/libspectre")))