gnu: Add GNU Ghostscript and its dependencies libpaper and lcms.
[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)
22 #:use-module (gnu packages freetype)
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)
30 #:use-module ((guix licenses) #:renamer (symbol-prefix-proc 'license:))
31 #:use-module (guix packages)
32 #:use-module (guix download)
33 #:use-module (guix build-system gnu))
34
35(define-public lcms
36 (package
37 (name "lcms")
38 (version "2.4")
39 (source (origin
40 (method url-fetch)
41 (uri (string-append
42 "http://downloads.sourceforge.net/project/lcms/lcms/"
43 version "/lcms2-" version ".tar.gz"))
44 (sha256 (base32
45 "1s1ppvqaydf2yqc72mw6zfviwxccb311a6hrbi802sgjxw84sl9a"))))
46 (build-system gnu-build-system)
47 (inputs `(("libjpeg-8" ,libjpeg-8)
48 ("libtiff" ,libtiff)
49 ("zlib" ,zlib)))
50 (synopsis "Little CMS, a small-footprint colour management engine")
51 (description
52 "Little CMS is a small-footprint colour management engine, with special
53focus on accuracy and performance. It uses the International Color
54Consortium standard (ICC), approved as ISO 15076-1.")
55 (license license:x11)
56 (home-page "http://www.littlecms.com/")))
57
58(define-public libpaper
59 (package
60 (name "libpaper")
61 (version "1.1.24")
62 (source (origin
63 (method url-fetch)
64 (uri (string-append
65 "http://ftp.de.debian.org/debian/pool/main/libp/libpaper/libpaper_"
66 version ".tar.gz"))
67 (sha256 (base32
68 "0zhcx67afb6b5r936w5jmaydj3ks8zh83n9rm5sv3m3k8q8jib1q"))))
69 (build-system gnu-build-system)
70 (synopsis "libpaper, a library for handling paper sizes")
71 (description
72 "The paper library and accompanying files are intended to provide a simple
73way for applications to take actions based on a system- or user-specified
74paper size.")
75 (license license:gpl2)
76 (home-page "http://packages.qa.debian.org/libp/libpaper.html")))
77
78(define-public ghostscript
79 (package
80 (name "ghostscript")
81 (version "9.06.0")
82 (source (origin
83 (method url-fetch)
84 (uri (string-append "mirror://gnu/ghostscript/gnu-ghostscript-"
85 version ".tar.xz"))
86 (sha256 (base32
87 "0bcg2203p7cm0f53f3s883xhj2c91xnaxakj2cy7kcdknfxplvs4"))))
88 (build-system gnu-build-system)
89 (inputs `(("freetype" ,freetype)
90 ("lcms" ,lcms)
91 ("libjpeg-8" ,libjpeg-8)
92 ("libpng" ,libpng)
93 ("libpaper" ,libpaper)
94 ("libtiff" ,libtiff)
95 ("perl" ,perl)
96 ("pkg-config" ,pkg-config) ; needed to find libtiff
97 ("python" ,python)
98 ("tcl" ,tcl)
99 ("zlib" ,zlib)))
100 (arguments
101 `(#:phases
102 (alist-replace
103 'configure
104 (lambda* (#:key #:allow-other-keys #:rest args)
105 (let ((configure (assoc-ref %standard-phases 'configure)))
106 (apply configure args)
107 (substitute* "base/all-arch.mak"
108 (("/bin/sh") (which "bash")))
109 (substitute* "base/unixhead.mak"
110 (("/bin/sh") (which "bash")))))
111 %standard-phases)))
112 (synopsis "GNU Ghostscript, an interpreter for the PostScript language and for PDF")
113 (description
114 "GNU Ghostscript is an interpreter for PostScript and Portable Document
115Format (PDF) files.
116It consists of a PostScript interpreter layer, and a graphics
117library.")
118 (license license:gpl3+)
119 (home-page "http://www.gnu.org/software/ghostscript/")))