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 Nikita <nikita@n0.is>
8 ;;; Copyright © 2016, 2017, 2018, 2019, 2020 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,2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
20 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
21 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
23 ;;; This file is part of GNU Guix.
25 ;;; GNU Guix is free software; you can redistribute it and/or modify it
26 ;;; under the terms of the GNU General Public License as published by
27 ;;; the Free Software Foundation; either version 3 of the License, or (at
28 ;;; your option) any later version.
30 ;;; GNU Guix is distributed in the hope that it will be useful, but
31 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
32 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
33 ;;; GNU General Public License for more details.
35 ;;; You should have received a copy of the GNU General Public License
36 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
38 (define-module (gnu packages pdf)
39 #:use-module ((guix licenses) #:prefix license:)
40 #:use-module (guix packages)
41 #:use-module (guix download)
42 #:use-module (guix git-download)
43 #:use-module (guix utils)
44 #:use-module (guix build-system gnu)
45 #:use-module (guix build-system cmake)
46 #:use-module (guix build-system meson)
47 #:use-module (guix build-system python)
48 #:use-module (guix build-system trivial)
49 #:use-module (gnu packages)
50 #:use-module (gnu packages audio)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages backup)
53 #:use-module (gnu packages base)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages check)
56 #:use-module (gnu packages compression)
57 #:use-module (gnu packages curl)
58 #:use-module (gnu packages djvu)
59 #:use-module (gnu packages fontutils)
60 #:use-module (gnu packages game-development)
61 #:use-module (gnu packages gcc)
62 #:use-module (gnu packages gettext)
63 #:use-module (gnu packages ghostscript)
64 #:use-module (gnu packages gl)
65 #:use-module (gnu packages glib)
66 #:use-module (gnu packages gnome)
67 #:use-module (gnu packages gnupg)
68 #:use-module (gnu packages gstreamer)
69 #:use-module (gnu packages gtk)
70 #:use-module (gnu packages image)
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 flyer-composer
98 (name "flyer-composer")
103 (uri (pypi-uri "flyer-composer" version))
105 (base32 "17igqb5dlcgcq4nimjw6cf9qgz6a728zdx1d0rr90r2z0llcchsv"))))
106 (build-system python-build-system)
108 `(#:tests? #f ;; TODO
110 (modify-phases %standard-phases
111 (add-after 'install 'wrap-executable
112 (lambda* (#:key inputs outputs #:allow-other-keys)
113 (let* ((out (assoc-ref outputs "out"))
114 (qtbase (assoc-ref inputs "qtbase"))
115 (qml "/lib/qt5/qml"))
116 (wrap-program (string-append out "/bin/flyer-composer-gui")
117 `("QT_PLUGIN_PATH" ":" =
118 (,(string-append qtbase "/lib/qt5/plugins")))
119 `("QT_QPA_PLATFORM_PLUGIN_PATH" ":" =
120 (,(string-append qtbase "/lib/qt5/plugins/platforms"))))
123 `(("python-pypdf2" ,python-pypdf2)
124 ("python-pyqt" ,python-pyqt)
125 ("python-poppler-qt5" ,python-poppler-qt5)
127 (home-page "http://crazy-compilers.com/flyer-composer")
128 (synopsis "Rearrange PDF pages to print as flyers on one sheet")
129 (description "@command{flyer-composer} can be used to prepare one- or
130 two-sided flyers for printing on one sheet of paper.
132 Imagine you have designed a flyer in A6 format and want to print it using your
133 A4 printer. Of course, you want to print four flyers on each sheet. This is
134 where Flyer Composer steps in, creating a PDF which holds your flyer four
135 times. If you have a second page, Flyer Composer can arrange it the same way
136 - even if the second page is in a separate PDF file.
138 This package contains both the command line tool and the gui too.")
139 (license license:agpl3+)))
141 (define-public flyer-composer-cli
142 (package/inherit flyer-composer
143 (name "flyer-composer-cli")
145 `(#:tests? #f ;; TODO
147 (modify-phases %standard-phases
148 (add-after 'unpack 'remove-gui
150 (delete-file-recursively "flyer_composer/gui")
151 (substitute* "setup.cfg"
152 (("^\\s+flyer-composer-gui\\s*=.*") ""))
155 `(("python-pypdf2" ,python-pypdf2)))
156 (description "@command{flyer-composer} can be used to prepare one- or
157 two-sided flyers for printing on one sheet of paper.
159 Imagine you have designed a flyer in A6 format and want to print it using your
160 A4 printer. Of course, you want to print four flyers on each sheet. This is
161 where Flyer Composer steps in, creating a PDF which holds your flyer four
162 times. If you have a second page, Flyer Composer can arrange it the same way
163 - even if the second page is in a separate PDF file.
165 This package contains only the command line tool. If you like to use the gui,
166 please install the @code{flyer-composer-gui} package.")))
168 (define-public poppler
174 (uri (string-append "https://poppler.freedesktop.org/poppler-"
178 "0v3z4mk1rr8i0c4cfkab7pnxdbil30j4cm4w6cqlq6cfghkhlqxg"))))
179 (build-system cmake-build-system)
182 (inputs `(("fontconfig" ,fontconfig)
183 ("freetype" ,freetype)
184 ("libjpeg" ,libjpeg-turbo)
188 ("openjpeg" ,openjpeg)
191 ;; To build poppler-glib (as needed by Evince), we need Cairo and
192 ;; GLib. But of course, that Cairo must not depend on Poppler.
193 ("cairo" ,cairo-sans-poppler)))
195 ;; As per poppler-cairo and poppler-glib.pc.
196 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
197 ;; different solution to the circular dependency mentioned above.
200 `(("pkg-config" ,pkg-config)
201 ("glib" ,glib "bin") ; glib-mkenums, etc.
202 ("gobject-introspection" ,gobject-introspection)))
204 `(#:tests? #f ; no test data provided with the tarball
206 (let* ((out (assoc-ref %outputs "out"))
207 (lib (string-append out "/lib")))
208 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
210 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
211 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
212 (synopsis "PDF rendering library")
214 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
215 (license license:gpl2+)
216 (home-page "https://poppler.freedesktop.org/")))
218 (define-public poppler-data
220 (name "poppler-data")
224 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
225 "-" version ".tar.gz"))
228 "0c3vjs3p7rjc4yfacnhd865r27czmzwcr4j2z4jldi68dvvcwbvf"))))
229 (build-system gnu-build-system)
231 '(#:tests? #f ; no test suite
232 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
234 (modify-phases %standard-phases
235 ;; The package only provides some data files, so there is nothing to
239 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
240 (description "This package provides optional encoding files for Poppler.
241 When present, Poppler is able to correctly render CJK and Cyrillic text.")
242 (home-page (package-home-page poppler))
243 ;; See COPYING in the source distribution for more information about
245 (license (list license:bsd-3
248 (define-public poppler-qt4
249 (package/inherit poppler
251 (inputs `(("qt-4" ,qt-4)
252 ,@(package-inputs poppler)))
253 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
255 (define-public poppler-qt5
256 (package/inherit poppler
258 (inputs `(("qtbase" ,qtbase)
259 ,@(package-inputs poppler)))
260 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
262 (define-public python-poppler-qt5
264 (name "python-poppler-qt5")
269 (uri (pypi-uri "python-poppler-qt5" version))
272 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
273 (build-system python-build-system)
275 `(;; There are no tests. The check phase just causes a rebuild.
278 (modify-phases %standard-phases
280 (lambda* (#:key inputs #:allow-other-keys)
281 (substitute* "setup.py"
282 ;; This check always fails, so disable it.
283 (("if not check_qtxml\\(\\)")
285 ;; We need to pass an extra flag here. This cannot be in
286 ;; configure-flags because it should not be passed for the
287 ;; installation phase.
288 ((@@ (guix build python-build-system) call-setuppy)
289 "build_ext" (list (string-append "--pyqt-sip-dir="
290 (assoc-ref inputs "python-pyqt")
291 "/share/sip")) #t))))))
293 `(("pkg-config" ,pkg-config)))
295 `(("python-sip" ,python-sip)
296 ("python-pyqt" ,python-pyqt)
297 ("poppler-qt5" ,poppler-qt5)
299 (home-page "https://pypi.org/project/python-poppler-qt5/")
300 (synopsis "Python bindings for Poppler-Qt5")
302 "This package provides Python bindings for the Qt5 interface of the
303 Poppler PDF rendering library.")
304 (license license:lgpl2.1+)))
306 (define-public libharu
313 (url "https://github.com/libharu/libharu")
314 (commit (string-append
316 (string-join (string-split version #\.) "_")))))
317 (file-name (git-file-name name version))
320 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
321 (build-system gnu-build-system)
324 (list (string-append "--with-zlib="
325 (assoc-ref %build-inputs "zlib"))
326 (string-append "--with-png="
327 (assoc-ref %build-inputs "libpng")))))
332 `(("autoconf" ,autoconf)
333 ("automake" ,automake)
334 ("libtool" ,libtool)))
335 (home-page "http://libharu.org/")
336 (synopsis "Library for generating PDF files")
338 "libHaru is a library for generating PDF files. libHaru does not support
339 reading and editing of existing PDF files.")
340 (license license:zlib)))
349 (uri (string-append "https://xpdfreader-dl.s3.amazonaws.com/xpdf-"
350 version "4.02.tar.gz"))
352 (base32 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
353 (build-system gnu-build-system)
354 (inputs `(("freetype" ,freetype)
355 ("gs-fonts" ,gs-fonts)
357 ("libpaper" ,libpaper)
366 `(#:tests? #f ; there is no check target
367 #:parallel-build? #f ; build fails randomly on 8-way machines
369 (list (string-append "--with-freetype2-includes="
370 (assoc-ref %build-inputs "freetype")
371 "/include/freetype2"))
373 (modify-phases %standard-phases
375 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
376 (let* ((install (assoc-ref %standard-phases 'install))
377 (out (assoc-ref outputs "out"))
378 (xpdfrc (string-append out "/etc/xpdfrc"))
379 (gs-fonts (assoc-ref inputs "gs-fonts")))
382 (("/usr/local/share/ghostscript/fonts")
383 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
384 (("#fontFile") "fontFile")))
386 (synopsis "Viewer for PDF files based on the Motif toolkit")
388 "Xpdf is a viewer for Portable Document Format (PDF) files.")
389 (license license:gpl3) ; or gpl2, but not gpl2+
390 (home-page "https://www.xpdfreader.com/")))
392 (define-public zathura-cb
399 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
403 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
404 (native-inputs `(("pkg-config" ,pkg-config)))
405 (inputs `(("libarchive" ,libarchive)
406 ("zathura" ,zathura)))
407 (build-system meson-build-system)
409 `(#:tests? #f ; package does not contain tests
411 (modify-phases %standard-phases
412 (add-after 'unpack 'patch-plugin-directory
413 ;; Something of a regression in 0.1.8: the new Meson build system
414 ;; now hard-codes an incorrect plugin directory. Fix it.
415 (lambda* (#:key outputs #:allow-other-keys)
416 (substitute* "meson.build"
417 (("(install_dir:).*" _ key)
419 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
421 (home-page "https://pwmt.org/projects/zathura-cb/")
422 (synopsis "Comic book support for zathura (libarchive backend)")
423 (description "The zathura-cb plugin adds comic book support to zathura
425 (license license:zlib)))
427 (define-public zathura-ps
434 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
438 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
439 (native-inputs `(("pkg-config" ,pkg-config)))
440 (inputs `(("libspectre" ,libspectre)
441 ("zathura" ,zathura)))
442 (build-system meson-build-system)
444 `(#:tests? #f ; package does not contain tests
446 (modify-phases %standard-phases
447 (add-after 'unpack 'patch-plugin-directory
448 ;; Something of a regression in 0.2.6: the new Meson build system
449 ;; now hard-codes an incorrect plugin directory. Fix it.
450 (lambda* (#:key outputs #:allow-other-keys)
451 (substitute* "meson.build"
452 (("(install_dir:).*" _ key)
454 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
456 (home-page "https://pwmt.org/projects/zathura-ps/")
457 (synopsis "PS support for zathura (libspectre backend)")
458 (description "The zathura-ps plugin adds PS support to zathura
460 (license license:zlib)))
462 (define-public zathura-djvu
464 (name "zathura-djvu")
469 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
473 "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"))))
474 (native-inputs `(("pkg-config" ,pkg-config)))
476 `(("djvulibre" ,djvulibre)
477 ("zathura" ,zathura)))
478 (build-system meson-build-system)
480 `(#:tests? #f ; package does not contain tests
482 (modify-phases %standard-phases
483 (add-after 'unpack 'patch-plugin-directory
484 ;; Something of a regression in 0.2.8: the new Meson build system
485 ;; now hard-codes an incorrect plugin directory. Fix it.
486 (lambda* (#:key outputs #:allow-other-keys)
487 (substitute* "meson.build"
488 (("(install_dir:).*" _ key)
490 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
492 (home-page "https://pwmt.org/projects/zathura-djvu/")
493 (synopsis "DjVu support for zathura (DjVuLibre backend)")
494 (description "The zathura-djvu plugin adds DjVu support to zathura
495 using the DjVuLibre library.")
496 (license license:zlib)))
498 (define-public zathura-pdf-mupdf
500 (name "zathura-pdf-mupdf")
505 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
506 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
509 "1pjwsb7zwclxsvz229fl7y2saf1pv3ifwv3ay8viqxgrp9x3z9hq"))))
510 (native-inputs `(("pkg-config" ,pkg-config)))
512 `(("jbig2dec" ,jbig2dec)
513 ("libjpeg" ,libjpeg-turbo)
516 ("openjpeg" ,openjpeg)
518 ("zathura" ,zathura)))
519 (build-system meson-build-system)
521 `(#:tests? #f ; package does not contain tests
522 #:configure-flags (list (string-append "-Dplugindir="
523 (assoc-ref %outputs "out")
525 "-Dlink-external=true")
527 (modify-phases %standard-phases
528 (add-before 'configure 'add-mujs-to-dependencies
530 ;; Add mujs to the 'build_dependencies'.
531 (substitute* "meson.build"
532 (("^ libopenjp2 = dependency.*" x)
533 (string-append x " mujs = cc.find_library('mujs')\n"))
535 " libopenjp2, mujs")))))))
536 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
537 (synopsis "PDF support for zathura (mupdf backend)")
538 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
539 by using the @code{mupdf} rendering library.")
540 (license license:zlib)))
542 (define-public zathura-pdf-poppler
544 (name "zathura-pdf-poppler")
549 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
553 "1vfl4vkyy3rf39r1sqaa7y8113bgkh2bkfq3nn2inis9mrykmk6m"))))
554 (native-inputs `(("pkg-config" ,pkg-config)))
556 `(("poppler" ,poppler)
557 ("zathura" ,zathura)))
558 (build-system meson-build-system)
560 `(#:tests? #f ; package does not include tests
562 (modify-phases %standard-phases
563 (add-after 'unpack 'patch-plugin-directory
564 ;; Something of a regression in 0.2.9: the new Meson build system
565 ;; now hard-codes an incorrect plugin directory. Fix it.
566 (lambda* (#:key outputs #:allow-other-keys)
567 (substitute* "meson.build"
568 (("(install_dir:).*" _ key)
570 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
572 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
573 (synopsis "PDF support for zathura (poppler backend)")
574 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
575 by using the poppler rendering engine.")
576 (license license:zlib)))
578 (define-public zathura
585 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
589 "1rx1fk9s556fk59lmqgvhwrmv71ashh89bx9adjq46wq5gzdn4p0"))))
590 (native-inputs `(("pkg-config" ,pkg-config)
591 ("gettext" ,gettext-minimal)
592 ("glib:bin" ,glib "bin")
594 ;; For building documentation.
595 ("python-sphinx" ,python-sphinx)
597 ;; For building icons.
602 ("xorg-server" ,xorg-server-for-tests)))
603 (inputs `(("sqlite" ,sqlite)))
604 ;; Listed in 'Requires.private' of 'zathura.pc'.
605 (propagated-inputs `(("cairo" ,cairo)
608 (list (search-path-specification
609 (variable "ZATHURA_PLUGINS_PATH")
610 (files '("lib/zathura")))))
611 (build-system meson-build-system)
613 `(#:phases (modify-phases %standard-phases
614 (add-before 'check 'start-xserver
615 ;; Tests require a running X server.
616 (lambda* (#:key inputs #:allow-other-keys)
617 (let ((xorg-server (assoc-ref inputs "xorg-server"))
619 (setenv "DISPLAY" display)
621 ;; On busy machines, tests may take longer than
622 ;; the default of four seconds.
623 (setenv "CK_DEFAULT_TIMEOUT" "20")
625 ;; Don't fail due to missing '/etc/machine-id'.
626 (setenv "DBUS_FATAL_WARNINGS" "0")
627 (zero? (system (string-append xorg-server "/bin/Xvfb "
628 display " &")))))))))
629 (home-page "https://pwmt.org/projects/zathura/")
630 (synopsis "Lightweight keyboard-driven PDF viewer")
631 (description "Zathura is a customizable document viewer. It provides a
632 minimalistic interface and an interface that mainly focuses on keyboard
634 (license license:zlib)))
636 (define-public podofo
642 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
643 "/podofo-" version ".tar.gz"))
646 "0wj0y4zcmj4q79wrn3vv3xq4bb0vhhxs8yifafwy9f2sjm83c5p9"))
647 (patches (search-patches "podofo-cmake-3.12.patch"))))
648 (build-system cmake-build-system)
650 `(("cppunit" ,cppunit)
651 ("pkg-config" ,pkg-config)))
653 `(("libjpeg" ,libjpeg-turbo)
655 ("fontconfig" ,fontconfig)
656 ("freetype" ,freetype)
662 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
663 "-DPODOFO_BUILD_STATIC=ON")
665 (modify-phases %standard-phases
666 (add-before 'configure 'patch
667 (lambda* (#:key inputs #:allow-other-keys)
668 (let ((freetype (assoc-ref inputs "freetype")))
669 ;; Look for freetype include files in the correct place.
670 (substitute* "cmake/modules/FindFREETYPE.cmake"
671 (("/usr/local") freetype)))
673 (home-page "http://podofo.sourceforge.net")
674 (synopsis "Tools to work with the PDF file format")
676 "PoDoFo is a C++ library and set of command-line tools to work with the
677 PDF file format. It can parse PDF files and load them into memory, and makes
678 it easy to modify them and write the changes to disk. It is primarily useful
679 for applications that wish to do lower level manipulation of PDF, such as
680 extracting content or merging files.")
681 (license license:lgpl2.0+)))
690 (uri (string-append "https://mupdf.com/downloads/archive/"
691 "mupdf-" version "-source.tar.xz"))
693 (base32 "16m5sksil22sshxy70xkslsb2qhvcqb1d95i9savnhds1xn4ybar"))
694 (modules '((guix build utils)))
697 ;; Remove bundled software.
698 (let* ((keep (list "lcms2")) ; different from our lcms2 package
700 (kept (string-append from "~temp")))
702 (for-each (lambda (file) (rename-file (string-append from "/" file)
703 (string-append kept "/" file)))
705 (delete-file-recursively from)
706 (rename-file kept from))
708 (build-system gnu-build-system)
711 ("freeglut" ,freeglut)
712 ("freetype" ,freetype)
713 ("harfbuzz" ,harfbuzz)
714 ("jbig2dec" ,jbig2dec)
715 ("libjpeg" ,libjpeg-turbo)
719 ("openjpeg" ,openjpeg)
723 `(("pkg-config" ,pkg-config)))
725 '(#:tests? #f ; no check target
726 #:make-flags (list "CC=gcc"
728 "USE_SYSTEM_LIBS=yes"
729 "USE_SYSTEM_MUJS=yes"
730 (string-append "prefix=" (assoc-ref %outputs "out")))
731 #:phases (modify-phases %standard-phases
732 (delete 'configure))))
733 (home-page "https://mupdf.com")
734 (synopsis "Lightweight PDF viewer and toolkit")
736 "MuPDF is a C library that implements a PDF and XPS parsing and
737 rendering engine. It is used primarily to render pages into bitmaps,
738 but also provides support for other operations such as searching and
739 listing the table of contents and hyperlinks.
741 The library ships with a rudimentary X11 viewer, and a set of command
742 line tools for batch rendering @command{pdfdraw}, rewriting files
743 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
744 (license (list license:agpl3+
745 license:bsd-3 ; resources/cmaps
746 license:x11 ; thirdparty/lcms2
747 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
748 license:asl2.0)))) ; resources/fonts/droid
756 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
757 "/qpdf-" version ".tar.gz"))
760 "0yw2cpw7ygfd6jlgpwbi8vsnvv9p55zxp9h17x77z2qq733pf8jx"))))
761 (build-system gnu-build-system)
763 `(#:disallowed-references (,perl)
765 (modify-phases %standard-phases
766 (add-before 'configure 'patch-paths
768 (substitute* "make/libtool.mk"
770 (string-append "SHELL=" (which "bash"))))
772 '("qtest/bin/qtest-driver")
773 (find-files "." "\\.test"))
774 (("/usr/bin/env") (which "env")))
777 `(("pkg-config" ,pkg-config)
780 ;; In Requires.private of libqpdf.pc.
781 `(("libjpeg-turbo" ,libjpeg-turbo)
783 (synopsis "Command-line tools and library for transforming PDF files")
785 "QPDF is a command-line program that does structural, content-preserving
786 transformations on PDF files. It could have been called something like
787 pdf-to-pdf. It includes support for merging and splitting PDFs and to
788 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
789 program capable of converting PDF into other formats.")
790 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
791 ;; Users can still choose to use the old license at their option.
792 (license (list license:asl2.0 license:clarified-artistic))
793 (home-page "http://qpdf.sourceforge.net/")))
795 (define-public xournal
798 (version "0.4.8.2016")
802 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
803 "/xournal-" version ".tar.gz"))
806 "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
807 (build-system gnu-build-system)
813 ("libgnomecanvas" ,libgnomecanvas)))
815 `(("pkg-config" ,pkg-config)))
816 (home-page "http://xournal.sourceforge.net/")
817 (synopsis "Notetaking using a stylus")
819 "Xournal is an application for notetaking, sketching, keeping a journal
821 (license license:gpl2+)))
823 (define-public xournalpp
831 (url "https://github.com/xournalpp/xournalpp")
833 (file-name (git-file-name name version))
835 (base32 "05nx4cmrka6hwdn7r91yy4h46qpa9k7iy9dkgaq3hrkh9z3fxlkq"))))
836 (build-system cmake-build-system)
838 `(#:configure-flags (list "-DENABLE_CPPUNIT=ON") ;enable tests
839 #:imported-modules ((guix build glib-or-gtk-build-system)
840 ,@%cmake-build-system-modules)
841 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
842 (guix build cmake-build-system)
845 (modify-phases %standard-phases
846 (add-after 'unpack 'fix-permissions-on-po-files
848 ;; Make sure 'msgmerge' can modify the PO files.
849 (for-each (lambda (po) (chmod po #o666))
850 (find-files "." "\\.po$"))
852 ;; Fix path to addr2line utility, which the crash reporter uses.
853 (add-after 'unpack 'fix-paths
854 (lambda* (#:key inputs #:allow-other-keys)
855 (substitute* "src/util/Stacktrace.cpp"
856 ;; Match only the commandline.
858 (string-append "\"" (which "addr2line") " ")))
860 (add-after 'install 'glib-or-gtk-wrap
861 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
863 `(("cppunit" ,cppunit)
864 ("gettext" ,gettext-minimal)
865 ("pkg-config" ,pkg-config)))
867 `(("alsa-lib" ,alsa-lib)
870 ("libsndfile" ,libsndfile)
873 ("lua" ,lua) ;FIXME: It cannot find the Lua library.
875 ("portaudio" ,portaudio)
876 ("texlive-bin" ,texlive-bin)))
877 (home-page "https://github.com/xournalpp/xournalpp")
878 (synopsis "Handwriting notetaking software with PDF annotation support")
879 (description "Xournal++ is a hand note taking software written in
880 C++ with the target of flexibility, functionality and speed. Stroke
881 recognizer and other parts are based on Xournal code.
886 @item Support for Pen pressure, e.g., Wacom Tablet
887 @item Support for annotating PDFs
888 @item Fill shape functionality
889 @item PDF Export (with and without paper style)
890 @item PNG Export (with and without transparent background)
891 @item Map different tools / colors etc. to stylus buttons /
893 @item Sidebar with Page Previews with advanced page sorting, PDF
894 Bookmarks and Layers (can be individually hidden, editing layer can be
896 @item enhanced support for image insertion
897 @item Eraser with multiple configurations
899 @item bug reporting, autosave, and auto backup tools
900 @item Customizeable toolbar, with multiple configurations, e.g., to
901 optimize toolbar for portrait / landscape
902 @item Page Template definitions
903 @item Shape drawing (line, arrow, circle, rectangle)
904 @item Shape resizing and rotation
905 @item Rotation snapping every 45 degrees
906 @item Rect snapping to grid
907 @item Audio recording and playback alongside with handwritten notes
908 @item Multi Language Support, Like English, German, Italian...
909 @item Plugins using LUA Scripting
911 (license license:gpl2+)))
913 (define-public python-reportlab
915 (name "python-reportlab")
919 (uri (pypi-uri "reportlab" version))
922 "0i17qgm7gzy7pzp240mkpsx9rn8rr67jh5npp5bylv3sd41g48cw"))))
923 (build-system python-build-system)
925 '(;; FIXME: There is one test failure, building the pdf manual from source,
926 ;; but it does not cause the build to fail.
927 #:test-target "tests"
928 #:configure-flags (list "--use-system-libart")
930 (modify-phases %standard-phases
931 (add-after 'unpack 'find-libraries
932 (lambda* (#:key inputs #:allow-other-keys)
933 (let ((libart (assoc-ref inputs "libart-lgpl"))
934 (freetype (assoc-ref inputs "freetype"))
935 (dlt1 (assoc-ref inputs "font-curve-files")))
936 (substitute* "setup.py"
937 (("/usr/include/libart-\\*")
938 (string-append libart "/include/libart-2.0"))
939 (("/usr/include/freetype2")
940 (string-append freetype "/include"))
941 (("http://www.reportlab.com/ftp/pfbfer-20180109.zip")
942 (string-append "file://" dlt1)))
945 `(("freetype" ,freetype)
946 ("libart-lgpl" ,libart-lgpl)
950 (uri "http://www.reportlab.com/ftp/pfbfer-20180109.zip")
953 "1v0gy4mbx02ys96ssx89420y0njknlrxs2bx64bv4rp8a0al66w5"))))))
955 `(("python-pillow" ,python-pillow)))
956 (home-page "https://www.reportlab.com")
957 (synopsis "Python library for generating PDFs and graphics")
958 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
959 of rich PDF documents, and also creation of charts in a variety of bitmap and
961 (license license:bsd-3)))
963 (define-public python2-reportlab
964 (package-with-python2 python-reportlab))
966 (define-public impressive
973 "mirror://sourceforge/impressive/Impressive/"
974 version "/Impressive-" version ".tar.gz"))
977 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
978 (build-system python-build-system)
980 ;; TODO: Add dependency on pdftk.
981 (inputs `(("python2-pygame" ,python2-pygame)
982 ("python2-pillow" ,python2-pillow)
988 #:phases (modify-phases %standard-phases
993 (lambda* (#:key inputs outputs #:allow-other-keys)
994 ;; There's no 'setup.py' so install things manually.
995 (let* ((out (assoc-ref outputs "out"))
996 (bin (string-append out "/bin"))
997 (man1 (string-append out "/share/man/man1"))
998 (sdl (assoc-ref inputs "sdl"))
999 (xpdf (assoc-ref inputs "xpdf")))
1001 (copy-file "impressive.py"
1002 (string-append bin "/impressive"))
1003 (wrap-program (string-append bin "/impressive")
1004 `("LIBRARY_PATH" ":" prefix ;for ctypes
1005 (,(string-append sdl "/lib")))
1006 `("PATH" ":" prefix ;for pdftoppm
1007 (,(string-append xpdf "/bin"))))
1008 (install-file "impressive.1" man1)
1010 (home-page "http://impressive.sourceforge.net")
1011 (synopsis "PDF presentation tool with visual effects")
1013 "Impressive is a tool to display PDF files that provides visual effects
1014 such as smooth alpha-blended slide transitions. It provides additional tools
1015 such as zooming, highlighting an area of the screen, and a tool to navigate
1017 (license license:gpl2)))
1019 (define-public fbida
1023 (home-page "https://www.kraxel.org/blog/linux/fbida/")
1026 (uri (string-append "https://www.kraxel.org/releases/fbida/"
1027 "fbida-" version ".tar.gz"))
1030 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
1031 (build-system gnu-build-system)
1034 (modify-phases %standard-phases
1035 (add-after 'unpack 'patch-FHS-file-names
1037 (substitute* "mk/Autoconf.mk"
1038 (("/bin/echo") "echo")
1039 (("/sbin/ldconfig -p") "echo lib")) #t))
1040 (delete 'configure))
1042 #:make-flags (list "CC=gcc"
1043 (string-append "prefix=" (assoc-ref %outputs "out")))))
1044 (inputs `(("libjpeg" ,libjpeg-turbo)
1046 ("libtiff" ,libtiff)
1048 ("libwebp" ,libwebp)
1052 ("cairo-xcb" ,cairo-xcb)
1053 ("freetype" ,freetype)
1054 ("fontconfig" ,fontconfig)
1055 ("libexif" ,libexif)
1057 ("libepoxy" ,libepoxy)
1059 ("poppler" ,poppler)))
1060 (native-inputs `(("pkg-config" ,pkg-config)))
1061 (synopsis "Framebuffer and drm-based image viewer")
1063 "fbida contains a few applications for viewing and editing images on
1066 (license license:gpl2+)))
1068 (define-public pdf2svg
1075 (url "https://github.com/dawbarton/pdf2svg")
1076 (commit (string-append "v" version))))
1077 (file-name (git-file-name name version))
1080 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
1081 (build-system gnu-build-system)
1084 ("poppler" ,poppler)))
1086 `(("pkg-config" ,pkg-config)))
1087 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
1088 (synopsis "PDF to SVG converter")
1089 (description "@command{pdf2svg} is a simple command-line PDF to SVG
1090 converter using the Poppler and Cairo libraries.")
1091 (license license:gpl2+)))
1093 (define-public python-pypdf2
1095 (name "python-pypdf2")
1099 (uri (pypi-uri "PyPDF2" version))
1102 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
1103 (build-system python-build-system)
1106 (modify-phases %standard-phases
1108 'unpack 'patch-test-suite
1110 ;; The text-file needs to be opened in binary mode for Python 3,
1111 ;; so patch in the "b"
1112 (substitute* "Tests/tests.py"
1113 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
1114 (string-append line "b")))
1118 (invoke "python" "-m" "unittest" "Tests.tests"))))))
1119 (home-page "http://mstamy2.github.com/PyPDF2")
1120 (synopsis "Pure Python PDF toolkit")
1121 (description "PyPDF2 is a pure Python PDF library capable of:
1124 @item extracting document information (title, author, …)
1125 @item splitting documents page by page
1126 @item merging documents page by page
1127 @item cropping pages
1128 @item merging multiple pages into a single page
1129 @item encrypting and decrypting PDF files
1132 By being pure Python, it should run on any Python platform without any
1133 dependencies on external libraries. It can also work entirely on
1134 @code{StringIO} objects rather than file streams, allowing for PDF
1135 manipulation in memory. It is therefore a useful tool for websites that
1136 manage or manipulate PDFs.")
1137 (license license:bsd-3)))
1139 (define-public python2-pypdf2
1140 (package-with-python2 python-pypdf2))
1142 (define-public python2-pypdf
1144 (name "python2-pypdf")
1148 (uri (pypi-uri "pyPdf" version))
1151 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
1152 (build-system python-build-system)
1154 `(#:tests? #f ; no tests
1155 #:python ,python-2))
1156 (home-page "http://pybrary.net/pyPdf/")
1157 (synopsis "Pure Python PDF toolkit")
1158 (description "PyPDF2 is a pure Python PDF toolkit.
1160 Note: This module isn't maintained anymore. For new projects please use
1161 python-pypdf2 instead.")
1162 (license license:bsd-3)))
1164 (define-public pdfarranger
1166 (name "pdfarranger")
1172 (url "https://github.com/jeromerobert/pdfarranger")
1174 (file-name (git-file-name name version))
1176 (base32 "1f8m8r81322i97wkqpmf7a4kiwnq244n6cnbldh03jc49vwq2kxx"))))
1177 (build-system python-build-system)
1179 '(#:tests? #f ;no tests
1180 #:phases (modify-phases %standard-phases
1181 (add-after 'install 'wrap-for-typelib
1182 (lambda* (#:key inputs outputs #:allow-other-keys)
1183 (let* ((out (assoc-ref outputs "out"))
1184 (program (string-append out "/bin/pdfarranger")))
1185 (wrap-program program
1186 `("GI_TYPELIB_PATH" ":" prefix
1187 (,(getenv "GI_TYPELIB_PATH"))))
1190 `(("intltool" ,intltool)
1191 ("python-distutils-extra" ,python-distutils-extra)))
1194 ("poppler" ,poppler)
1195 ("python-pycairo" ,python-pycairo)
1196 ("python-pygobject" ,python-pygobject)
1197 ("python-pypdf2" ,python-pypdf2)))
1198 (home-page "https://github.com/jeromerobert/pdfarranger")
1199 (synopsis "Merge, split and re-arrange pages from PDF documents")
1201 "PDF Arranger is a small application which allows one to merge or split
1202 PDF documents and rotate, crop and rearrange their pages using an interactive
1203 and intuitive graphical interface.
1205 PDF Arranger was formerly known as PDF-Shuffler.")
1206 (license license:gpl3+)))
1208 (define-public pdfposter
1211 (version "0.7.post1")
1214 (uri (pypi-uri "pdftools.pdfposter" version))
1217 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
1218 (build-system python-build-system)
1220 `(#:tests? #f)) ; test-suite not included in source archive
1222 `(("python-pypdf2" ,python-pypdf2)))
1223 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1224 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1225 (description "@command{pdfposter} can be used to create a large poster by
1226 building it from multiple pages and/or printing it on large media. It expects
1227 as input a PDF file, normally printing on a single page. The output is again
1228 a PDF file, maybe containing multiple pages together building the poster. The
1229 input page will be scaled to obtain the desired size.
1231 This is much like @command{poster} does for Postscript files, but working with
1232 PDF. Since sometimes @command{poster} does not like your files converted from
1233 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1234 (license license:gpl3+)))
1236 (define-public pdfgrep
1243 (uri (string-append "https://pdfgrep.org/download/"
1244 name "-" version ".tar.gz"))
1247 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
1248 (build-system gnu-build-system)
1250 `(("pkg-config" ,pkg-config)))
1252 `(("libgcrypt" ,libgcrypt)
1254 ("poppler" ,poppler)))
1255 (home-page "https://pdfgrep.org")
1256 (synopsis "Command-line utility to search text in PDF files")
1258 "Pdfgrep searches in pdf files for strings matching a regular expression.
1259 Support some GNU grep options as file name output, page number output,
1260 optional case insensitivity, count occurrences, color highlights and search in
1262 (license license:gpl2+)))
1264 (define-public pdfpc
1272 (url "https://github.com/pdfpc/pdfpc")
1273 (commit (string-append "v" version))))
1274 (file-name (git-file-name name version))
1276 (base32 "11n925c5jj3yfwnqkgxzqrmsrpqh8ls1g4idmqqzpsanpam1xvna"))))
1277 (build-system cmake-build-system)
1278 (arguments '(#:tests? #f)) ; no test target
1282 ("gstreamer" ,gstreamer)
1283 ("gst-plugins-base" ,gst-plugins-base)
1285 ("poppler" ,poppler)
1289 `(("pkg-config" ,pkg-config)))
1290 (home-page "https://pdfpc.github.io/")
1291 (synopsis "Presenter console with multi-monitor support for PDF files")
1293 "pdfpc is a presentation viewer application which uses multi-monitor
1294 output to provide meta information to the speaker during the presentation. It
1295 is able to show a normal presentation window on one screen, while showing a
1296 more sophisticated overview on the other one providing information like a
1297 picture of the next slide, as well as the left over time till the end of the
1298 presentation. The input files processed by pdfpc are PDF documents.")
1299 (license license:gpl2+)))
1308 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1309 version "/paps-" version ".tar.gz"))
1311 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1312 (build-system gnu-build-system)
1314 `(("pango" ,pango)))
1316 `(("intltool" ,intltool)
1317 ("pkg-config" ,pkg-config)))
1318 (home-page "https://github.com/dov/paps")
1319 (synopsis "Pango to PostScript converter")
1321 "Paps reads a UTF-8 encoded file and generates a PostScript language
1322 rendering of the file through the Pango Cairo back end.")
1323 (license license:lgpl2.0+)))
1325 (define-public stapler
1332 (uri (pypi-uri "stapler" version))
1335 "0b2lbm3f79cdxcsagwhzihbzwahjabxqmbws0c8ki25gpdnygdd7"))))
1336 (build-system python-build-system)
1339 (modify-phases %standard-phases
1340 (add-after 'unpack 'fix-more-itertools-version-requirement
1342 ;; Tests require an version of the more-itertools module older
1343 ;; than the one we have packaged.
1344 (substitute* "setup.py"
1345 (("more-itertools>=2\\.2,<6\\.0\\.0") "more-itertools>=2.2"))
1348 `(("python-more-itertools" ,python-more-itertools)
1349 ("python-pypdf2" ,python-pypdf2)))
1350 (home-page "https://github.com/hellerbarde/stapler")
1351 (synopsis "PDF manipulation tool")
1352 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1353 manipulating PDF documents from the command line. It supports
1356 @item cherry-picking pages and concatenating them into a new file
1357 @item splitting a PDF document into single pages each in its own file
1358 @item merging PDF documents with their pages interleaved
1359 @item displaying metadata in a PDF document
1360 @item displaying the mapping between logical and physical page numbers
1362 (license license:bsd-3)))
1364 (define-public weasyprint
1371 (uri (pypi-uri "WeasyPrint" version))
1373 (base32 "0skdzwq7cd715dnnds6abx0k0xmmnmsqp0vb1r1w20sg7abp3sdk"))
1374 (patches (search-patches "weasyprint-library-paths.patch"))))
1375 (build-system python-build-system)
1378 (modify-phases %standard-phases
1379 (add-after 'unpack 'patch-library-paths
1380 (lambda* (#:key inputs #:allow-other-keys)
1381 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1382 (glib (assoc-ref inputs "glib"))
1383 (pango (assoc-ref inputs "pango"))
1384 (pangoft2 (assoc-ref inputs "pangoft2")))
1385 (substitute* "weasyprint/fonts.py"
1387 (string-append fontconfig "/lib/libfontconfig.so"))
1389 (string-append pango "/lib/libpangoft2-1.0.so")))
1390 (substitute* "weasyprint/text.py"
1392 (string-append glib "/lib/libgobject-2.0.so"))
1394 (string-append pango "/lib/libpango-1.0.so"))
1396 (string-append pango "/lib/libpangocairo-1.0.so"))))))
1397 (add-after 'unpack 'remove-pytest-options
1399 (substitute* "setup.cfg"
1400 ;; flake8 and isort syntax checks fail, which is not our
1402 (("addopts = --flake8 --isort") ""))))
1405 ;; Run pytest, excluding one failing test.
1406 (invoke "pytest" "-k" "not test_flex_column_wrap_reverse"))))))
1408 `(("fontconfig" ,fontconfig)
1412 `(("gdk-pixbuf" ,gdk-pixbuf)
1413 ("python-cairocffi" ,python-cairocffi)
1414 ("python-cairosvg" ,python-cairosvg)
1415 ("python-cffi" ,python-cffi)
1416 ("python-cssselect2" ,python-cssselect2)
1417 ("python-html5lib" ,python-html5lib)
1418 ("python-pyphen" ,python-pyphen)
1419 ("python-tinycss2" ,python-tinycss2)))
1421 `(("python-pytest-cov" ,python-pytest-cov)
1422 ("python-pytest-runner" ,python-pytest-runner)))
1423 (home-page "https://weasyprint.org/")
1424 (synopsis "Document factory for creating PDF files from HTML")
1425 (description "WeasyPrint helps web developers to create PDF documents. It
1426 turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1429 From a technical point of view, WeasyPrint is a visual rendering engine for
1430 HTML and CSS that can export to PDF and PNG. It aims to support web standards
1433 It is based on various libraries but not on a full rendering engine like
1434 WebKit or Gecko. The CSS layout engine is written in Python, designed for
1435 pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1438 Keywords: html2pdf, htmltopdf")
1439 (license license:bsd-3)))