gnu: ghostscript: Add X support.
[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>
3;;;
4;;; This file is part of GNU Guix.
5;;;
6;;; GNU Guix is free software; you can redistribute it and/or modify it
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
11;;; GNU Guix is distributed in the hope that it will be useful, but
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
18
19(define-module (gnu packages ghostscript)
20 #:use-module (gnu packages)
21 #:use-module (gnu packages compression)
a86177d6 22 #:use-module (gnu packages fontutils)
bf4018fb
AE
23 #:use-module (gnu packages libjpeg)
24 #:use-module (gnu packages libpng)
25 #:use-module (gnu packages libtiff)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages pkg-config)
28 #:use-module (gnu packages python)
29 #:use-module (gnu packages tcl)
e0eb886d 30 #:use-module (gnu packages xorg)
bf4018fb
AE
31 #:use-module ((guix licenses) #:renamer (symbol-prefix-proc 'license:))
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix build-system gnu))
35
36(define-public lcms
37 (package
38 (name "lcms")
39 (version "2.4")
40 (source (origin
41 (method url-fetch)
42 (uri (string-append
43 "http://downloads.sourceforge.net/project/lcms/lcms/"
44 version "/lcms2-" version ".tar.gz"))
45 (sha256 (base32
46 "1s1ppvqaydf2yqc72mw6zfviwxccb311a6hrbi802sgjxw84sl9a"))))
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
54focus on accuracy and performance. It uses the International Color
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)
71 (synopsis "libpaper, a library for handling paper sizes")
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)))
110 (synopsis "psutils, a collection of utilities for manipulating PostScript documents")
111 (description
112 "PSUtils is a collection of utilities for manipulating PostScript
113documents. Programs included are psnup, for placing out several logical pages
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.")
117 (license (license:bsd-style "file://LICENSE"
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")
124 (version "9.06.0")
125 (source (origin
126 (method url-fetch)
127 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
128 version ".tar.xz"))
129 (sha256 (base32
130 "0bcg2203p7cm0f53f3s883xhj2c91xnaxakj2cy7kcdknfxplvs4"))))
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)
e0eb886d
AE
138 ("libxext" ,libxext)
139 ("libxt" ,libxt)
bf4018fb
AE
140 ("perl" ,perl)
141 ("pkg-config" ,pkg-config) ; needed to find libtiff
142 ("python" ,python)
143 ("tcl" ,tcl)
144 ("zlib" ,zlib)))
145 (arguments
146 `(#:phases
147 (alist-replace
148 'configure
149 (lambda* (#:key #:allow-other-keys #:rest args)
150 (let ((configure (assoc-ref %standard-phases 'configure)))
151 (apply configure args)
152 (substitute* "base/all-arch.mak"
153 (("/bin/sh") (which "bash")))
154 (substitute* "base/unixhead.mak"
155 (("/bin/sh") (which "bash")))))
2b902c3c
AE
156 (alist-replace
157 'build
158 (lambda* (#:key #:allow-other-keys #:rest args)
159 (let ((build (assoc-ref %standard-phases 'build)))
160 (apply build args)
161 (system* "make" "so")))
162 (alist-replace
163 'install
164 (lambda* (#:key #:allow-other-keys #:rest args)
165 (let ((install (assoc-ref %standard-phases 'install)))
166 (apply install args)
167 (system* "make" "install-so")))
168 %standard-phases)))))
f50d2669 169 (synopsis "PostScript and PDF interpreter")
bf4018fb
AE
170 (description
171 "GNU Ghostscript is an interpreter for PostScript and Portable Document
172Format (PDF) files.
173It consists of a PostScript interpreter layer, and a graphics
174library.")
175 (license license:gpl3+)
176 (home-page "http://www.gnu.org/software/ghostscript/")))
1f7c6a1f
AE
177
178(define-public gs-fonts
179 (package
180 (name "gs-fonts")
181 (version "8.11")
182 (source (origin
183 (method url-fetch)
184 (uri (string-append "mirror://sourceforge/gs-fonts/gs-fonts/"
185 version
186 "%20%28base%2035%2C%20GPL%29/ghostscript-fonts-std-"
187 version
188 ".tar.gz"))
189 (sha256 (base32
190 "00f4l10xd826kak51wsmaz69szzm2wp8a41jasr4jblz25bg7dhf"))))
191 (build-system gnu-build-system)
192 (arguments
193 `(#:tests? #f ; nothing to check, just files to copy
194 #:modules ((guix build gnu-build-system)
195 (guix build utils)
196 (srfi srfi-1)) ; for alist-delete
197 #:phases
198 (alist-delete
199 'configure
200 (alist-delete
201 'build
202 (alist-replace
203 'install
204 (lambda* (#:key outputs #:allow-other-keys)
205 (let* ((out (assoc-ref outputs "out"))
206 (dir (string-append out "/share/fonts/type1/ghostscript")))
207 (mkdir-p dir)
208 (for-each
209 (lambda (file)
210 (copy-file file (string-append dir "/" file)))
211 (find-files "." "pfb|afm"))))
212 %standard-phases)))))
213 (synopsis "free replacements for the PostScript fonts")
214 (description
215 "gs-fonts provides fonts and font metrics customarily distributed with
216Ghostscript. It currently includes the 35 standard PostScript fonts.")
217 (license license:gpl2)
218 (home-page "http://sourceforge.net/projects/gs-fonts/")))