gnu: Move numerous "inputs" which should be "native-inputs".
[jackhill/guix/guix.git] / gnu / packages / pdf.scm
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 pdf)
20 #:use-module ((guix licenses)
21 #:renamer (symbol-prefix-proc 'license:))
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages compression)
27 #:use-module (gnu packages fontutils)
28 #:use-module (gnu packages ghostscript)
29 #:use-module (gnu packages lesstif)
30 #:use-module (gnu packages libjpeg)
31 #:use-module (gnu packages libpng)
32 #:use-module (gnu packages libtiff)
33 #:use-module (gnu packages pkg-config)
34 #:use-module (gnu packages xorg)
35 #:use-module (gnu packages glib)
36 #:use-module (gnu packages gtk)
37 #:use-module (srfi srfi-1))
38
39 (define-public poppler
40 (package
41 (name "poppler")
42 (version "0.22.0")
43 (source (origin
44 (method url-fetch)
45 (uri (string-append "http://poppler.freedesktop.org/poppler-"
46 version ".tar.gz"))
47 (sha256 (base32
48 "1rmrspavldlpqi6g76fijcmshy80m0kxd01nc1dmy4id3h4las44"))))
49 (build-system gnu-build-system)
50 ;; FIXME: more dependencies could be added
51 ;; cairo output: no (requires cairo >= 1.10.0)
52 ;; qt4 wrapper: no
53 ;; introspection: no
54 ;; use gtk-doc: no
55 ;; use libcurl: no
56 ;; use libopenjpeg: no
57 (inputs `(("fontconfig" ,fontconfig)
58 ("freetype" ,freetype)
59 ("libjpeg-8" ,libjpeg-8)
60 ("libpng" ,libpng)
61 ("libtiff" ,libtiff)
62 ("zlib" ,zlib)
63
64 ;; To build poppler-glib (as needed by Evince), we need Cairo and
65 ;; GLib. But of course, that Cairo must not depend on Poppler.
66 ("cairo" ,(package (inherit cairo)
67 (inputs (alist-delete "poppler"
68 (package-inputs cairo)))))
69 ("glib" ,glib)))
70 (native-inputs
71 `(("pkg-config" ,pkg-config)))
72 (arguments
73 `(#:tests? #f ; no test data provided with the tarball
74 #:configure-flags
75 '("--enable-xpdf-headers" ; to install header files
76 "--enable-zlib")))
77 (synopsis "Poppler, a pdf rendering library")
78 (description
79 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
80 (license license:gpl2+)
81 (home-page "http://poppler.freedesktop.org/")))
82
83 (define-public xpdf
84 (package
85 (name "xpdf")
86 (version "3.03")
87 (source (origin
88 (method url-fetch)
89 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
90 version ".tar.gz"))
91 (sha256 (base32
92 "1jnfzdqc54wa73lw28kjv0m7120mksb0zkcn81jdlvijyvc67kq2"))
93 (patches (list (search-patch "xpdf-constchar.patch")))))
94 (build-system gnu-build-system)
95 (inputs `(("freetype" ,freetype)
96 ("gs-fonts" ,gs-fonts)
97 ("lesstif" ,lesstif)
98 ("libpaper" ,libpaper)
99 ("libx11" ,libx11)
100 ("libxext" ,libxext)
101 ("libxp" ,libxp)
102 ("libxpm" ,libxpm)
103 ("libxt" ,libxt)
104 ("zlib" ,zlib)))
105 (arguments
106 `(#:tests? #f ; there is no check target
107 #:phases
108 (alist-replace
109 'install
110 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
111 (let* ((install (assoc-ref %standard-phases 'install))
112 (out (assoc-ref outputs "out"))
113 (xpdfrc (string-append out "/etc/xpdfrc"))
114 (gs-fonts (assoc-ref inputs "gs-fonts")))
115 (apply install args)
116 (substitute* xpdfrc
117 (("/usr/local/share/ghostscript/fonts")
118 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
119 (("#fontFile") "fontFile"))))
120 %standard-phases)))
121 (synopsis "Viewer for pdf files based on the Motif toolkit.")
122 (description
123 "Xpdf is a viewer for Portable Document Format (PDF) files")
124 (license license:gpl3) ; or gpl2, but not gpl2+
125 (home-page "http://www.foolabs.com/xpdf/")))