projects/guix·blob version-0.13.0 · refs

328 lines · 13.1 KiB

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