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, 2018, 2019 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@n0.is>
8 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
11 ;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
12 ;;; Copyright © 2016, 2019 Arun Isaac <arunisaac@systemreboot.net>
13 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
14 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
15 ;;; Copyright © 2017, 2018 Rene Saavedra <pacoon@protonmail.com>
16 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
17 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
18 ;;; Copyright © 2019 Ben Sturmfels <ben@sturm.com.au>
19 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
20 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
22 ;;; This file is part of GNU Guix.
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
37 (define-module (gnu packages pdf)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (guix packages)
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module (guix utils)
43 #:use-module (guix build-system gnu)
44 #:use-module (guix build-system cmake)
45 #:use-module (guix build-system meson)
46 #:use-module (guix build-system python)
47 #:use-module (guix build-system trivial)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages audio)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages backup)
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
54 #:use-module (gnu packages check)
55 #:use-module (gnu packages compression)
56 #:use-module (gnu packages curl)
57 #:use-module (gnu packages djvu)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages game-development)
60 #:use-module (gnu packages gcc)
61 #:use-module (gnu packages gettext)
62 #:use-module (gnu packages ghostscript)
63 #:use-module (gnu packages gl)
64 #:use-module (gnu packages glib)
65 #:use-module (gnu packages gnome)
66 #:use-module (gnu packages gnupg)
67 #:use-module (gnu packages gstreamer)
68 #:use-module (gnu packages gtk)
69 #:use-module (gnu packages image)
70 #:use-module (gnu packages imagemagick)
71 #:use-module (gnu packages javascript)
72 #:use-module (gnu packages lesstif)
73 #:use-module (gnu packages libffi)
74 #:use-module (gnu packages linux)
75 #:use-module (gnu packages lua)
76 #:use-module (gnu packages pcre)
77 #:use-module (gnu packages perl)
78 #:use-module (gnu packages photo)
79 #:use-module (gnu packages pkg-config)
80 #:use-module (gnu packages pulseaudio)
81 #:use-module (gnu packages python)
82 #:use-module (gnu packages python-check)
83 #:use-module (gnu packages python-web)
84 #:use-module (gnu packages python-xyz)
85 #:use-module (gnu packages qt)
86 #:use-module (gnu packages sdl)
87 #:use-module (gnu packages sphinx)
88 #:use-module (gnu packages sqlite)
89 #:use-module (gnu packages tex)
90 #:use-module (gnu packages tls)
91 #:use-module (gnu packages xdisorg)
92 #:use-module (gnu packages xml)
93 #:use-module (gnu packages xorg)
94 #:use-module (srfi srfi-1))
96 (define-public poppler
102 (uri (string-append "https://poppler.freedesktop.org/poppler-"
106 "1j18jlv1q6h21azb939gqjsgcbsh5qcd8dwxdmad54p5ixha91gr"))))
107 (build-system cmake-build-system)
110 (inputs `(("fontconfig" ,fontconfig)
111 ("freetype" ,freetype)
112 ("libjpeg" ,libjpeg-turbo)
116 ("openjpeg" ,openjpeg)
119 ;; To build poppler-glib (as needed by Evince), we need Cairo and
120 ;; GLib. But of course, that Cairo must not depend on Poppler.
121 ("cairo" ,(package (inherit cairo)
122 (inputs (alist-delete "poppler"
123 (package-inputs cairo)))))))
125 ;; As per poppler-cairo and poppler-glib.pc.
126 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
127 ;; different solution to the circular dependency mentioned above.
130 `(("pkg-config" ,pkg-config)
131 ("glib" ,glib "bin") ; glib-mkenums, etc.
132 ("gobject-introspection" ,gobject-introspection)))
134 `(#:tests? #f ; no test data provided with the tarball
136 (let* ((out (assoc-ref %outputs "out"))
137 (lib (string-append out "/lib")))
138 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
140 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
141 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
142 (synopsis "PDF rendering library")
144 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
145 (license license:gpl2+)
146 (home-page "https://poppler.freedesktop.org/")))
148 (define-public poppler-data
150 (name "poppler-data")
154 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
155 "-" version ".tar.gz"))
158 "04i0wgdkn5lhda8cyxd1ll4a2p41pwqrwd47n9mdpl7cx5ypx70z"))))
159 (build-system gnu-build-system)
161 '(#:tests? #f ; no test suite
162 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
164 (modify-phases %standard-phases
165 ;; The package only provides some data files, so there is nothing to
169 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
170 (description "This package provides optional encoding files for Poppler.
171 When present, Poppler is able to correctly render CJK and Cyrillic text.")
172 (home-page (package-home-page poppler))
173 ;; See COPYING in the source distribution for more information about
175 (license (list license:bsd-3
178 (define-public poppler-qt4
179 (package/inherit poppler
181 (inputs `(("qt-4" ,qt-4)
182 ,@(package-inputs poppler)))
183 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
185 (define-public poppler-qt5
186 (package/inherit poppler
188 (inputs `(("qtbase" ,qtbase)
189 ,@(package-inputs poppler)))
190 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
192 (define-public python-poppler-qt5
194 (name "python-poppler-qt5")
199 (uri (pypi-uri "python-poppler-qt5" version))
202 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
203 (build-system python-build-system)
205 `(;; There are no tests. The check phase just causes a rebuild.
208 (modify-phases %standard-phases
210 (lambda* (#:key inputs #:allow-other-keys)
211 (substitute* "setup.py"
212 ;; This check always fails, so disable it.
213 (("if not check_qtxml\\(\\)")
215 ;; We need to pass an extra flag here. This cannot be in
216 ;; configure-flags because it should not be passed for the
217 ;; installation phase.
218 ((@@ (guix build python-build-system) call-setuppy)
219 "build_ext" (list (string-append "--pyqt-sip-dir="
220 (assoc-ref inputs "python-pyqt")
221 "/share/sip")) #t))))))
223 `(("pkg-config" ,pkg-config)))
225 `(("python-sip" ,python-sip)
226 ("python-pyqt" ,python-pyqt)
227 ("poppler-qt5" ,poppler-qt5)
229 (home-page "https://pypi.org/project/python-poppler-qt5/")
230 (synopsis "Python bindings for Poppler-Qt5")
232 "This package provides Python bindings for the Qt5 interface of the
233 Poppler PDF rendering library.")
234 (license license:lgpl2.1+)))
236 (define-public libharu
243 (url "https://github.com/libharu/libharu.git")
244 (commit (string-append
246 (string-join (string-split version #\.) "_")))))
247 (file-name (git-file-name name version))
250 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
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")))))
262 `(("autoconf" ,autoconf)
263 ("automake" ,automake)
264 ("libtool" ,libtool)))
265 (home-page "http://libharu.org/")
266 (synopsis "Library for generating PDF files")
268 "libHaru is a library for generating PDF files. libHaru does not support
269 reading and editing of existing PDF files.")
270 (license license:zlib)))
279 (uri (string-append "https://xpdfreader-dl.s3.amazonaws.com/xpdf-"
280 version "4.02.tar.gz"))
282 (base32 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
283 (build-system gnu-build-system)
284 (inputs `(("freetype" ,freetype)
285 ("gs-fonts" ,gs-fonts)
287 ("libpaper" ,libpaper)
296 `(#:tests? #f ; there is no check target
297 #:parallel-build? #f ; build fails randomly on 8-way machines
299 (list (string-append "--with-freetype2-includes="
300 (assoc-ref %build-inputs "freetype")
301 "/include/freetype2"))
303 (modify-phases %standard-phases
305 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
306 (let* ((install (assoc-ref %standard-phases 'install))
307 (out (assoc-ref outputs "out"))
308 (xpdfrc (string-append out "/etc/xpdfrc"))
309 (gs-fonts (assoc-ref inputs "gs-fonts")))
312 (("/usr/local/share/ghostscript/fonts")
313 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
314 (("#fontFile") "fontFile")))
316 (synopsis "Viewer for PDF files based on the Motif toolkit")
318 "Xpdf is a viewer for Portable Document Format (PDF) files.")
319 (license license:gpl3) ; or gpl2, but not gpl2+
320 (home-page "https://www.xpdfreader.com/")))
322 (define-public zathura-cb
329 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
333 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
334 (native-inputs `(("pkg-config" ,pkg-config)))
335 (inputs `(("libarchive" ,libarchive)
336 ("zathura" ,zathura)))
337 (build-system meson-build-system)
339 `(#:tests? #f ; package does not contain tests
341 (modify-phases %standard-phases
342 (add-after 'unpack 'patch-plugin-directory
343 ;; Something of a regression in 0.1.8: the new Meson build system
344 ;; now hard-codes an incorrect plugin directory. Fix it.
345 (lambda* (#:key outputs #:allow-other-keys)
346 (substitute* "meson.build"
347 (("(install_dir:).*" _ key)
349 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
351 (home-page "https://pwmt.org/projects/zathura-cb/")
352 (synopsis "Comic book support for zathura (libarchive backend)")
353 (description "The zathura-cb plugin adds comic book support to zathura
355 (license license:zlib)))
357 (define-public zathura-ps
364 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
368 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
369 (native-inputs `(("pkg-config" ,pkg-config)))
370 (inputs `(("libspectre" ,libspectre)
371 ("zathura" ,zathura)))
372 (build-system meson-build-system)
374 `(#:tests? #f ; package does not contain tests
376 (modify-phases %standard-phases
377 (add-after 'unpack 'patch-plugin-directory
378 ;; Something of a regression in 0.2.6: the new Meson build system
379 ;; now hard-codes an incorrect plugin directory. Fix it.
380 (lambda* (#:key outputs #:allow-other-keys)
381 (substitute* "meson.build"
382 (("(install_dir:).*" _ key)
384 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
386 (home-page "https://pwmt.org/projects/zathura-ps/")
387 (synopsis "PS support for zathura (libspectre backend)")
388 (description "The zathura-ps plugin adds PS support to zathura
390 (license license:zlib)))
392 (define-public zathura-djvu
394 (name "zathura-djvu")
399 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
403 "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"))))
404 (native-inputs `(("pkg-config" ,pkg-config)))
406 `(("djvulibre" ,djvulibre)
407 ("zathura" ,zathura)))
408 (build-system meson-build-system)
410 `(#:tests? #f ; package does not contain tests
412 (modify-phases %standard-phases
413 (add-after 'unpack 'patch-plugin-directory
414 ;; Something of a regression in 0.2.8: the new Meson build system
415 ;; now hard-codes an incorrect plugin directory. Fix it.
416 (lambda* (#:key outputs #:allow-other-keys)
417 (substitute* "meson.build"
418 (("(install_dir:).*" _ key)
420 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
422 (home-page "https://pwmt.org/projects/zathura-djvu/")
423 (synopsis "DjVu support for zathura (DjVuLibre backend)")
424 (description "The zathura-djvu plugin adds DjVu support to zathura
425 using the DjVuLibre library.")
426 (license license:zlib)))
428 (define-public zathura-pdf-mupdf
430 (name "zathura-pdf-mupdf")
435 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
436 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
439 "1pjwsb7zwclxsvz229fl7y2saf1pv3ifwv3ay8viqxgrp9x3z9hq"))))
440 (native-inputs `(("pkg-config" ,pkg-config)))
442 `(("jbig2dec" ,jbig2dec)
446 ("openjpeg" ,openjpeg)
448 ("zathura" ,zathura)))
449 (build-system meson-build-system)
451 `(#:tests? #f ; package does not contain tests
452 #:configure-flags (list (string-append "-Dplugindir="
453 (assoc-ref %outputs "out")
455 "-Dlink-external=true")
457 (modify-phases %standard-phases
458 (add-before 'configure 'add-mujs-to-dependencies
460 ;; Add mujs to the 'build_dependencies'.
461 (substitute* "meson.build"
462 (("^ libopenjp2 = dependency.*" x)
463 (string-append x " mujs = cc.find_library('mujs')\n"))
465 " libopenjp2, mujs")))))))
466 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
467 (synopsis "PDF support for zathura (mupdf backend)")
468 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
469 by using the @code{mupdf} rendering library.")
470 (license license:zlib)))
472 (define-public zathura-pdf-poppler
474 (name "zathura-pdf-poppler")
479 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
483 "1vfl4vkyy3rf39r1sqaa7y8113bgkh2bkfq3nn2inis9mrykmk6m"))))
484 (native-inputs `(("pkg-config" ,pkg-config)))
486 `(("poppler" ,poppler)
487 ("zathura" ,zathura)))
488 (build-system meson-build-system)
490 `(#:tests? #f ; package does not include tests
492 (modify-phases %standard-phases
493 (add-after 'unpack 'patch-plugin-directory
494 ;; Something of a regression in 0.2.9: the new Meson build system
495 ;; now hard-codes an incorrect plugin directory. Fix it.
496 (lambda* (#:key outputs #:allow-other-keys)
497 (substitute* "meson.build"
498 (("(install_dir:).*" _ key)
500 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
502 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
503 (synopsis "PDF support for zathura (poppler backend)")
504 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
505 by using the poppler rendering engine.")
506 (license license:zlib)))
508 (define-public zathura
515 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
519 "0b3nrcvykkpv2vm99kijnic2gpfzva520bsjlihaxandzfm9ff8c"))))
520 (native-inputs `(("pkg-config" ,pkg-config)
521 ("gettext" ,gettext-minimal)
522 ("glib:bin" ,glib "bin")
524 ;; For building documentation.
525 ("python-sphinx" ,python-sphinx)
527 ;; For building icons.
532 ("xorg-server" ,xorg-server-for-tests)))
533 (inputs `(("sqlite" ,sqlite)))
534 ;; Listed in 'Requires.private' of 'zathura.pc'.
535 (propagated-inputs `(("cairo" ,cairo)
538 (list (search-path-specification
539 (variable "ZATHURA_PLUGINS_PATH")
540 (files '("lib/zathura")))))
541 (build-system meson-build-system)
543 `(#:phases (modify-phases %standard-phases
544 (add-before 'check 'start-xserver
545 ;; Tests require a running X server.
546 (lambda* (#:key inputs #:allow-other-keys)
547 (let ((xorg-server (assoc-ref inputs "xorg-server"))
549 (setenv "DISPLAY" display)
551 ;; On busy machines, tests may take longer than
552 ;; the default of four seconds.
553 (setenv "CK_DEFAULT_TIMEOUT" "20")
555 ;; Don't fail due to missing '/etc/machine-id'.
556 (setenv "DBUS_FATAL_WARNINGS" "0")
557 (zero? (system (string-append xorg-server "/bin/Xvfb "
558 display " &")))))))))
559 (home-page "https://pwmt.org/projects/zathura/")
560 (synopsis "Lightweight keyboard-driven PDF viewer")
561 (description "Zathura is a customizable document viewer. It provides a
562 minimalistic interface and an interface that mainly focuses on keyboard
564 (license license:zlib)))
566 (define-public podofo
572 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
573 "/podofo-" version ".tar.gz"))
576 "0wj0y4zcmj4q79wrn3vv3xq4bb0vhhxs8yifafwy9f2sjm83c5p9"))
577 (patches (search-patches "podofo-cmake-3.12.patch"))))
578 (build-system cmake-build-system)
580 `(("cppunit" ,cppunit)
581 ("pkg-config" ,pkg-config)))
583 `(("libjpeg" ,libjpeg)
585 ("fontconfig" ,fontconfig)
586 ("freetype" ,freetype)
592 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
593 "-DPODOFO_BUILD_STATIC=ON")
595 (modify-phases %standard-phases
596 (add-before 'configure 'patch
597 (lambda* (#:key inputs #:allow-other-keys)
598 (let ((freetype (assoc-ref inputs "freetype")))
599 ;; Look for freetype include files in the correct place.
600 (substitute* "cmake/modules/FindFREETYPE.cmake"
601 (("/usr/local") freetype)))
603 (home-page "http://podofo.sourceforge.net")
604 (synopsis "Tools to work with the PDF file format")
606 "PoDoFo is a C++ library and set of command-line tools to work with the
607 PDF file format. It can parse PDF files and load them into memory, and makes
608 it easy to modify them and write the changes to disk. It is primarily useful
609 for applications that wish to do lower level manipulation of PDF, such as
610 extracting content or merging files.")
611 (license license:lgpl2.0+)))
620 (uri (string-append "https://mupdf.com/downloads/archive/"
621 name "-" version "-source.tar.xz"))
624 "1npmy92lkj41nnc14b4fpq7z62pminy94zsdbrczj22jpn283rvg"))
625 (modules '((guix build utils)))
627 ;; We keep lcms2 since it is different than our lcms.
631 (delete-file-recursively (string-append "thirdparty/" dir)))
632 '("freeglut" "freetype" "harfbuzz" "jbig2dec"
633 "libjpeg" "mujs" "openjpeg" "zlib"))
635 (build-system gnu-build-system)
638 ("freeglut" ,freeglut)
639 ("freetype" ,freetype)
640 ("harfbuzz" ,harfbuzz)
641 ("jbig2dec" ,jbig2dec)
646 ("openjpeg" ,openjpeg)
650 `(("pkg-config" ,pkg-config)))
652 '(#:tests? #f ; no check target
653 #:make-flags (list "CC=gcc"
655 "USE_SYSTEM_LIBS=yes"
656 "USE_SYSTEM_MUJS=yes"
657 (string-append "prefix=" (assoc-ref %outputs "out")))
658 #:phases (modify-phases %standard-phases
659 (delete 'configure))))
660 (home-page "https://mupdf.com")
661 (synopsis "Lightweight PDF viewer and toolkit")
663 "MuPDF is a C library that implements a PDF and XPS parsing and
664 rendering engine. It is used primarily to render pages into bitmaps,
665 but also provides support for other operations such as searching and
666 listing the table of contents and hyperlinks.
668 The library ships with a rudimentary X11 viewer, and a set of command
669 line tools for batch rendering @command{pdfdraw}, rewriting files
670 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
671 (license (list license:agpl3+
672 license:bsd-3 ; resources/cmaps
673 license:x11 ; thirdparty/lcms2
674 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
675 license:asl2.0)))) ; resources/fonts/droid
683 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
684 "/qpdf-" version ".tar.gz"))
687 "0ygd80wxcmh613n04x2kmf8wlsl0drxyd5wwdcrm1rzj0xwvpfrs"))
688 (modules '((guix build utils)))
690 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
691 ;; dependency on Perl.
693 (substitute* "qpdf/fix-qdf"
694 (("#!/usr/bin/env perl")
696 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
697 & eval 'exec perl -wS \"$0\" $argv:q'
700 (build-system gnu-build-system)
702 `(#:disallowed-references (,perl)
704 (modify-phases %standard-phases
705 (add-before 'configure 'patch-paths
707 (substitute* "make/libtool.mk"
709 (string-append "SHELL=" (which "bash"))))
711 '("qtest/bin/qtest-driver")
712 (find-files "." "\\.test"))
713 (("/usr/bin/env") (which "env")))
716 `(("pkg-config" ,pkg-config)
719 ;; In Requires.private of libqpdf.pc.
720 `(("libjpeg-turbo" ,libjpeg-turbo)
722 (synopsis "Command-line tools and library for transforming PDF files")
724 "QPDF is a command-line program that does structural, content-preserving
725 transformations on PDF files. It could have been called something like
726 pdf-to-pdf. It includes support for merging and splitting PDFs and to
727 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
728 program capable of converting PDF into other formats.")
729 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
730 ;; Users can still choose to use the old license at their option.
731 (license (list license:asl2.0 license:clarified-artistic))
732 (home-page "http://qpdf.sourceforge.net/")))
734 (define-public xournal
737 (version "0.4.8.2016")
741 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
742 "/xournal-" version ".tar.gz"))
745 "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
746 (build-system gnu-build-system)
752 ("libgnomecanvas" ,libgnomecanvas)))
754 `(("pkg-config" ,pkg-config)))
755 (home-page "http://xournal.sourceforge.net/")
756 (synopsis "Notetaking using a stylus")
758 "Xournal is an application for notetaking, sketching, keeping a journal
760 (license license:gpl2+)))
762 (define-public xournalpp
770 (url "https://github.com/xournalpp/xournalpp.git")
772 (file-name (git-file-name name version))
774 (base32 "0xw2mcgnm4sa9hrhfgp669lfypw97drxjmz5w8i5whaprpvmkxzw"))))
775 (build-system cmake-build-system)
777 `(#:configure-flags (list "-DENABLE_CPPUNIT=ON") ;enable tests
778 #:imported-modules ((guix build glib-or-gtk-build-system)
779 ,@%cmake-build-system-modules)
780 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
781 (guix build cmake-build-system)
784 (modify-phases %standard-phases
785 (add-after 'unpack 'fix-permissions-on-po-files
787 ;; Always generate translations. A recent upstream patch
789 (substitute* "po/CMakeLists.txt"
790 (("gettext_create_translations \\(\"\\$\\{potfile\\}\"\\)")
791 "gettext_create_translations (\"${potfile}\" ALL)"))
792 ;; Make sure 'msgmerge' can modify the PO files.
793 (for-each (lambda (po) (chmod po #o666))
794 (find-files "." "\\.po$"))
796 (add-after 'install 'glib-or-gtk-wrap
797 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
799 `(("cppunit" ,cppunit)
800 ("gcc" ,gcc-8) ;requires gcc 8+
801 ("gettext" ,gettext-minimal)
802 ("pkg-config" ,pkg-config)))
804 `(("alsa-lib" ,alsa-lib)
807 ("libsndfile" ,libsndfile)
810 ("lua" ,lua) ;FIXME: It cannot find the Lua library.
812 ("portaudio" ,portaudio)
813 ("texlive-bin" ,texlive-bin)))
814 (home-page "https://github.com/xournalpp/xournalpp")
815 (synopsis "Handwriting notetaking software with PDF annotation support")
816 (description "Xournal++ is a hand note taking software written in
817 C++ with the target of flexibility, functionality and speed. Stroke
818 recognizer and other parts are based on Xournal code.
823 @item Support for Pen pressure, e.g., Wacom Tablet
824 @item Support for annotating PDFs
825 @item Fill shape functionality
826 @item PDF Export (with and without paper style)
827 @item PNG Export (with and without transparent background)
828 @item Allow to map different tools / colors etc. to stylus buttons /
830 @item Sidebar with Page Previews with advanced page sorting, PDF
831 Bookmarks and Layers (can be individually hidden, editing layer can be
833 @item enhanced support for image insertion
834 @item Eraser with multiple configurations
836 @item bug reporting, autosave, and auto backup tools
837 @item Customizeable toolbar, with multiple configurations, e.g., to
838 optimize toolbar for portrait / landscape
839 @item Page Template definitions
840 @item Shape drawing (line, arrow, circle, rectangle)
841 @item Shape resizing and rotation
842 @item Rotation snapping every 45 degrees
843 @item Rect snapping to grid
844 @item Audio recording and playback alongside with handwritten notes
845 @item Multi Language Support, Like English, German, Italian...
846 @item Plugins using LUA Scripting
848 (license license:gpl2+)))
850 (define-public python-reportlab
852 (name "python-reportlab")
856 (uri (pypi-uri "reportlab" version))
859 "0lf8hil9nbm74zl27l8rydxbhwnpr0pbghibsqrc9sglds9l9vw3"))))
860 (build-system python-build-system)
862 '(;; FIXME: There is one test failure, but it does not cause the
863 ;; build to fail. No time to investigate right now.
864 #:test-target "tests"))
866 `(("freetype" ,freetype)))
868 `(("python-pillow" ,python-pillow)))
869 (home-page "https://www.reportlab.com")
870 (synopsis "Python library for generating PDFs and graphics")
871 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
872 of rich PDF documents, and also creation of charts in a variety of bitmap and
874 (license license:bsd-3)))
876 (define-public python2-reportlab
877 (package-with-python2 python-reportlab))
879 (define-public impressive
886 "mirror://sourceforge/impressive/Impressive/"
887 version "/Impressive-" version ".tar.gz"))
890 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
891 (build-system python-build-system)
893 ;; TODO: Add dependency on pdftk.
894 (inputs `(("python2-pygame" ,python2-pygame)
895 ("python2-pillow" ,python2-pillow)
901 #:phases (modify-phases %standard-phases
906 (lambda* (#:key inputs outputs #:allow-other-keys)
907 ;; There's no 'setup.py' so install things manually.
908 (let* ((out (assoc-ref outputs "out"))
909 (bin (string-append out "/bin"))
910 (man1 (string-append out "/share/man/man1"))
911 (sdl (assoc-ref inputs "sdl"))
912 (xpdf (assoc-ref inputs "xpdf")))
914 (copy-file "impressive.py"
915 (string-append bin "/impressive"))
916 (wrap-program (string-append bin "/impressive")
917 `("LIBRARY_PATH" ":" prefix ;for ctypes
918 (,(string-append sdl "/lib")))
919 `("PATH" ":" prefix ;for pdftoppm
920 (,(string-append xpdf "/bin"))))
921 (install-file "impressive.1" man1)
923 (home-page "http://impressive.sourceforge.net")
924 (synopsis "PDF presentation tool with visual effects")
926 "Impressive is a tool to display PDF files that provides visual effects
927 such as smooth alpha-blended slide transitions. It provides additional tools
928 such as zooming, highlighting an area of the screen, and a tool to navigate
930 (license license:gpl2)))
936 (home-page "https://www.kraxel.org/blog/linux/fbida/")
939 (uri (string-append "https://www.kraxel.org/releases/fbida/"
940 "fbida-" version ".tar.gz"))
943 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
944 (build-system gnu-build-system)
947 (modify-phases %standard-phases
948 (add-after 'unpack 'patch-FHS-file-names
950 (substitute* "mk/Autoconf.mk"
951 (("/bin/echo") "echo")
952 (("/sbin/ldconfig -p") "echo lib")) #t))
955 #:make-flags (list "CC=gcc"
956 (string-append "prefix=" (assoc-ref %outputs "out")))))
957 (inputs `(("libjpeg" ,libjpeg)
963 ("imagemagick" ,imagemagick)
966 ("cairo-xcb" ,cairo-xcb)
967 ("freetype" ,freetype)
968 ("fontconfig" ,fontconfig)
971 ("libepoxy" ,libepoxy)
973 ("poppler" ,poppler)))
974 (native-inputs `(("pkg-config" ,pkg-config)))
975 (synopsis "Framebuffer and drm-based image viewer")
977 "fbida contains a few applications for viewing and editing images on
980 (license license:gpl2+)))
982 (define-public pdf2svg
989 (url "https://github.com/dawbarton/pdf2svg.git")
990 (commit (string-append "v" version))))
991 (file-name (git-file-name name version))
994 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
995 (build-system gnu-build-system)
998 ("poppler" ,poppler)))
1000 `(("pkg-config" ,pkg-config)))
1001 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
1002 (synopsis "PDF to SVG converter")
1003 (description "@command{pdf2svg} is a simple command-line PDF to SVG
1004 converter using the Poppler and Cairo libraries.")
1005 (license license:gpl2+)))
1007 (define-public python-pypdf2
1009 (name "python-pypdf2")
1013 (uri (pypi-uri "PyPDF2" version))
1016 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
1017 (build-system python-build-system)
1020 (modify-phases %standard-phases
1022 'unpack 'patch-test-suite
1024 ;; The text-file needs to be opened in binary mode for Python 3,
1025 ;; so patch in the "b"
1026 (substitute* "Tests/tests.py"
1027 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
1028 (string-append line "b")))
1032 (invoke "python" "-m" "unittest" "Tests.tests"))))))
1033 (home-page "http://mstamy2.github.com/PyPDF2")
1034 (synopsis "Pure Python PDF toolkit")
1035 (description "PyPDF2 is a pure Python PDF library capable of:
1038 @item extracting document information (title, author, …)
1039 @item splitting documents page by page
1040 @item merging documents page by page
1041 @item cropping pages
1042 @item merging multiple pages into a single page
1043 @item encrypting and decrypting PDF files
1046 By being pure Python, it should run on any Python platform without any
1047 dependencies on external libraries. It can also work entirely on
1048 @code{StringIO} objects rather than file streams, allowing for PDF
1049 manipulation in memory. It is therefore a useful tool for websites that
1050 manage or manipulate PDFs.")
1051 (license license:bsd-3)))
1053 (define-public python2-pypdf2
1054 (package-with-python2 python-pypdf2))
1056 (define-public python2-pypdf
1058 (name "python2-pypdf")
1062 (uri (pypi-uri "pyPdf" version))
1065 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
1066 (build-system python-build-system)
1068 `(#:tests? #f ; no tests
1069 #:python ,python-2))
1070 (home-page "http://pybrary.net/pyPdf/")
1071 (synopsis "Pure Python PDF toolkit")
1072 (description "PyPDF2 is a pure Python PDF toolkit.
1074 Note: This module isn't maintained anymore. For new projects please use
1075 python-pypdf2 instead.")
1076 (license license:bsd-3)))
1078 (define-public pdfarranger
1080 (name "pdfarranger")
1086 (url "https://github.com/jeromerobert/pdfarranger.git")
1088 (file-name (git-file-name name version))
1090 (base32 "1f8m8r81322i97wkqpmf7a4kiwnq244n6cnbldh03jc49vwq2kxx"))))
1091 (build-system python-build-system)
1093 '(#:tests? #f ;no tests
1094 #:phases (modify-phases %standard-phases
1095 (add-after 'install 'wrap-for-typelib
1096 (lambda* (#:key inputs outputs #:allow-other-keys)
1097 (let* ((out (assoc-ref outputs "out"))
1098 (program (string-append out "/bin/pdfarranger")))
1099 (wrap-program program
1100 `("GI_TYPELIB_PATH" ":" prefix
1101 (,(getenv "GI_TYPELIB_PATH"))))
1104 `(("intltool" ,intltool)
1105 ("python-distutils-extra" ,python-distutils-extra)))
1108 ("poppler" ,poppler)
1109 ("python-pycairo" ,python-pycairo)
1110 ("python-pygobject" ,python-pygobject)
1111 ("python-pypdf2" ,python-pypdf2)))
1112 (home-page "https://github.com/jeromerobert/pdfarranger")
1113 (synopsis "Merge, split and re-arrange pages from PDF documents")
1115 "PDF Arranger is a small application which allows one to merge or split
1116 PDF documents and rotate, crop and rearrange their pages using an interactive
1117 and intuitive graphical interface.
1119 PDF Arranger was formerly known as PDF-Shuffler.")
1120 (license license:gpl3+)))
1122 (define-public pdfposter
1125 (version "0.7.post1")
1128 (uri (pypi-uri "pdftools.pdfposter" version))
1131 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
1132 (build-system python-build-system)
1134 `(#:tests? #f)) ; test-suite not included in source archive
1136 `(("python-pypdf2" ,python-pypdf2)))
1137 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1138 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1139 (description "@command{pdfposter} can be used to create a large poster by
1140 building it from multiple pages and/or printing it on large media. It expects
1141 as input a PDF file, normally printing on a single page. The output is again
1142 a PDF file, maybe containing multiple pages together building the poster. The
1143 input page will be scaled to obtain the desired size.
1145 This is much like @command{poster} does for Postscript files, but working with
1146 PDF. Since sometimes @command{poster} does not like your files converted from
1147 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1148 (license license:gpl3+)))
1150 (define-public pdfgrep
1157 (uri (string-append "https://pdfgrep.org/download/"
1158 name "-" version ".tar.gz"))
1161 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
1162 (build-system gnu-build-system)
1164 `(("pkg-config" ,pkg-config)))
1166 `(("libgcrypt" ,libgcrypt)
1168 ("poppler" ,poppler)))
1169 (home-page "https://pdfgrep.org")
1170 (synopsis "Command-line utility to search text in PDF files")
1172 "Pdfgrep searches in pdf files for strings matching a regular expression.
1173 Support some GNU grep options as file name output, page number output,
1174 optional case insensitivity, count occurrences, color highlights and search in
1176 (license license:gpl2+)))
1178 (define-public pdfpc
1186 (url "https://github.com/pdfpc/pdfpc.git")
1187 (commit (string-append "v" version))))
1188 (file-name (git-file-name name version))
1190 (base32 "07aafsm4jzdgpahz83p0ajv40hry7gviyadqi13ahr8xdhhwy2sd"))))
1191 (build-system cmake-build-system)
1192 (arguments '(#:tests? #f)) ; no test target
1196 ("gstreamer" ,gstreamer)
1197 ("gst-plugins-base" ,gst-plugins-base)
1199 ("poppler" ,poppler)
1203 `(("pkg-config" ,pkg-config)))
1204 (home-page "https://pdfpc.github.io/")
1205 (synopsis "Presenter console with multi-monitor support for PDF files")
1207 "pdfpc is a presentation viewer application which uses multi-monitor
1208 output to provide meta information to the speaker during the presentation. It
1209 is able to show a normal presentation window on one screen, while showing a
1210 more sophisticated overview on the other one providing information like a
1211 picture of the next slide, as well as the left over time till the end of the
1212 presentation. The input files processed by pdfpc are PDF documents.")
1213 (license license:gpl2+)))
1222 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1223 version "/paps-" version ".tar.gz"))
1225 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1226 (build-system gnu-build-system)
1228 `(("pango" ,pango)))
1230 `(("intltool" ,intltool)
1231 ("pkg-config" ,pkg-config)))
1232 (home-page "https://github.com/dov/paps")
1233 (synopsis "Pango to PostScript converter")
1235 "Paps reads a UTF-8 encoded file and generates a PostScript language
1236 rendering of the file. The rendering is done by creating outline curves
1237 through the Pango @code{ft2} backend.")
1238 (license license:lgpl2.0+)))
1240 (define-public stapler
1248 (url "https://github.com/hellerbarde/stapler")
1250 (file-name (git-file-name name version))
1253 "06w7xanzr7cicqik62g7zqs57j4y6fc7hflrc1rlmphxx40hkg6r"))))
1254 (build-system python-build-system)
1256 `(("python2-pypdf2" ,python2-pypdf2)))
1258 `(#:python ,python-2
1260 (modify-phases %standard-phases
1261 (add-after 'unpack 'fix-pypdf-version-requirement
1262 ;; A PyPDF2 version requirement of 1.25.1 is hard-coded in
1263 ;; setup.py. Relax it to work with any version of PyPDF2.
1265 (substitute* "setup.py"
1266 (("PyPDF2==1.25.1") "PyPDF2"))
1268 (home-page "https://github.com/hellerbarde/stapler")
1269 (synopsis "PDF manipulation tool")
1270 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1271 manipulating PDF documents from the command line. It supports
1274 @item cherry-picking pages and concatenating them into a new file
1275 @item splitting a PDF document into single pages each in its own file
1276 @item merging PDF documents with their pages interleaved
1277 @item displaying metadata in a PDF document
1278 @item displaying the mapping between logical and physical page numbers
1280 (license license:bsd-3)))
1282 (define-public weasyprint
1289 (uri (pypi-uri "WeasyPrint" version))
1291 (base32 "0skdzwq7cd715dnnds6abx0k0xmmnmsqp0vb1r1w20sg7abp3sdk"))
1292 (patches (search-patches "weasyprint-library-paths.patch"))))
1293 (build-system python-build-system)
1296 (modify-phases %standard-phases
1297 (add-after 'unpack 'patch-library-paths
1298 (lambda* (#:key inputs #:allow-other-keys)
1299 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1300 (glib (assoc-ref inputs "glib"))
1301 (pango (assoc-ref inputs "pango"))
1302 (pangoft2 (assoc-ref inputs "pangoft2")))
1303 (substitute* "weasyprint/fonts.py"
1305 (string-append fontconfig "/lib/libfontconfig.so"))
1307 (string-append pango "/lib/libpangoft2-1.0.so")))
1308 (substitute* "weasyprint/text.py"
1310 (string-append glib "/lib/libgobject-2.0.so"))
1312 (string-append pango "/lib/libpango-1.0.so"))
1314 (string-append pango "/lib/libpangocairo-1.0.so"))))))
1315 (add-after 'unpack 'remove-pytest-options
1317 (substitute* "setup.cfg"
1318 ;; flake8 and isort syntax checks fail, which is not our
1320 (("addopts = --flake8 --isort") ""))))
1323 ;; Run pytest, excluding one failing test.
1324 (invoke "pytest" "-k" "not test_flex_column_wrap_reverse"))))))
1326 `(("fontconfig" ,fontconfig)
1330 `(("gdk-pixbuf" ,gdk-pixbuf)
1331 ("python-cairocffi" ,python-cairocffi)
1332 ("python-cairosvg" ,python-cairosvg)
1333 ("python-cffi" ,python-cffi)
1334 ("python-cssselect2" ,python-cssselect2)
1335 ("python-html5lib" ,python-html5lib)
1336 ("python-pyphen" ,python-pyphen)
1337 ("python-tinycss2" ,python-tinycss2)))
1339 `(("python-pytest-cov" ,python-pytest-cov)
1340 ("python-pytest-runner" ,python-pytest-runner)))
1341 (home-page "https://weasyprint.org/")
1342 (synopsis "Document factory for creating PDF files from HTML")
1343 (description "WeasyPrint helps web developers to create PDF documents. It
1344 turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1347 From a technical point of view, WeasyPrint is a visual rendering engine for
1348 HTML and CSS that can export to PDF and PNG. It aims to support web standards
1351 It is based on various libraries but not on a full rendering engine like
1352 WebKit or Gecko. The CSS layout engine is written in Python, designed for
1353 pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1356 Keywords: html2pdf, htmltopdf")
1357 (license license:bsd-3)))