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>
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 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))
50 (define-public poppler
56 (uri (string-append "http://poppler.freedesktop.org/poppler-"
59 "162vfbvbz0frvqyk00ldsbl49h4bj8i8wn0ngfl30xg1lldy6qs9"))))
60 (build-system gnu-build-system)
61 ;; FIXME: more dependencies could be added
62 ;; cairo output: no (requires cairo >= 1.10.0)
67 (inputs `(("fontconfig" ,fontconfig)
68 ("freetype" ,freetype)
69 ("libjpeg-8" ,libjpeg-8)
73 ("openjpeg-1" ,openjpeg-1)
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)))))
83 `(("pkg-config" ,pkg-config)
84 ("glib" ,glib "bin"))) ; glib-mkenums, etc.
86 `(#:tests? #f ; no test data provided with the tarball
88 '("--enable-libopenjpeg"
89 "--enable-xpdf-headers" ; to install header files
96 (string-append (assoc-ref %build-inputs "openjpeg-1")
97 "/include/openjpeg-1.5"
98 ":" (or (getenv "CPATH") ""))))
100 (synopsis "PDF rendering library")
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/")))
112 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
115 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
116 (build-system gnu-build-system)
117 (inputs `(("freetype" ,freetype)
118 ("gs-fonts" ,gs-fonts)
120 ("libpaper" ,libpaper)
129 `(#:tests? #f ; there is no check target
130 #:parallel-build? #f ; build fails randomly on 8-way machines
132 (list (string-append "--with-freetype2-includes="
133 (assoc-ref %build-inputs "freetype")
134 "/include/freetype2"))
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")))
145 (("/usr/local/share/ghostscript/fonts")
146 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
147 (("#fontFile") "fontFile"))))
149 (synopsis "Viewer for PDF files based on the Motif toolkit")
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/")))
155 (define-public zathura-cb
162 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
166 "09ln4fpjxmhcq6cw1ka7mdkmca36gyd4gzrynbw3waz0ri0b277j"))))
167 (native-inputs `(("pkg-config" ,pkg-config)))
168 (propagated-inputs `(("girara" ,girara)))
169 (inputs `(("libarchive" ,libarchive)
171 ("zathura" ,zathura)))
172 (build-system gnu-build-system)
174 `(#:make-flags (list (string-append "PREFIX=" %output)
175 (string-append "PLUGINDIR=" %output "/lib/zathura")
177 #:tests? #f ; Package does not contain tests.
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
184 (license license:zlib)))
186 (define-public zathura-ps
193 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
197 "1a6ps5v1wk18qvslbkjln6w8wfzzr6fi13ls96vbdc03vdhn4m76"))))
198 (native-inputs `(("pkg-config" ,pkg-config)))
199 (propagated-inputs `(("girara" ,girara)))
200 (inputs `(("libspectre" ,libspectre)
202 ("zathura" ,zathura)))
203 (build-system gnu-build-system)
205 `(#:make-flags (list (string-append "PREFIX=" %output)
206 (string-append "PLUGINDIR=" %output "/lib/zathura")
208 #:tests? #f ; Package does not contain tests.
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
215 (license license:zlib)))
217 (define-public zathura-djvu
219 (name "zathura-djvu")
224 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
228 "1g1lafmrjbx0xv7fljdmyqxx0k334sq4q6jy4a0q5xfrgz0bh45c"))))
229 (native-inputs `(("pkg-config" ,pkg-config)))
230 (propagated-inputs `(("girara" ,girara)))
232 `(("djvulibre" ,djvulibre)
234 ("zathura" ,zathura)))
235 (build-system gnu-build-system)
237 `(#:make-flags (list (string-append "PREFIX=" %output)
238 (string-append "PLUGINDIR=" %output "/lib/zathura")
240 #:tests? #f ; Package does not contain tests.
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)))
249 (define-public zathura-pdf-poppler
251 (name "zathura-pdf-poppler")
256 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
260 "1b0chsds8iwjm4g629p6a67nb6wgra65pw2vvngd7g35dmcjgcv0"))))
261 (native-inputs `(("pkg-config" ,pkg-config)))
262 (propagated-inputs `(("girara" ,girara)))
264 `(("poppler" ,poppler)
268 (build-system gnu-build-system)
270 `(#:make-flags (list (string-append "PREFIX=" %output)
271 (string-append "PLUGINDIR=" %output "/lib/zathura")
273 #:tests? #f ; Package does not include tests.
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)))
282 (define-public zathura
289 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
293 "1rywx09qn6ap5hb1z31wxby4lzdrqdbldm51pjk1ifflr37xwirk"))
296 (search-patch "zathura-plugindir-environment-variable.patch")))))
297 (native-inputs `(("pkg-config" ,pkg-config)
298 ("gettext" ,gnu-gettext)))
299 (inputs `(("girara" ,girara)
303 (list (search-path-specification
304 (variable "ZATHURA_PLUGIN_PATH")
305 (files '("lib/zathura")))))
306 (build-system gnu-build-system)
309 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
311 #:tests? #f ; Tests fail: "Gtk cannot open display".
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
320 (license license:zlib)))
322 (define-public podofo
328 (uri (string-append "mirror://sourceforge/podofo/podofo-"
332 "1n12lbq9x15vqn7dc0hsccp56l5jdff1xrhvlfqlbklxx0qiw9pc"))))
333 (build-system cmake-build-system)
334 (inputs ; TODO: Add cppunit for tests
338 ("fontconfig" ,fontconfig)
340 ("libjpeg" ,libjpeg-8)
341 ("freetype" ,freetype)
344 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
345 "-DPODOFO_BUILD_STATIC=ON")
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))))
355 (home-page "http://podofo.sourceforge.net")
356 (synopsis "Tools to work with the PDF file format")
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+)))
372 (uri (string-append "http://mupdf.com/downloads/archive/"
373 name "-" version "-source.tar.gz"))
375 (base32 "0qx51rj6alzcagcixm59rvdpm54w6syrwr4184v439jh14ryw4wq"))
377 (list (search-patch "mupdf-buildsystem-fix.patch")))
378 (modules '((guix build utils)))
381 ;; Don't build the bundled-in third party libraries.
382 (delete-file-recursively "thirdparty")
384 ;; Make the scripts for finding openjpeg build details executable.
385 (chmod "ojp2_cppflags.sh" #o0755)
386 (chmod "ojp2_ldflags.sh" #o0755)))))
388 (build-system gnu-build-system)
391 ("freetype" ,freetype)
392 ("jbig2dec" ,jbig2dec)
396 ("openjpeg" ,openjpeg-2.0)
400 `(("pkg-config" ,pkg-config)))
402 ;; Trying to run `$ make check' results in a no rule fault.
405 #:modules ((guix build gnu-build-system)
408 #:phases (alist-replace
410 (lambda _ (zero? (system* "make" "XCFLAGS=-fpic")))
413 (lambda* (#:key outputs #:allow-other-keys)
414 (let ((out (assoc-ref outputs "out")))
415 (zero? (system* "make" (string-append "prefix=" out)
417 (alist-delete 'configure %standard-phases)))))
418 (home-page "http://mupdf.com")
419 (synopsis "Lightweight PDF viewer and toolkit")
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.
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+)))
437 (uri (string-append "mirror://sourceforge/qpdf/qpdf-"
440 "1zbvhrp0zjzbi6q2bnbxbg6399r47pq5gw3kspzph81j19fqvpg9"))))
441 (build-system gnu-build-system)
443 '(#:phases (alist-cons-before
444 'configure 'patch-paths
446 (substitute* "make/libtool.mk"
448 (string-append "SHELL=" (which "bash"))))
450 '("qtest/bin/qtest-driver")
451 (find-files "." "\\.test"))
452 (("/usr/bin/env") (which "env"))))
455 `(("pkg-config" ,pkg-config)))
461 (synopsis "Command-line tools and library for transforming PDF files")
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/")))
471 (define-public xournal
478 (uri (string-append "mirror://sourceforge/xournal/xournal-"
482 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
483 (build-system gnu-build-system)
489 ("libgnomecanvas" ,libgnomecanvas)))
491 `(("pkg-config" ,pkg-config)))
492 (home-page "http://xournal.sourceforge.net/")
493 (synopsis "Notetaking using a stylus")
495 "Xournal is an application for notetaking, sketching, keeping a journal
497 (license license:gpl2+)))