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 ng0 <ng0@we.make.ritual.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 "0hcnghliyr8pr887qza18qfgaclw5jr889g1cjcglkni9jr2dmm3"))))
90 (build-system gnu-build-system)
93 (inputs `(("fontconfig" ,fontconfig)
94 ("freetype" ,freetype)
99 ("openjpeg-1" ,openjpeg-1) ; prefers openjpeg-1
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 '("--enable-xpdf-headers" ; to install header files
118 ;; Saves 8 MiB of .a files.
121 (modify-phases %standard-phases
122 (add-before 'configure 'setenv
125 (string-append (assoc-ref %build-inputs "openjpeg-1")
126 "/include/openjpeg-1.5"
127 ":" (or (getenv "CPATH") "")))
129 (synopsis "PDF rendering library")
131 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
132 (license license:gpl2+)
133 (home-page "https://poppler.freedesktop.org/")))
135 (define-public poppler-qt4
136 (package (inherit poppler)
138 (inputs `(("qt-4" ,qt-4)
139 ,@(package-inputs poppler)))
140 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
142 (define-public poppler-qt5
143 (package (inherit poppler)
145 (inputs `(("qtbase" ,qtbase)
146 ,@(package-inputs poppler)))
148 (substitute-keyword-arguments (package-arguments poppler)
149 ((#:configure-flags flags)
150 `(cons "CXXFLAGS=-std=gnu++11" ,flags))))
151 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
153 (define-public python-poppler-qt4
155 (name "python-poppler-qt4")
160 (uri (string-append "https://pypi.python.org/packages/source/p"
161 "/python-poppler-qt4/python-poppler-qt4-"
165 "0x63niylkk4q3h3ay8zrk3m1xiik0x3hlr4gvj7kswx48qi1vb99"))))
166 (build-system python-build-system)
169 (modify-phases %standard-phases
171 'unpack 'patch-poppler-include-paths
173 (substitute* (find-files "." "poppler-.*\\.sip")
174 (("qt4/poppler-.*\\.h" header)
175 (string-append "poppler/" header)))
178 `(("pkg-config" ,pkg-config)))
180 `(("python-sip" ,python-sip)
181 ("python-pyqt-4" ,python-pyqt-4)
182 ("poppler-qt4" ,poppler-qt4)))
183 (home-page "https://pypi.python.org/pypi/python-poppler-qt4")
184 (synopsis "Python bindings for Poppler-Qt4")
186 "This package provides Python bindings for the Qt4 interface of the
187 Poppler PDF rendering library.")
188 (license license:lgpl2.1+)))
190 (define-public python-poppler-qt5
192 (name "python-poppler-qt5")
197 (uri (pypi-uri "python-poppler-qt5" version))
200 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
201 (build-system python-build-system)
203 `(;; There are no tests. The check phase just causes a rebuild.
206 (modify-phases %standard-phases
208 (lambda* (#:key inputs #:allow-other-keys)
209 (substitute* "setup.py"
210 ;; This check always fails, so disable it.
211 (("if not check_qtxml\\(\\)")
213 ;; Enable C++11, which is needed because of Qt5.
214 (("\\*\\*ext_args" line)
215 (string-append "extra_compile_args=['-std=gnu++11'], " line)))
216 ;; We need to pass an extra flag here. This cannot be in
217 ;; configure-flags because it should not be passed for the
218 ;; installation phase.
219 ((@@ (guix build python-build-system) call-setuppy)
220 "build_ext" (list (string-append "--pyqt-sip-dir="
221 (assoc-ref inputs "python-pyqt")
222 "/share/sip")) #t))))))
224 `(("pkg-config" ,pkg-config)))
226 `(("python-sip" ,python-sip)
227 ("python-pyqt" ,python-pyqt)
228 ("poppler-qt5" ,poppler-qt5)
230 (home-page "https://pypi.python.org/pypi/python-poppler-qt5")
231 (synopsis "Python bindings for Poppler-Qt5")
233 "This package provides Python bindings for the Qt5 interface of the
234 Poppler PDF rendering library.")
235 (license license:lgpl2.1+)))
237 (define-public libharu
243 (uri (string-append "https://github.com/libharu/libharu/archive/"
245 (string-join (string-split version #\.) "_")
247 (file-name (string-append name "-" version ".tar.gz"))
250 "1lm4v539y9cb1lvbq387j57sy7yxda3yv8b1pk8m6zazbp66i7lg"))))
251 (build-system gnu-build-system)
254 (list (string-append "--with-zlib="
255 (assoc-ref %build-inputs "zlib"))
256 (string-append "--with-png="
257 (assoc-ref %build-inputs "libpng")))
259 (modify-phases %standard-phases
260 (add-after 'unpack 'autogen
261 (lambda _ (zero? (system* "autoreconf" "-vif")))))))
266 `(("autoconf" ,autoconf)
267 ("automake" ,automake)
268 ("libtool" ,libtool)))
269 (home-page "http://libharu.org/")
270 (synopsis "Library for generating PDF files")
272 "libHaru is a library for generating PDF files. libHaru does not support
273 reading and editing of existing PDF files.")
274 (license license:zlib)))
282 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
285 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
286 (build-system gnu-build-system)
287 (inputs `(("freetype" ,freetype)
288 ("gs-fonts" ,gs-fonts)
290 ("libpaper" ,libpaper)
299 `(#:tests? #f ; there is no check target
300 #:parallel-build? #f ; build fails randomly on 8-way machines
302 (list (string-append "--with-freetype2-includes="
303 (assoc-ref %build-inputs "freetype")
304 "/include/freetype2"))
306 (modify-phases %standard-phases
308 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
309 (let* ((install (assoc-ref %standard-phases 'install))
310 (out (assoc-ref outputs "out"))
311 (xpdfrc (string-append out "/etc/xpdfrc"))
312 (gs-fonts (assoc-ref inputs "gs-fonts")))
315 (("/usr/local/share/ghostscript/fonts")
316 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
317 (("#fontFile") "fontFile")))
319 (synopsis "Viewer for PDF files based on the Motif toolkit")
321 "Xpdf is a viewer for Portable Document Format (PDF) files.")
322 (license license:gpl3) ; or gpl2, but not gpl2+
323 (home-page "http://www.foolabs.com/xpdf/")))
325 (define-public zathura-cb
332 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
336 "0r4viisycj39kaz4281cmkr7n9w5q96dmlf7nf45n8zq8qy2npw3"))))
337 (native-inputs `(("pkg-config" ,pkg-config)))
338 (propagated-inputs `(("girara" ,girara)))
339 (inputs `(("libarchive" ,libarchive)
340 ("zathura" ,zathura)))
341 (build-system gnu-build-system)
343 `(#:make-flags (list (string-append "PREFIX=" %output)
344 (string-append "PLUGINDIR=" %output "/lib/zathura")
346 #:tests? #f ; Package does not contain tests.
348 (modify-phases %standard-phases (delete 'configure))))
349 (home-page "https://pwmt.org/projects/zathura-cb/")
350 (synopsis "Comic book support for zathura (libarchive backend)")
351 (description "The zathura-cb plugin adds comic book support to zathura
353 (license license:zlib)))
355 (define-public zathura-ps
362 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
366 "1x4knqja8pw2a5cb3y2209nr3iddj1z8nwasy48v5nprj61fdxqj"))))
367 (native-inputs `(("pkg-config" ,pkg-config)))
368 (propagated-inputs `(("girara" ,girara)))
369 (inputs `(("libspectre" ,libspectre)
370 ("zathura" ,zathura)))
371 (build-system gnu-build-system)
373 `(#:make-flags (list (string-append "PREFIX=" %output)
374 (string-append "PLUGINDIR=" %output "/lib/zathura")
376 #:tests? #f ; Package does not contain tests.
378 (modify-phases %standard-phases (delete 'configure))))
379 (home-page "https://pwmt.org/projects/zathura-ps/")
380 (synopsis "PS support for zathura (libspectre backend)")
381 (description "The zathura-ps plugin adds PS support to zathura
383 (license license:zlib)))
385 (define-public zathura-djvu
387 (name "zathura-djvu")
392 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
396 "1sbfdsyp50qc85xc4458sn4w1rv1qbygdwmcr5kjlfpsmdq98vhd"))))
397 (native-inputs `(("pkg-config" ,pkg-config)))
398 (propagated-inputs `(("girara" ,girara)))
400 `(("djvulibre" ,djvulibre)
401 ("zathura" ,zathura)))
402 (build-system gnu-build-system)
404 `(#:make-flags (list (string-append "PREFIX=" %output)
405 (string-append "PLUGINDIR=" %output "/lib/zathura")
407 #:tests? #f ; Package does not contain tests.
409 (modify-phases %standard-phases (delete 'configure))))
410 (home-page "https://pwmt.org/projects/zathura-djvu/")
411 (synopsis "DjVu support for zathura (DjVuLibre backend)")
412 (description "The zathura-djvu plugin adds DjVu support to zathura
413 using the DjVuLibre library.")
414 (license license:zlib)))
416 (define-public zathura-pdf-mupdf
418 (name "zathura-pdf-mupdf")
423 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
424 "/download/zathura-pdf-mupdf-" version ".tar.gz"))
427 "0xkajc3is7ncmb2fmymbzfgrran2bz12i7zsm1vvxhxds728h7ck"))))
428 (native-inputs `(("pkg-config" ,pkg-config)))
429 (propagated-inputs `(("girara" ,girara)))
431 `(("jbig2dec" ,jbig2dec)
434 ("openjpeg" ,openjpeg)
436 ("zathura" ,zathura)))
437 (build-system gnu-build-system)
439 `(#:make-flags (list (string-append "PREFIX=" %output)
440 (string-append "PLUGINDIR=" %output "/lib/zathura")
442 #:tests? #f ;No tests.
443 #:phases (modify-phases %standard-phases (delete 'configure))))
444 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
445 (synopsis "PDF support for zathura (mupdf backend)")
446 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
447 by using the @code{mupdf} rendering library.")
448 (license license:zlib)))
450 (define-public zathura-pdf-poppler
452 (name "zathura-pdf-poppler")
457 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
461 "1m55m7s7f8ng8a7lmcw9z4n5zv7xk4vp9n6fp9j84z6rk2imf7a2"))))
462 (native-inputs `(("pkg-config" ,pkg-config)))
463 (propagated-inputs `(("girara" ,girara)))
465 `(("poppler" ,poppler)
466 ("zathura" ,zathura)))
467 (build-system gnu-build-system)
469 `(#:make-flags (list (string-append "PREFIX=" %output)
470 (string-append "PLUGINDIR=" %output "/lib/zathura")
472 #:tests? #f ; Package does not include tests.
474 (modify-phases %standard-phases (delete 'configure))))
475 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
476 (synopsis "PDF support for zathura (poppler backend)")
477 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
478 by using the poppler rendering engine.")
479 (license license:zlib)))
481 (define-public zathura
488 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
492 "0dz5pky3vmf3s2cp2rv1c099gb1s49p9xlgm3ghyy4pzyxc8bgs6"))
493 (patches (search-patches
494 "zathura-plugindir-environment-variable.patch"))))
495 (native-inputs `(("pkg-config" ,pkg-config)
496 ("gettext" ,gettext-minimal)
497 ("glib:bin" ,glib "bin")
501 ("xorg-server" ,xorg-server)))
502 (inputs `(("sqlite" ,sqlite)))
503 ;; Listed in 'Requires.private' of 'zathura.pc'.
504 (propagated-inputs `(("cairo" ,cairo)
507 (list (search-path-specification
508 (variable "ZATHURA_PLUGIN_PATH")
509 (files '("lib/zathura")))))
510 (build-system gnu-build-system)
513 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
516 #:phases (modify-phases %standard-phases
518 (add-before 'check 'start-xserver
519 ;; Tests require a running X server.
520 (lambda* (#:key inputs #:allow-other-keys)
521 (let ((xorg-server (assoc-ref inputs "xorg-server"))
523 (setenv "DISPLAY" display)
524 ;; Don't fail due to missing '/etc/machine-id'.
525 (setenv "DBUS_FATAL_WARNINGS" "0")
526 (zero? (system (string-append xorg-server "/bin/Xvfb "
527 display " &")))))))))
528 (home-page "https://pwmt.org/projects/zathura/")
529 (synopsis "Lightweight keyboard-driven PDF viewer")
530 (description "Zathura is a customizable document viewer. It provides a
531 minimalistic interface and an interface that mainly focuses on keyboard
533 (license license:zlib)))
535 (define-public podofo
541 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
542 "/podofo-" version ".tar.gz"))
545 "012kgfx5j5n6w4zkc1d290d2cwjk60jhzsjlr2x19g3yi75q2jc5"))))
546 (build-system cmake-build-system)
547 (inputs ; TODO: Add cppunit for tests
551 ("fontconfig" ,fontconfig)
553 ("libjpeg" ,libjpeg-8)
554 ("freetype" ,freetype)
557 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
558 "-DPODOFO_BUILD_STATIC=ON")
560 (modify-phases %standard-phases
561 (add-before 'configure 'patch
562 (lambda* (#:key inputs #:allow-other-keys)
563 (let ((freetype (assoc-ref inputs "freetype")))
564 ;; Look for freetype include files in the correct place.
565 (substitute* "cmake/modules/FindFREETYPE.cmake"
566 (("/usr/local") freetype)))
568 (home-page "http://podofo.sourceforge.net")
569 (synopsis "Tools to work with the PDF file format")
571 "PoDoFo is a C++ library and set of command-line tools to work with the
572 PDF file format. It can parse PDF files and load them into memory, and makes
573 it easy to modify them and write the changes to disk. It is primarily useful
574 for applications that wish to do lower level manipulation of PDF, such as
575 extracting content or merging files.")
576 (license license:lgpl2.0+)))
585 (uri (string-append "https://mupdf.com/downloads/archive/"
586 name "-" version "-source.tar.xz"))
587 (patches (search-patches "mupdf-build-with-latest-openjpeg.patch"
588 "mupdf-CVE-2017-17858.patch"))
591 "0b9j0gqbc3jhmx87r6idcsh8lnb30840c3hyx6dk2gdjqqh3hysp"))
592 (modules '((guix build utils)))
593 (snippet '(delete-file-recursively "thirdparty"))))
594 (build-system gnu-build-system)
597 ("freeglut" ,freeglut)
598 ("freetype" ,freetype)
599 ("harfbuzz" ,harfbuzz)
600 ("jbig2dec" ,jbig2dec)
605 ("openjpeg" ,openjpeg)
609 `(("pkg-config" ,pkg-config)))
611 '(#:tests? #f ; no check target
612 #:make-flags (list "CC=gcc"
614 (string-append "prefix=" (assoc-ref %outputs "out")))
615 #:phases (modify-phases %standard-phases
616 (delete 'configure))))
617 (home-page "https://mupdf.com")
618 (synopsis "Lightweight PDF viewer and toolkit")
620 "MuPDF is a C library that implements a PDF and XPS parsing and
621 rendering engine. It is used primarily to render pages into bitmaps,
622 but also provides support for other operations such as searching and
623 listing the table of contents and hyperlinks.
625 The library ships with a rudimentary X11 viewer, and a set of command
626 line tools for batch rendering @command{pdfdraw}, rewriting files
627 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
628 (license license:agpl3+)))
636 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
637 "/qpdf-" version ".tar.gz"))
640 "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9"))
641 (modules '((guix build utils)))
643 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
644 ;; dependency on Perl.
645 '(substitute* "qpdf/fix-qdf"
646 (("#!/usr/bin/env perl")
648 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
649 & eval 'exec perl -wS \"$0\" $argv:q'
651 (build-system gnu-build-system)
653 `(#:disallowed-references (,perl)
655 (modify-phases %standard-phases
656 (add-before 'configure 'patch-paths
658 (substitute* "make/libtool.mk"
660 (string-append "SHELL=" (which "bash"))))
662 '("qtest/bin/qtest-driver")
663 (find-files "." "\\.test"))
664 (("/usr/bin/env") (which "env"))))))))
666 `(("pkg-config" ,pkg-config)
672 (synopsis "Command-line tools and library for transforming PDF files")
674 "QPDF is a command-line program that does structural, content-preserving
675 transformations on PDF files. It could have been called something like
676 pdf-to-pdf. It includes support for merging and splitting PDFs and to
677 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
678 program capable of converting PDF into other formats.")
679 (license license:clarified-artistic)
680 (home-page "http://qpdf.sourceforge.net/")))
682 (define-public xournal
689 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
690 "/xournal-" version ".tar.gz"))
693 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
694 (build-system gnu-build-system)
700 ("libgnomecanvas" ,libgnomecanvas)))
702 `(("pkg-config" ,pkg-config)))
703 (home-page "http://xournal.sourceforge.net/")
704 (synopsis "Notetaking using a stylus")
706 "Xournal is an application for notetaking, sketching, keeping a journal
708 (license license:gpl2+)))
710 (define-public python-reportlab
712 (name "python-reportlab")
716 (uri (pypi-uri "reportlab" version))
719 "0hy304pzsz9lblmk7mrbk2682bi911lxgvzx2kcfpmfzb5gg7sjv"))))
720 (build-system python-build-system)
722 '(;; FIXME: There is one test failure, but it does not cause the
723 ;; build to fail. No time to investigate right now.
724 #:test-target "tests"))
726 `(("python-pillow" ,python-pillow)))
727 (home-page "https://www.reportlab.com")
728 (synopsis "Python library for generating PDFs and graphics")
729 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
730 of rich PDF documents, and also creation of charts in a variety of bitmap and
732 (license license:bsd-3)))
734 (define-public python2-reportlab
735 (package-with-python2 python-reportlab))
737 (define-public impressive
744 "mirror://sourceforge/impressive/Impressive/"
745 version "/Impressive-" version ".tar.gz"))
748 "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr"))))
749 (build-system python-build-system)
751 ;; TODO: Add dependency on pdftk.
752 (inputs `(("python2-pygame" ,python2-pygame)
753 ("python2-pillow" ,python2-pillow)
759 #:phases (modify-phases %standard-phases
764 (lambda* (#:key inputs outputs #:allow-other-keys)
765 ;; There's no 'setup.py' so install things manually.
766 (let* ((out (assoc-ref outputs "out"))
767 (bin (string-append out "/bin"))
768 (man1 (string-append out "/share/man/man1"))
769 (sdl (assoc-ref inputs "sdl"))
770 (xpdf (assoc-ref inputs "xpdf")))
772 (copy-file "impressive.py"
773 (string-append bin "/impressive"))
774 (wrap-program (string-append bin "/impressive")
775 `("LIBRARY_PATH" ":" prefix ;for ctypes
776 (,(string-append sdl "/lib")))
777 `("PATH" ":" prefix ;for pdftoppm
778 (,(string-append xpdf "/bin"))))
779 (install-file "impressive.1" man1)
781 (home-page "http://impressive.sourceforge.net")
782 (synopsis "PDF presentation tool with visual effects")
784 "Impressive is a tool to display PDF files that provides visual effects
785 such as smooth alpha-blended slide transitions. It provides additional tools
786 such as zooming, highlighting an area of the screen, and a tool to navigate
788 (license license:gpl2)))
794 (home-page "https://www.kraxel.org/blog/linux/fbida/")
797 (uri (string-append "https://www.kraxel.org/releases/fbida/"
798 name "-" version ".tar.gz"))
801 "0bw224vb7jh0lrqaf4jgxk48xglvxs674qcpj5y0axyfbh896cfk"))))
802 (build-system gnu-build-system)
805 (modify-phases %standard-phases
806 (add-after 'unpack 'patch-ldconfig
808 (substitute* "mk/Autoconf.mk"
809 (("/sbin/ldconfig -p") "echo lib")) #t))
812 #:make-flags (list "CC=gcc"
813 (string-append "prefix=" (assoc-ref %outputs "out")))))
814 (inputs `(("libjpeg" ,libjpeg)
820 ("imagemagick" ,imagemagick)
823 ("cairo-xcb" ,cairo-xcb)
824 ("freetype" ,freetype)
825 ("fontconfig" ,fontconfig)
828 ("libepoxy" ,libepoxy)
830 ("poppler" ,poppler)))
831 (native-inputs `(("pkg-config" ,pkg-config)))
832 (synopsis "Framebuffer and drm-based image viewer")
834 "fbida contains a few applications for viewing and editing images on
837 (license license:gpl2+)))
839 (define-public pdf2svg
846 "https://github.com/dawbarton/pdf2svg/archive/v"
848 (file-name (string-append name "-" version ".tar.gz"))
851 "12pa1pajirnlrkz2il3h4l30lc2prryk1qr132jk6z9y1c3qdcag"))))
852 (build-system gnu-build-system)
855 ("poppler" ,poppler)))
857 `(("pkg-config" ,pkg-config)))
858 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
859 (synopsis "PDF to SVG converter")
860 (description "@command{pdf2svg} is a simple command-line PDF to SVG
861 converter using the Poppler and Cairo libraries.")
862 (license license:gpl2+)))
864 (define-public python-pypdf2
866 (name "python-pypdf2")
870 (uri (pypi-uri "PyPDF2" version))
873 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
874 (build-system python-build-system)
877 (modify-phases %standard-phases
879 'unpack 'patch-test-suite
881 ;; The text-file needs to be opened in binary mode for Python 3,
882 ;; so patch in the "b"
883 (substitute* "Tests/tests.py"
884 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
885 (string-append line "b")))
889 (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))
890 (home-page "http://mstamy2.github.com/PyPDF2")
891 (synopsis "Pure Python PDF toolkit")
892 (description "PyPDF2 is a pure Python PDF library capable of:
895 @item extracting document information (title, author, …)
896 @item splitting documents page by page
897 @item merging documents page by page
899 @item merging multiple pages into a single page
900 @item encrypting and decrypting PDF files
903 By being pure Python, it should run on any Python platform without any
904 dependencies on external libraries. It can also work entirely on
905 @code{StringIO} objects rather than file streams, allowing for PDF
906 manipulation in memory. It is therefore a useful tool for websites that
907 manage or manipulate PDFs.")
908 (license license:bsd-3)))
910 (define-public python2-pypdf2
911 (package-with-python2 python-pypdf2))
913 (define-public python2-pypdf
915 (name "python2-pypdf")
919 (uri (pypi-uri "pyPdf" version))
922 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
923 (build-system python-build-system)
925 `(#:tests? #f ; no tests
927 (home-page "http://pybrary.net/pyPdf/")
928 (synopsis "Pure Python PDF toolkit")
929 (description "PyPDF2 is a pure Python PDF toolkit.
931 Note: This module isn't maintained anymore. For new projects please use
932 python-pypdf2 instead.")
933 (license license:bsd-3)))
935 (define-public pdfposter
941 (uri (pypi-uri "pdftools.pdfposter" version ".tar.bz2"))
944 "1i9jqawf279va089ykicglcq4zlsnwgcnsdzaa8vnm836lqhywma"))))
945 (build-system python-build-system)
947 `(#:tests? #f ; no test suite, only for visual control
950 ;; pdfposter 0.6.0 still uses the old pyPdf
951 `(("python2-pypdf" ,python2-pypdf)))
952 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
953 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
954 (description "@command{pdfposter} can be used to create a large poster by
955 building it from multple pages and/or printing it on large media. It expects
956 as input a PDF file, normally printing on a single page. The output is again
957 a PDF file, maybe containing multiple pages together building the poster. The
958 input page will be scaled to obtain the desired size.
960 This is much like @command{poster} does for Postscript files, but working with
961 PDF. Since sometimes @command{poster} does not like your files converted from
962 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
963 (license license:gpl3+)))
965 (define-public pdfgrep
972 (uri (string-append "https://pdfgrep.org/download/"
973 name "-" version ".tar.gz"))
976 "07llkrkcfjwd3ybai9ad10ybhr0biffcplmy7lw4fb87nd2dfw03"))))
977 (build-system gnu-build-system)
979 `(("pkg-config" ,pkg-config)))
981 `(("libgcrypt" ,libgcrypt)
983 ("poppler" ,poppler)))
984 (home-page "https://pdfgrep.org")
985 (synopsis "Command-line utility to search text in PDF files")
987 "Pdfgrep searches in pdf files for strings matching a regular expression.
988 Support some GNU grep options as file name output, page number output,
989 optional case insensitivity, count occurrences, color highlights and search in
991 (license license:gpl2+)))