1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2013, 2015 Ludovic Courtès <ludo@gnu.org>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 (gnu packages xorg)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix packages)
35 #:use-module (guix download)
36 #:use-module (guix build-system gnu))
45 "mirror://sourceforge/lcms/lcms2-" version ".tar.gz"))
47 "1c8lgq8gfs3nyplvbx9k8wzfj6r2bqi3f611vb1m8z3476454wji"))))
48 (build-system gnu-build-system)
49 (inputs `(("libjpeg-8" ,libjpeg-8)
52 (synopsis "Little CMS, a small-footprint colour management engine")
54 "Little CMS is a small-footprint colour management engine, with special
55 focus on accuracy and performance. It uses the International Color
56 Consortium standard (ICC), approved as ISO 15076-1.")
58 (home-page "http://www.littlecms.com/")))
60 (define-public libpaper
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_"
73 "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
74 (build-system gnu-build-system)
75 (synopsis "Library for handling paper sizes")
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
80 (license license:gpl2)
81 (home-page "https://packages.qa.debian.org/libp/libpaper.html")))
83 (define-public psutils
89 (uri "ftp://ftp.knackered.org/pub/psutils/psutils.tar.gz")
91 "1r4ab1fvgganm02kmm70b2r1azwzbav2am41gbigpa2bb1wynlrq"))))
92 (build-system gnu-build-system)
93 (inputs `(("perl" ,perl)))
95 `(#:tests? #f ; none provided
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") ""))))
114 (synopsis "Collection of utilities for manipulating PostScript documents")
116 "PSUtils is a collection of utilities for manipulating PostScript
117 documents. Programs included are psnup, for placing out several logical pages
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.")
121 (license (license:non-copyleft "file://LICENSE"
122 "See LICENSE in the distribution."))
123 (home-page "http://knackered.org/angus/psutils/")))
125 (define-public ghostscript
131 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
135 "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1"))
136 (patches (search-patches "ghostscript-CVE-2015-3228.patch"
137 "ghostscript-runpath.patch"))
138 (modules '((guix build utils)))
141 '(substitute* "Makefile.in"
142 (("^docdir=.*$") "docdir = @docdir@\n")
143 (("^exdir=.*$") "exdir = $(docdir)/examples\n")))))
144 (build-system gnu-build-system)
145 (outputs '("out" "doc")) ;16 MiB of HTML/PS doc + examples
146 (inputs `(("freetype" ,freetype)
148 ("libjpeg-8" ,libjpeg-8)
150 ("libpaper" ,libpaper)
155 ("pkg-config" ,pkg-config) ; needed to find libtiff
156 ("python" ,python-wrapper)
160 (modify-phases %standard-phases
161 (add-after 'configure 'patch-config-files
163 (substitute* "base/all-arch.mak"
164 (("/bin/sh") (which "bash")))
165 (substitute* "base/unixhead.mak"
166 (("/bin/sh") (which "bash")))))
167 (add-after 'configure 'remove-doc-reference
169 ;; Don't retain a reference to the 'doc' output in 'gs'.
170 ;; The only use of this definition is in the output of
171 ;; 'gs --help', so this change is fine.
172 (substitute* "base/gscdef.c"
174 "\"~/.guix-profile/share/doc/ghostscript\""))))
175 (add-after 'build 'build-so
177 (zero? (system* "make" "so"))))
178 (add-after 'install 'install-so
180 (zero? (system* "make" "install-so")))))))
181 (synopsis "PostScript and PDF interpreter")
183 "Ghostscript is an interpreter for the PostScript language and the PDF
184 file format. It also includes a C library that implements the graphics
185 capabilities of the PostScript language. It supports a wide variety of
186 output file formats and printers.")
187 (license license:agpl3+)
188 (home-page "http://www.gnu.org/software/ghostscript/")))
190 (define-public ghostscript/x
191 (package (inherit ghostscript)
192 (name (string-append (package-name ghostscript) "-with-x"))
193 (inputs `(("libxext" ,libxext)
195 ,@(package-inputs ghostscript)))))
203 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
206 "0q4jj41p0qbr4mgcc9q78f5zs8cm1g57wgryhsm2yq4lfslm3ib1"))))
207 (build-system gnu-build-system)
209 `(("libtool" ,libtool)
210 ("automake" ,automake)
211 ("autoconf" ,autoconf)))
217 ;; need to regenerate macros
218 (system* "autoreconf" "-if")
219 ;; do not run configure
220 (substitute* "autogen.sh"
221 (("^.*\\$srcdir/configure.*") ""))
222 (system* "bash" "autogen.sh")
224 ;; create configure script in ./ijs/
226 ;; do not run configure
227 (substitute* "autogen.sh"
228 (("^.*\\$srcdir/configure.*") "")
229 (("^ + && echo Now type.*$") ""))
230 (zero? (system* "bash" "autogen.sh")))
232 (synopsis "IJS driver framework for inkjet and other raster devices")
234 "IJS is a protocol for transmission of raster page images. This package
235 provides the reference implementation of the raster printer driver
237 (license license:expat)
238 (home-page "http://www.gnu.org/software/ghostscript/")))
240 (define-public gs-fonts
246 (uri (string-append "mirror://sourceforge/gs-fonts/gs-fonts/"
248 "%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-"
252 "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf"))))
253 (build-system gnu-build-system)
255 `(#:tests? #f ; nothing to check, just files to copy
256 #:modules ((guix build gnu-build-system)
258 (srfi srfi-1)) ; for alist-delete
266 (lambda* (#:key outputs #:allow-other-keys)
267 (let* ((out (assoc-ref outputs "out"))
268 (dir (string-append out "/share/fonts/type1/ghostscript")))
272 (copy-file file (string-append dir "/" file)))
273 (find-files "." "pfb|afm"))))
274 %standard-phases)))))
275 (synopsis "Free replacements for the PostScript fonts")
277 "Ghostscript fonts provides fonts and font metrics customarily distributed with
278 Ghostscript. It currently includes the 35 standard PostScript fonts.")
279 (license license:gpl2)
280 (home-page "http://sourceforge.net/projects/gs-fonts/")))
282 (define-public libspectre
288 (uri (string-append "https://libspectre.freedesktop.org/releases/libspectre-"
291 "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8"))))
292 (build-system gnu-build-system)
293 (inputs `(("ghostscript" ,ghostscript)))
294 (native-inputs `(("pkg-config" ,pkg-config)))
295 (synopsis "Postscript rendering library")
297 "libspectre is a small library for rendering Postscript documents.
298 It provides a convenient easy to use API for handling and rendering
299 Postscript documents.")
300 (license license:gpl2+)
301 (home-page "http://www.freedesktop.org/wiki/Software/libspectre")))