gnu packages: Avoid description lines with leading "(".
[jackhill/guix/guix.git] / gnu / packages / pdf.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014, 2015 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
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.
13 ;;;
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.
18 ;;;
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/>.
21
22 (define-module (gnu packages pdf)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system cmake)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages compression)
30 #:use-module (gnu packages fontutils)
31 #:use-module (gnu packages ghostscript)
32 #:use-module (gnu packages databases)
33 #:use-module (gnu packages djvu)
34 #:use-module (gnu packages gettext)
35 #:use-module (gnu packages backup)
36 #:use-module (gnu packages lesstif)
37 #:use-module (gnu packages image)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages xorg)
40 #:use-module (gnu packages gnome)
41 #:use-module (gnu packages glib)
42 #:use-module (gnu packages gtk)
43 #:use-module (gnu packages lua)
44 #:use-module (gnu packages curl)
45 #:use-module (gnu packages pcre)
46 #:use-module (gnu packages perl)
47 #:use-module (gnu packages tls)
48 #:use-module (srfi srfi-1))
49
50 (define-public poppler
51 (package
52 (name "poppler")
53 (version "0.32.0")
54 (source (origin
55 (method url-fetch)
56 (uri (string-append "http://poppler.freedesktop.org/poppler-"
57 version ".tar.xz"))
58 (sha256 (base32
59 "162vfbvbz0frvqyk00ldsbl49h4bj8i8wn0ngfl30xg1lldy6qs9"))))
60 (build-system gnu-build-system)
61 ;; FIXME: more dependencies could be added
62 ;; cairo output: no (requires cairo >= 1.10.0)
63 ;; qt4 wrapper: no
64 ;; introspection: no
65 ;; use gtk-doc: no
66 ;; use libcurl: no
67 (inputs `(("fontconfig" ,fontconfig)
68 ("freetype" ,freetype)
69 ("libjpeg-8" ,libjpeg-8)
70 ("libpng" ,libpng)
71 ("libtiff" ,libtiff)
72 ("lcms" ,lcms)
73 ("openjpeg-1" ,openjpeg-1)
74 ("zlib" ,zlib)
75
76 ;; To build poppler-glib (as needed by Evince), we need Cairo and
77 ;; GLib. But of course, that Cairo must not depend on Poppler.
78 ("cairo" ,(package (inherit cairo)
79 (inputs (alist-delete "poppler"
80 (package-inputs cairo)))))
81 ("glib" ,glib)))
82 (native-inputs
83 `(("pkg-config" ,pkg-config)
84 ("glib" ,glib "bin"))) ; glib-mkenums, etc.
85 (arguments
86 `(#:tests? #f ; no test data provided with the tarball
87 #:configure-flags
88 '("--enable-libopenjpeg"
89 "--enable-xpdf-headers" ; to install header files
90 "--enable-zlib")
91 #:phases
92 (alist-cons-before
93 'configure 'setenv
94 (lambda _
95 (setenv "CPATH"
96 (string-append (assoc-ref %build-inputs "openjpeg-1")
97 "/include/openjpeg-1.5"
98 ":" (or (getenv "CPATH") ""))))
99 %standard-phases)))
100 (synopsis "PDF rendering library")
101 (description
102 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
103 (license license:gpl2+)
104 (home-page "http://poppler.freedesktop.org/")))
105
106 (define-public xpdf
107 (package
108 (name "xpdf")
109 (version "3.04")
110 (source (origin
111 (method url-fetch)
112 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
113 version ".tar.gz"))
114 (sha256 (base32
115 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
116 (build-system gnu-build-system)
117 (inputs `(("freetype" ,freetype)
118 ("gs-fonts" ,gs-fonts)
119 ("lesstif" ,lesstif)
120 ("libpaper" ,libpaper)
121 ("libx11" ,libx11)
122 ("libxext" ,libxext)
123 ("libxp" ,libxp)
124 ("libxpm" ,libxpm)
125 ("libxt" ,libxt)
126 ("libpng" ,libpng)
127 ("zlib" ,zlib)))
128 (arguments
129 `(#:tests? #f ; there is no check target
130 #:parallel-build? #f ; build fails randomly on 8-way machines
131 #:configure-flags
132 (list (string-append "--with-freetype2-includes="
133 (assoc-ref %build-inputs "freetype")
134 "/include/freetype2"))
135 #:phases
136 (alist-replace
137 'install
138 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
139 (let* ((install (assoc-ref %standard-phases 'install))
140 (out (assoc-ref outputs "out"))
141 (xpdfrc (string-append out "/etc/xpdfrc"))
142 (gs-fonts (assoc-ref inputs "gs-fonts")))
143 (apply install args)
144 (substitute* xpdfrc
145 (("/usr/local/share/ghostscript/fonts")
146 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
147 (("#fontFile") "fontFile"))))
148 %standard-phases)))
149 (synopsis "Viewer for PDF files based on the Motif toolkit")
150 (description
151 "Xpdf is a viewer for Portable Document Format (PDF) files")
152 (license license:gpl3) ; or gpl2, but not gpl2+
153 (home-page "http://www.foolabs.com/xpdf/")))
154
155 (define-public zathura-cb
156 (package
157 (name "zathura-cb")
158 (version "0.1.4")
159 (source (origin
160 (method url-fetch)
161 (uri
162 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
163 version ".tar.gz"))
164 (sha256
165 (base32
166 "09ln4fpjxmhcq6cw1ka7mdkmca36gyd4gzrynbw3waz0ri0b277j"))))
167 (native-inputs `(("pkg-config" ,pkg-config)))
168 (propagated-inputs `(("girara" ,girara)))
169 (inputs `(("libarchive" ,libarchive)
170 ("gtk+" ,gtk+)
171 ("zathura" ,zathura)))
172 (build-system gnu-build-system)
173 (arguments
174 `(#:make-flags (list (string-append "PREFIX=" %output)
175 (string-append "PLUGINDIR=" %output "/lib/zathura")
176 "CC=gcc")
177 #:tests? #f ; Package does not contain tests.
178 #:phases
179 (alist-delete 'configure %standard-phases)))
180 (home-page "https://pwmt.org/projects/zathura-cb/")
181 (synopsis "Comic book support for zathura (libarchive backend)")
182 (description "The zathura-cb plugin adds comic book support to zathura
183 using libarchive.")
184 (license license:zlib)))
185
186 (define-public zathura-ps
187 (package
188 (name "zathura-ps")
189 (version "0.2.2")
190 (source (origin
191 (method url-fetch)
192 (uri
193 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
194 version ".tar.gz"))
195 (sha256
196 (base32
197 "1a6ps5v1wk18qvslbkjln6w8wfzzr6fi13ls96vbdc03vdhn4m76"))))
198 (native-inputs `(("pkg-config" ,pkg-config)))
199 (propagated-inputs `(("girara" ,girara)))
200 (inputs `(("libspectre" ,libspectre)
201 ("gtk+" ,gtk+)
202 ("zathura" ,zathura)))
203 (build-system gnu-build-system)
204 (arguments
205 `(#:make-flags (list (string-append "PREFIX=" %output)
206 (string-append "PLUGINDIR=" %output "/lib/zathura")
207 "CC=gcc")
208 #:tests? #f ; Package does not contain tests.
209 #:phases
210 (alist-delete 'configure %standard-phases)))
211 (home-page "https://pwmt.org/projects/zathura-ps/")
212 (synopsis "PS support for zathura (libspectre backend)")
213 (description "The zathura-ps plugin adds PS support to zathura
214 using libspectre.")
215 (license license:zlib)))
216
217 (define-public zathura-djvu
218 (package
219 (name "zathura-djvu")
220 (version "0.2.4")
221 (source (origin
222 (method url-fetch)
223 (uri
224 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
225 version ".tar.gz"))
226 (sha256
227 (base32
228 "1g1lafmrjbx0xv7fljdmyqxx0k334sq4q6jy4a0q5xfrgz0bh45c"))))
229 (native-inputs `(("pkg-config" ,pkg-config)))
230 (propagated-inputs `(("girara" ,girara)))
231 (inputs
232 `(("djvulibre" ,djvulibre)
233 ("gtk+" ,gtk+)
234 ("zathura" ,zathura)))
235 (build-system gnu-build-system)
236 (arguments
237 `(#:make-flags (list (string-append "PREFIX=" %output)
238 (string-append "PLUGINDIR=" %output "/lib/zathura")
239 "CC=gcc")
240 #:tests? #f ; Package does not contain tests.
241 #:phases
242 (alist-delete 'configure %standard-phases)))
243 (home-page "https://pwmt.org/projects/zathura-djvu/")
244 (synopsis "DjVu support for zathura (DjVuLibre backend)")
245 (description "The zathura-djvu plugin adds DjVu support to zathura
246 using the DjVuLibre library.")
247 (license license:zlib)))
248
249 (define-public zathura-pdf-poppler
250 (package
251 (name "zathura-pdf-poppler")
252 (version "0.2.5")
253 (source (origin
254 (method url-fetch)
255 (uri
256 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
257 version ".tar.gz"))
258 (sha256
259 (base32
260 "1b0chsds8iwjm4g629p6a67nb6wgra65pw2vvngd7g35dmcjgcv0"))))
261 (native-inputs `(("pkg-config" ,pkg-config)))
262 (propagated-inputs `(("girara" ,girara)))
263 (inputs
264 `(("poppler" ,poppler)
265 ("gtk+" ,gtk+)
266 ("zathura" ,zathura)
267 ("cairo" ,cairo)))
268 (build-system gnu-build-system)
269 (arguments
270 `(#:make-flags (list (string-append "PREFIX=" %output)
271 (string-append "PLUGINDIR=" %output "/lib/zathura")
272 "CC=gcc")
273 #:tests? #f ; Package does not include tests.
274 #:phases
275 (alist-delete 'configure %standard-phases)))
276 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
277 (synopsis "PDF support for zathura (poppler backend)")
278 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
279 by using the poppler rendering engine.")
280 (license license:zlib)))
281
282 (define-public zathura
283 (package
284 (name "zathura")
285 (version "0.3.3")
286 (source (origin
287 (method url-fetch)
288 (uri
289 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
290 version ".tar.gz"))
291 (sha256
292 (base32
293 "1rywx09qn6ap5hb1z31wxby4lzdrqdbldm51pjk1ifflr37xwirk"))
294 (patches
295 (list
296 (search-patch "zathura-plugindir-environment-variable.patch")))))
297 (native-inputs `(("pkg-config" ,pkg-config)
298 ("gettext" ,gnu-gettext)))
299 (inputs `(("girara" ,girara)
300 ("sqlite" ,sqlite)
301 ("gtk+" ,gtk+)))
302 (native-search-paths
303 (list (search-path-specification
304 (variable "ZATHURA_PLUGIN_PATH")
305 (files '("lib/zathura")))))
306 (build-system gnu-build-system)
307 (arguments
308 `(#:make-flags
309 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
310 "CC=gcc" "COLOR=0")
311 #:tests? #f ; Tests fail: "Gtk cannot open display".
312 #:test-target "test"
313 #:phases
314 (alist-delete 'configure %standard-phases)))
315 (home-page "https://pwmt.org/projects/zathura/")
316 (synopsis "Lightweight keyboard-driven PDF viewer")
317 (description "Zathura is a customizable document viewer. It provides a
318 minimalistic interface and an interface that mainly focuses on keyboard
319 interaction.")
320 (license license:zlib)))
321
322 (define-public podofo
323 (package
324 (name "podofo")
325 (version "0.9.3")
326 (source (origin
327 (method url-fetch)
328 (uri (string-append "mirror://sourceforge/podofo/podofo-"
329 version ".tar.gz"))
330 (sha256
331 (base32
332 "1n12lbq9x15vqn7dc0hsccp56l5jdff1xrhvlfqlbklxx0qiw9pc"))))
333 (build-system cmake-build-system)
334 (inputs ; TODO: Add cppunit for tests
335 `(("lua" ,lua-5.1)
336 ("libpng" ,libpng)
337 ("openssl" ,openssl)
338 ("fontconfig" ,fontconfig)
339 ("libtiff" ,libtiff)
340 ("libjpeg" ,libjpeg-8)
341 ("freetype" ,freetype)
342 ("zlib" ,zlib)))
343 (arguments
344 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
345 "-DPODOFO_BUILD_STATIC=ON")
346 #:phases
347 (alist-cons-before
348 'configure 'patch
349 (lambda* (#:key inputs #:allow-other-keys)
350 (let ((freetype (assoc-ref inputs "freetype")))
351 ;; Look for freetype include files in the correct place.
352 (substitute* "cmake/modules/FindFREETYPE.cmake"
353 (("/usr/local") freetype))))
354 %standard-phases)))
355 (home-page "http://podofo.sourceforge.net")
356 (synopsis "Tools to work with the PDF file format")
357 (description
358 "PoDoFo is a C++ library and set of command-line tools to work with the
359 PDF file format. It can parse PDF files and load them into memory, and makes
360 it easy to modify them and write the changes to disk. It is primarily useful
361 for applications that wish to do lower level manipulation of PDF, such as
362 extracting content or merging files.")
363 (license license:lgpl2.0+)))
364
365 (define-public mupdf
366 (package
367 (name "mupdf")
368 (version "1.6")
369 (source
370 (origin
371 (method url-fetch)
372 (uri (string-append "http://mupdf.com/downloads/archive/"
373 name "-" version "-source.tar.gz"))
374 (sha256
375 (base32 "0qx51rj6alzcagcixm59rvdpm54w6syrwr4184v439jh14ryw4wq"))
376 (patches
377 (list (search-patch "mupdf-buildsystem-fix.patch")))
378 (modules '((guix build utils)))
379 (snippet
380 '(begin
381 ;; Don't build the bundled-in third party libraries.
382 (delete-file-recursively "thirdparty")
383
384 ;; Make the scripts for finding openjpeg build details executable.
385 (chmod "ojp2_cppflags.sh" #o0755)
386 (chmod "ojp2_ldflags.sh" #o0755)))))
387
388 (build-system gnu-build-system)
389 (inputs
390 `(("curl" ,curl)
391 ("freetype" ,freetype)
392 ("jbig2dec" ,jbig2dec)
393 ("libjpeg" ,libjpeg)
394 ("libx11" ,libx11)
395 ("libxext" ,libxext)
396 ("openjpeg" ,openjpeg-2.0)
397 ("openssl" ,openssl)
398 ("zlib" ,zlib)))
399 (native-inputs
400 `(("pkg-config" ,pkg-config)))
401 (arguments
402 ;; Trying to run `$ make check' results in a no rule fault.
403 '(#:tests? #f
404
405 #:modules ((guix build gnu-build-system)
406 (guix build utils)
407 (srfi srfi-1))
408 #:phases (alist-replace
409 'build
410 (lambda _ (zero? (system* "make" "XCFLAGS=-fpic")))
411 (alist-replace
412 'install
413 (lambda* (#:key outputs #:allow-other-keys)
414 (let ((out (assoc-ref outputs "out")))
415 (zero? (system* "make" (string-append "prefix=" out)
416 "install"))))
417 (alist-delete 'configure %standard-phases)))))
418 (home-page "http://mupdf.com")
419 (synopsis "Lightweight PDF viewer and toolkit")
420 (description
421 "MuPDF is a C library that implements a PDF and XPS parsing and
422 rendering engine. It is used primarily to render pages into bitmaps,
423 but also provides support for other operations such as searching and
424 listing the table of contents and hyperlinks.
425
426 The library ships with a rudimentary X11 viewer, and a set of command
427 line tools for batch rendering (pdfdraw), rewriting files (pdfclean),
428 and examining the file structure (pdfshow).")
429 (license license:agpl3+)))
430
431 (define-public qpdf
432 (package
433 (name "qpdf")
434 (version "5.1.2")
435 (source (origin
436 (method url-fetch)
437 (uri (string-append "mirror://sourceforge/qpdf/qpdf-"
438 version ".tar.gz"))
439 (sha256 (base32
440 "1zbvhrp0zjzbi6q2bnbxbg6399r47pq5gw3kspzph81j19fqvpg9"))))
441 (build-system gnu-build-system)
442 (arguments
443 '(#:phases (alist-cons-before
444 'configure 'patch-paths
445 (lambda _
446 (substitute* "make/libtool.mk"
447 (("SHELL=/bin/bash")
448 (string-append "SHELL=" (which "bash"))))
449 (substitute* (append
450 '("qtest/bin/qtest-driver")
451 (find-files "." "\\.test"))
452 (("/usr/bin/env") (which "env"))))
453 %standard-phases)))
454 (native-inputs
455 `(("pkg-config" ,pkg-config)))
456 (propagated-inputs
457 `(("pcre" ,pcre)))
458 (inputs
459 `(("zlib" ,zlib)
460 ("perl" ,perl)))
461 (synopsis "Command-line tools and library for transforming PDF files")
462 (description
463 "QPDF is a command-line program that does structural, content-preserving
464 transformations on PDF files. It could have been called something like
465 pdf-to-pdf. It includes support for merging and splitting PDFs and to
466 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
467 program capable of converting PDF into other formats.")
468 (license license:clarified-artistic)
469 (home-page "http://qpdf.sourceforge.net/")))
470
471 (define-public xournal
472 (package
473 (name "xournal")
474 (version "0.4.8")
475 (source
476 (origin
477 (method url-fetch)
478 (uri (string-append "mirror://sourceforge/xournal/xournal-"
479 version ".tar.gz"))
480 (sha256
481 (base32
482 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
483 (build-system gnu-build-system)
484 (inputs
485 `(("gtk" ,gtk+-2)
486 ("pango" ,pango)
487 ("poppler" ,poppler)
488 ("glib" ,glib)
489 ("libgnomecanvas" ,libgnomecanvas)))
490 (native-inputs
491 `(("pkg-config" ,pkg-config)))
492 (home-page "http://xournal.sourceforge.net/")
493 (synopsis "Notetaking using a stylus")
494 (description
495 "Xournal is an application for notetaking, sketching, keeping a journal
496 using a stylus.")
497 (license license:gpl2+)))