1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014, 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
6 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
8 ;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
11 ;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
12 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
13 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
14 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
15 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
16 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
18 ;;; This file is part of GNU Guix.
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
33 (define-module (gnu packages pdf)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix utils)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system python)
41 #:use-module (guix build-system trivial)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages backup)
45 #:use-module (gnu packages base)
46 #:use-module (gnu packages bash)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages compression)
49 #:use-module (gnu packages curl)
50 #:use-module (gnu packages databases)
51 #:use-module (gnu packages djvu)
52 #:use-module (gnu packages fontutils)
53 #:use-module (gnu packages game-development)
54 #:use-module (gnu packages gettext)
55 #:use-module (gnu packages ghostscript)
56 #:use-module (gnu packages gl)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages gnupg)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages image)
62 #:use-module (gnu packages imagemagick)
63 #:use-module (gnu packages javascript)
64 #:use-module (gnu packages lesstif)
65 #:use-module (gnu packages linux)
66 #:use-module (gnu packages lua)
67 #:use-module (gnu packages pcre)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages photo)
70 #:use-module (gnu packages pkg-config)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages qt)
73 #:use-module (gnu packages sdl)
74 #:use-module (gnu packages tls)
75 #:use-module (gnu packages xdisorg)
76 #:use-module (gnu packages xorg)
77 #:use-module (srfi srfi-1))
79 (define-public poppler
85 (uri (string-append "https://poppler.freedesktop.org/poppler-"
89 "04d1z1ygyb3llzc6s6c99wxafvljj2sc5b76djif34f7mzfqmk17"))))
90 (build-system cmake-build-system)
93 (inputs `(("fontconfig" ,fontconfig)
94 ("freetype" ,freetype)
99 ("openjpeg" ,openjpeg)
102 ;; To build poppler-glib (as needed by Evince), we need Cairo and
103 ;; GLib. But of course, that Cairo must not depend on Poppler.
104 ("cairo" ,(package (inherit cairo)
105 (inputs (alist-delete "poppler"
106 (package-inputs cairo)))))
109 `(("pkg-config" ,pkg-config)
110 ("glib" ,glib "bin") ; glib-mkenums, etc.
111 ("gobject-introspection" ,gobject-introspection)))
113 `(#:tests? #f ; no test data provided with the tarball
115 (let* ((out (assoc-ref %outputs "out"))
116 (lib (string-append out "/lib")))
117 (list "-DENABLE_XPDF_HEADERS=ON" ; to install header files
119 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
120 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
121 (synopsis "PDF rendering library")
123 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
124 (license license:gpl2+)
125 (home-page "https://poppler.freedesktop.org/")))
127 (define-public poppler-qt4
128 (package (inherit poppler)
130 (inputs `(("qt-4" ,qt-4)
131 ,@(package-inputs poppler)))
132 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
134 (define-public poppler-qt5
135 (package (inherit poppler)
137 (inputs `(("qtbase" ,qtbase)
138 ,@(package-inputs poppler)))
139 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
141 (define-public python-poppler-qt4
143 (name "python-poppler-qt4")
148 (uri (string-append "https://pypi.python.org/packages/source/p"
149 "/python-poppler-qt4/python-poppler-qt4-"
153 "0x63niylkk4q3h3ay8zrk3m1xiik0x3hlr4gvj7kswx48qi1vb99"))))
154 (build-system python-build-system)
157 (modify-phases %standard-phases
159 'unpack 'patch-poppler-include-paths
161 (substitute* (find-files "." "poppler-.*\\.sip")
162 (("qt4/poppler-.*\\.h" header)
163 (string-append "poppler/" header)))
166 `(("pkg-config" ,pkg-config)))
168 `(("python-sip" ,python-sip)
169 ("python-pyqt-4" ,python-pyqt-4)
170 ("poppler-qt4" ,poppler-qt4)))
171 (home-page "https://pypi.python.org/pypi/python-poppler-qt4")
172 (synopsis "Python bindings for Poppler-Qt4")
174 "This package provides Python bindings for the Qt4 interface of the
175 Poppler PDF rendering library.")
176 (license license:lgpl2.1+)))
178 (define-public python-poppler-qt5
180 (name "python-poppler-qt5")
185 (uri (pypi-uri "python-poppler-qt5" version))
188 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
189 (build-system python-build-system)
191 `(;; There are no tests. The check phase just causes a rebuild.
194 (modify-phases %standard-phases
196 (lambda* (#:key inputs #:allow-other-keys)
197 (substitute* "setup.py"
198 ;; This check always fails, so disable it.
199 (("if not check_qtxml\\(\\)")
201 ;; Enable C++11, which is needed because of Qt5.
202 (("\\*\\*ext_args" line)
203 (string-append "extra_compile_args=['-std=gnu++11'], " line)))
204 ;; We need to pass an extra flag here. This cannot be in
205 ;; configure-flags because it should not be passed for the
206 ;; installation phase.
207 ((@@ (guix build python-build-system) call-setuppy)
208 "build_ext" (list (string-append "--pyqt-sip-dir="
209 (assoc-ref inputs "python-pyqt")
210 "/share/sip")) #t))))))
212 `(("pkg-config" ,pkg-config)))
214 `(("python-sip" ,python-sip)
215 ("python-pyqt" ,python-pyqt)
216 ("poppler-qt5" ,poppler-qt5)
218 (home-page "https://pypi.python.org/pypi/python-poppler-qt5")
219 (synopsis "Python bindings for Poppler-Qt5")
221 "This package provides Python bindings for the Qt5 interface of the
222 Poppler PDF rendering library.")
223 (license license:lgpl2.1+)))
225 (define-public libharu
231 (uri (string-append "https://github.com/libharu/libharu/archive/"
233 (string-join (string-split version #\.) "_")
235 (file-name (string-append name "-" version ".tar.gz"))
238 "1lm4v539y9cb1lvbq387j57sy7yxda3yv8b1pk8m6zazbp66i7lg"))))
239 (build-system gnu-build-system)
242 (list (string-append "--with-zlib="
243 (assoc-ref %build-inputs "zlib"))
244 (string-append "--with-png="
245 (assoc-ref %build-inputs "libpng")))
247 (modify-phases %standard-phases
248 (add-after 'unpack 'autogen
249 (lambda _ (zero? (system* "autoreconf" "-vif")))))))
254 `(("autoconf" ,autoconf)
255 ("automake" ,automake)
256 ("libtool" ,libtool)))
257 (home-page "http://libharu.org/")
258 (synopsis "Library for generating PDF files")
260 "libHaru is a library for generating PDF files. libHaru does not support
261 reading and editing of existing PDF files.")
262 (license license:zlib)))
270 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
273 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
274 (build-system gnu-build-system)
275 (inputs `(("freetype" ,freetype)
276 ("gs-fonts" ,gs-fonts)
278 ("libpaper" ,libpaper)
287 `(#:tests? #f ; there is no check target
288 #:parallel-build? #f ; build fails randomly on 8-way machines
290 (list (string-append "--with-freetype2-includes="
291 (assoc-ref %build-inputs "freetype")
292 "/include/freetype2"))
294 (modify-phases %standard-phases
296 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
297 (let* ((install (assoc-ref %standard-phases 'install))
298 (out (assoc-ref outputs "out"))
299 (xpdfrc (string-append out "/etc/xpdfrc"))
300 (gs-fonts (assoc-ref inputs "gs-fonts")))
303 (("/usr/local/share/ghostscript/fonts")
304 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
305 (("#fontFile") "fontFile")))
307 (synopsis "Viewer for PDF files based on the Motif toolkit")
309 "Xpdf is a viewer for Portable Document Format (PDF) files.")
310 (license license:gpl3) ; or gpl2, but not gpl2+
311 (home-page "http://www.foolabs.com/xpdf/")))
313 (define-public zathura-cb
320 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
324 "0r4viisycj39kaz4281cmkr7n9w5q96dmlf7nf45n8zq8qy2npw3"))))
325 (native-inputs `(("pkg-config" ,pkg-config)))
326 (inputs `(("libarchive" ,libarchive)
327 ("zathura" ,zathura)))
328 (build-system gnu-build-system)
330 `(#:make-flags (list (string-append "PREFIX=" %output)
331 (string-append "PLUGINDIR=" %output "/lib/zathura")
333 #:tests? #f ; Package does not contain tests.
335 (modify-phases %standard-phases (delete 'configure))))
336 (home-page "https://pwmt.org/projects/zathura-cb/")
337 (synopsis "Comic book support for zathura (libarchive backend)")
338 (description "The zathura-cb plugin adds comic book support to zathura
340 (license license:zlib)))
342 (define-public zathura-ps
349 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
353 "1x4knqja8pw2a5cb3y2209nr3iddj1z8nwasy48v5nprj61fdxqj"))))
354 (native-inputs `(("pkg-config" ,pkg-config)))
355 (inputs `(("libspectre" ,libspectre)
356 ("zathura" ,zathura)))
357 (build-system gnu-build-system)
359 `(#:make-flags (list (string-append "PREFIX=" %output)
360 (string-append "PLUGINDIR=" %output "/lib/zathura")
362 #:tests? #f ; Package does not contain tests.
364 (modify-phases %standard-phases (delete 'configure))))
365 (home-page "https://pwmt.org/projects/zathura-ps/")
366 (synopsis "PS support for zathura (libspectre backend)")
367 (description "The zathura-ps plugin adds PS support to zathura
369 (license license:zlib)))
371 (define-public zathura-djvu
373 (name "zathura-djvu")
378 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
382 "1sbfdsyp50qc85xc4458sn4w1rv1qbygdwmcr5kjlfpsmdq98vhd"))))
383 (native-inputs `(("pkg-config" ,pkg-config)))
385 `(("djvulibre" ,djvulibre)
386 ("zathura" ,zathura)))
387 (build-system gnu-build-system)
389 `(#:make-flags (list (string-append "PREFIX=" %output)
390 (string-append "PLUGINDIR=" %output "/lib/zathura")
392 #:tests? #f ; Package does not contain tests.
394 (modify-phases %standard-phases (delete 'configure))))
395 (home-page "https://pwmt.org/projects/zathura-djvu/")
396 (synopsis "DjVu support for zathura (DjVuLibre backend)")
397 (description "The zathura-djvu plugin adds DjVu support to zathura
398 using the DjVuLibre library.")
399 (license license:zlib)))
401 (define-public zathura-pdf-mupdf
403 (name "zathura-pdf-mupdf")
408 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
409 "/download/zathura-pdf-mupdf-" version ".tar.gz"))
412 "0xkajc3is7ncmb2fmymbzfgrran2bz12i7zsm1vvxhxds728h7ck"))))
413 (native-inputs `(("pkg-config" ,pkg-config)))
415 `(("jbig2dec" ,jbig2dec)
418 ("openjpeg" ,openjpeg)
420 ("zathura" ,zathura)))
421 (build-system gnu-build-system)
423 `(#:make-flags (list (string-append "PREFIX=" %output)
424 (string-append "PLUGINDIR=" %output "/lib/zathura")
426 #:tests? #f ;No tests.
427 #:phases (modify-phases %standard-phases (delete 'configure))))
428 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
429 (synopsis "PDF support for zathura (mupdf backend)")
430 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
431 by using the @code{mupdf} rendering library.")
432 (license license:zlib)))
434 (define-public zathura-pdf-poppler
436 (name "zathura-pdf-poppler")
441 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
445 "1m55m7s7f8ng8a7lmcw9z4n5zv7xk4vp9n6fp9j84z6rk2imf7a2"))))
446 (native-inputs `(("pkg-config" ,pkg-config)))
448 `(("poppler" ,poppler)
449 ("zathura" ,zathura)))
450 (build-system gnu-build-system)
452 `(#:make-flags (list (string-append "PREFIX=" %output)
453 (string-append "PLUGINDIR=" %output "/lib/zathura")
455 #:tests? #f ; Package does not include tests.
457 (modify-phases %standard-phases (delete 'configure))))
458 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
459 (synopsis "PDF support for zathura (poppler backend)")
460 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
461 by using the poppler rendering engine.")
462 (license license:zlib)))
464 (define-public zathura
471 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
475 "0dz5pky3vmf3s2cp2rv1c099gb1s49p9xlgm3ghyy4pzyxc8bgs6"))
476 (patches (search-patches
477 "zathura-plugindir-environment-variable.patch"))))
478 (native-inputs `(("pkg-config" ,pkg-config)
479 ("gettext" ,gettext-minimal)
480 ("glib:bin" ,glib "bin")
484 ("xorg-server" ,xorg-server-1.19.3)))
485 (inputs `(("sqlite" ,sqlite)))
486 ;; Listed in 'Requires.private' of 'zathura.pc'.
487 (propagated-inputs `(("cairo" ,cairo)
490 (list (search-path-specification
491 (variable "ZATHURA_PLUGIN_PATH")
492 (files '("lib/zathura")))))
493 (build-system gnu-build-system)
496 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
499 #:disallowed-references (,xorg-server-1.19.3)
500 #:phases (modify-phases %standard-phases
502 (add-before 'check 'start-xserver
503 ;; Tests require a running X server.
504 (lambda* (#:key inputs #:allow-other-keys)
505 (let ((xorg-server (assoc-ref inputs "xorg-server"))
507 (setenv "DISPLAY" display)
509 ;; On busy machines, tests may take longer than
510 ;; the default of four seconds.
511 (setenv "CK_DEFAULT_TIMEOUT" "20")
513 ;; Don't fail due to missing '/etc/machine-id'.
514 (setenv "DBUS_FATAL_WARNINGS" "0")
515 (zero? (system (string-append xorg-server "/bin/Xvfb "
516 display " &")))))))))
517 (home-page "https://pwmt.org/projects/zathura/")
518 (synopsis "Lightweight keyboard-driven PDF viewer")
519 (description "Zathura is a customizable document viewer. It provides a
520 minimalistic interface and an interface that mainly focuses on keyboard
522 (license license:zlib)))
524 (define-public podofo
530 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
531 "/podofo-" version ".tar.gz"))
534 "012kgfx5j5n6w4zkc1d290d2cwjk60jhzsjlr2x19g3yi75q2jc5"))))
535 (build-system cmake-build-system)
536 (inputs ; TODO: Add cppunit for tests
540 ("fontconfig" ,fontconfig)
542 ("libjpeg" ,libjpeg-8)
543 ("freetype" ,freetype)
546 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
547 "-DPODOFO_BUILD_STATIC=ON")
549 (modify-phases %standard-phases
550 (add-before 'configure 'patch
551 (lambda* (#:key inputs #:allow-other-keys)
552 (let ((freetype (assoc-ref inputs "freetype")))
553 ;; Look for freetype include files in the correct place.
554 (substitute* "cmake/modules/FindFREETYPE.cmake"
555 (("/usr/local") freetype)))
557 (home-page "http://podofo.sourceforge.net")
558 (synopsis "Tools to work with the PDF file format")
560 "PoDoFo is a C++ library and set of command-line tools to work with the
561 PDF file format. It can parse PDF files and load them into memory, and makes
562 it easy to modify them and write the changes to disk. It is primarily useful
563 for applications that wish to do lower level manipulation of PDF, such as
564 extracting content or merging files.")
565 (license license:lgpl2.0+)))
574 (uri (string-append "https://mupdf.com/downloads/archive/"
575 name "-" version "-source.tar.xz"))
576 (patches (search-patches "mupdf-build-with-latest-openjpeg.patch"
577 "mupdf-CVE-2017-17858.patch"
578 "mupdf-CVE-2018-6544.patch"
579 "mupdf-CVE-2018-1000051.patch"))
582 "0b9j0gqbc3jhmx87r6idcsh8lnb30840c3hyx6dk2gdjqqh3hysp"))
583 (modules '((guix build utils)))
584 (snippet '(begin (delete-file-recursively "thirdparty") #t))))
585 (build-system gnu-build-system)
588 ("freeglut" ,freeglut)
589 ("freetype" ,freetype)
590 ("harfbuzz" ,harfbuzz)
591 ("jbig2dec" ,jbig2dec)
596 ("openjpeg" ,openjpeg)
600 `(("pkg-config" ,pkg-config)))
602 '(#:tests? #f ; no check target
603 #:make-flags (list "CC=gcc"
605 (string-append "prefix=" (assoc-ref %outputs "out")))
606 #:phases (modify-phases %standard-phases
607 (delete 'configure))))
608 (home-page "https://mupdf.com")
609 (synopsis "Lightweight PDF viewer and toolkit")
611 "MuPDF is a C library that implements a PDF and XPS parsing and
612 rendering engine. It is used primarily to render pages into bitmaps,
613 but also provides support for other operations such as searching and
614 listing the table of contents and hyperlinks.
616 The library ships with a rudimentary X11 viewer, and a set of command
617 line tools for batch rendering @command{pdfdraw}, rewriting files
618 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
619 (license license:agpl3+)))
627 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
628 "/qpdf-" version ".tar.gz"))
631 "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9"))
632 (modules '((guix build utils)))
634 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
635 ;; dependency on Perl.
637 (substitute* "qpdf/fix-qdf"
638 (("#!/usr/bin/env perl")
640 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
641 & eval 'exec perl -wS \"$0\" $argv:q'
644 (build-system gnu-build-system)
646 `(#:disallowed-references (,perl)
648 (modify-phases %standard-phases
649 (add-before 'configure 'patch-paths
651 (substitute* "make/libtool.mk"
653 (string-append "SHELL=" (which "bash"))))
655 '("qtest/bin/qtest-driver")
656 (find-files "." "\\.test"))
657 (("/usr/bin/env") (which "env")))
660 `(("pkg-config" ,pkg-config)
666 (synopsis "Command-line tools and library for transforming PDF files")
668 "QPDF is a command-line program that does structural, content-preserving
669 transformations on PDF files. It could have been called something like
670 pdf-to-pdf. It includes support for merging and splitting PDFs and to
671 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
672 program capable of converting PDF into other formats.")
673 (license license:clarified-artistic)
674 (home-page "http://qpdf.sourceforge.net/")))
676 (define-public xournal
683 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
684 "/xournal-" version ".tar.gz"))
687 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
688 (build-system gnu-build-system)
694 ("libgnomecanvas" ,libgnomecanvas)))
696 `(("pkg-config" ,pkg-config)))
697 (home-page "http://xournal.sourceforge.net/")
698 (synopsis "Notetaking using a stylus")
700 "Xournal is an application for notetaking, sketching, keeping a journal
702 (license license:gpl2+)))
704 (define-public python-reportlab
706 (name "python-reportlab")
710 (uri (pypi-uri "reportlab" version))
713 "0hy304pzsz9lblmk7mrbk2682bi911lxgvzx2kcfpmfzb5gg7sjv"))))
714 (build-system python-build-system)
716 '(;; FIXME: There is one test failure, but it does not cause the
717 ;; build to fail. No time to investigate right now.
718 #:test-target "tests"))
720 `(("python-pillow" ,python-pillow)))
721 (home-page "https://www.reportlab.com")
722 (synopsis "Python library for generating PDFs and graphics")
723 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
724 of rich PDF documents, and also creation of charts in a variety of bitmap and
726 (license license:bsd-3)))
728 (define-public python2-reportlab
729 (package-with-python2 python-reportlab))
731 (define-public impressive
738 "mirror://sourceforge/impressive/Impressive/"
739 version "/Impressive-" version ".tar.gz"))
742 "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr"))))
743 (build-system python-build-system)
745 ;; TODO: Add dependency on pdftk.
746 (inputs `(("python2-pygame" ,python2-pygame)
747 ("python2-pillow" ,python2-pillow)
753 #:phases (modify-phases %standard-phases
758 (lambda* (#:key inputs outputs #:allow-other-keys)
759 ;; There's no 'setup.py' so install things manually.
760 (let* ((out (assoc-ref outputs "out"))
761 (bin (string-append out "/bin"))
762 (man1 (string-append out "/share/man/man1"))
763 (sdl (assoc-ref inputs "sdl"))
764 (xpdf (assoc-ref inputs "xpdf")))
766 (copy-file "impressive.py"
767 (string-append bin "/impressive"))
768 (wrap-program (string-append bin "/impressive")
769 `("LIBRARY_PATH" ":" prefix ;for ctypes
770 (,(string-append sdl "/lib")))
771 `("PATH" ":" prefix ;for pdftoppm
772 (,(string-append xpdf "/bin"))))
773 (install-file "impressive.1" man1)
775 (home-page "http://impressive.sourceforge.net")
776 (synopsis "PDF presentation tool with visual effects")
778 "Impressive is a tool to display PDF files that provides visual effects
779 such as smooth alpha-blended slide transitions. It provides additional tools
780 such as zooming, highlighting an area of the screen, and a tool to navigate
782 (license license:gpl2)))
788 (home-page "https://www.kraxel.org/blog/linux/fbida/")
791 (uri (string-append "https://www.kraxel.org/releases/fbida/"
792 name "-" version ".tar.gz"))
795 "0bw224vb7jh0lrqaf4jgxk48xglvxs674qcpj5y0axyfbh896cfk"))))
796 (build-system gnu-build-system)
799 (modify-phases %standard-phases
800 (add-after 'unpack 'patch-ldconfig
802 (substitute* "mk/Autoconf.mk"
803 (("/sbin/ldconfig -p") "echo lib")) #t))
806 #:make-flags (list "CC=gcc"
807 (string-append "prefix=" (assoc-ref %outputs "out")))))
808 (inputs `(("libjpeg" ,libjpeg)
814 ("imagemagick" ,imagemagick)
817 ("cairo-xcb" ,cairo-xcb)
818 ("freetype" ,freetype)
819 ("fontconfig" ,fontconfig)
822 ("libepoxy" ,libepoxy)
824 ("poppler" ,poppler)))
825 (native-inputs `(("pkg-config" ,pkg-config)))
826 (synopsis "Framebuffer and drm-based image viewer")
828 "fbida contains a few applications for viewing and editing images on
831 (license license:gpl2+)))
833 (define-public pdf2svg
840 "https://github.com/dawbarton/pdf2svg/archive/v"
842 (file-name (string-append name "-" version ".tar.gz"))
845 "12pa1pajirnlrkz2il3h4l30lc2prryk1qr132jk6z9y1c3qdcag"))))
846 (build-system gnu-build-system)
849 ("poppler" ,poppler)))
851 `(("pkg-config" ,pkg-config)))
852 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
853 (synopsis "PDF to SVG converter")
854 (description "@command{pdf2svg} is a simple command-line PDF to SVG
855 converter using the Poppler and Cairo libraries.")
856 (license license:gpl2+)))
858 (define-public python-pypdf2
860 (name "python-pypdf2")
864 (uri (pypi-uri "PyPDF2" version))
867 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
868 (build-system python-build-system)
871 (modify-phases %standard-phases
873 'unpack 'patch-test-suite
875 ;; The text-file needs to be opened in binary mode for Python 3,
876 ;; so patch in the "b"
877 (substitute* "Tests/tests.py"
878 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
879 (string-append line "b")))
883 (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))
884 (home-page "http://mstamy2.github.com/PyPDF2")
885 (synopsis "Pure Python PDF toolkit")
886 (description "PyPDF2 is a pure Python PDF library capable of:
889 @item extracting document information (title, author, …)
890 @item splitting documents page by page
891 @item merging documents page by page
893 @item merging multiple pages into a single page
894 @item encrypting and decrypting PDF files
897 By being pure Python, it should run on any Python platform without any
898 dependencies on external libraries. It can also work entirely on
899 @code{StringIO} objects rather than file streams, allowing for PDF
900 manipulation in memory. It is therefore a useful tool for websites that
901 manage or manipulate PDFs.")
902 (license license:bsd-3)))
904 (define-public python2-pypdf2
905 (package-with-python2 python-pypdf2))
907 (define-public python2-pypdf
909 (name "python2-pypdf")
913 (uri (pypi-uri "pyPdf" version))
916 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
917 (build-system python-build-system)
919 `(#:tests? #f ; no tests
921 (home-page "http://pybrary.net/pyPdf/")
922 (synopsis "Pure Python PDF toolkit")
923 (description "PyPDF2 is a pure Python PDF toolkit.
925 Note: This module isn't maintained anymore. For new projects please use
926 python-pypdf2 instead.")
927 (license license:bsd-3)))
929 (define-public pdfposter
935 (uri (pypi-uri "pdftools.pdfposter" version ".tar.bz2"))
938 "1i9jqawf279va089ykicglcq4zlsnwgcnsdzaa8vnm836lqhywma"))))
939 (build-system python-build-system)
941 `(#:tests? #f ; no test suite, only for visual control
944 ;; pdfposter 0.6.0 still uses the old pyPdf
945 `(("python2-pypdf" ,python2-pypdf)))
946 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
947 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
948 (description "@command{pdfposter} can be used to create a large poster by
949 building it from multple pages and/or printing it on large media. It expects
950 as input a PDF file, normally printing on a single page. The output is again
951 a PDF file, maybe containing multiple pages together building the poster. The
952 input page will be scaled to obtain the desired size.
954 This is much like @command{poster} does for Postscript files, but working with
955 PDF. Since sometimes @command{poster} does not like your files converted from
956 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
957 (license license:gpl3+)))
959 (define-public pdfgrep
966 (uri (string-append "https://pdfgrep.org/download/"
967 name "-" version ".tar.gz"))
970 "07llkrkcfjwd3ybai9ad10ybhr0biffcplmy7lw4fb87nd2dfw03"))))
971 (build-system gnu-build-system)
973 `(("pkg-config" ,pkg-config)))
975 `(("libgcrypt" ,libgcrypt)
977 ("poppler" ,poppler)))
978 (home-page "https://pdfgrep.org")
979 (synopsis "Command-line utility to search text in PDF files")
981 "Pdfgrep searches in pdf files for strings matching a regular expression.
982 Support some GNU grep options as file name output, page number output,
983 optional case insensitivity, count occurrences, color highlights and search in
985 (license license:gpl2+)))