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, 2021 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–2021 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, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
21 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
22 ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si>
23 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
24 ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
26 ;;; This file is part of GNU Guix.
28 ;;; GNU Guix is free software; you can redistribute it and/or modify it
29 ;;; under the terms of the GNU General Public License as published by
30 ;;; the Free Software Foundation; either version 3 of the License, or (at
31 ;;; your option) any later version.
33 ;;; GNU Guix is distributed in the hope that it will be useful, but
34 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
35 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 ;;; GNU General Public License for more details.
38 ;;; You should have received a copy of the GNU General Public License
39 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
41 (define-module (gnu packages pdf)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix packages)
44 #:use-module (guix download)
45 #:use-module (guix git-download)
46 #:use-module (guix utils)
47 #:use-module (guix build-system gnu)
48 #:use-module (guix build-system cmake)
49 #:use-module (guix build-system meson)
50 #:use-module (guix build-system python)
51 #:use-module (guix build-system qt)
52 #:use-module (guix build-system trivial)
53 #:use-module (gnu packages)
54 #:use-module (gnu packages audio)
55 #:use-module (gnu packages autotools)
56 #:use-module (gnu packages backup)
57 #:use-module (gnu packages base)
58 #:use-module (gnu packages bash)
59 #:use-module (gnu packages build-tools)
60 #:use-module (gnu packages check)
61 #:use-module (gnu packages compression)
62 #:use-module (gnu packages cups)
63 #:use-module (gnu packages curl)
64 #:use-module (gnu packages djvu)
65 #:use-module (gnu packages fonts)
66 #:use-module (gnu packages fontutils)
67 #:use-module (gnu packages game-development)
68 #:use-module (gnu packages gettext)
69 #:use-module (gnu packages ghostscript)
70 #:use-module (gnu packages gl)
71 #:use-module (gnu packages glib)
72 #:use-module (gnu packages gnome)
73 #:use-module (gnu packages gnupg)
74 #:use-module (gnu packages gstreamer)
75 #:use-module (gnu packages gtk)
76 #:use-module (gnu packages image)
77 #:use-module (gnu packages javascript)
78 #:use-module (gnu packages lesstif)
79 #:use-module (gnu packages libffi)
80 #:use-module (gnu packages linux)
81 #:use-module (gnu packages lua)
82 #:use-module (gnu packages man)
83 #:use-module (gnu packages markup)
84 #:use-module (gnu packages pcre)
85 #:use-module (gnu packages perl)
86 #:use-module (gnu packages photo)
87 #:use-module (gnu packages pkg-config)
88 #:use-module (gnu packages pulseaudio)
89 #:use-module (gnu packages python)
90 #:use-module (gnu packages python-check)
91 #:use-module (gnu packages python-web)
92 #:use-module (gnu packages python-xyz)
93 #:use-module (gnu packages qt)
94 #:use-module (gnu packages sdl)
95 #:use-module (gnu packages sphinx)
96 #:use-module (gnu packages sqlite)
97 #:use-module (gnu packages tex)
98 #:use-module (gnu packages time)
99 #:use-module (gnu packages tcl)
100 #:use-module (gnu packages tls)
101 #:use-module (gnu packages web)
102 #:use-module (gnu packages webkit)
103 #:use-module (gnu packages xdisorg)
104 #:use-module (gnu packages xml)
105 #:use-module (gnu packages xorg)
106 #:use-module (srfi srfi-1))
108 (define-public extractpdfmark
110 (name "extractpdfmark")
116 (url "https://github.com/trueroad/extractpdfmark")
117 (commit (string-append "v" version))))
118 (file-name (git-file-name name version))
120 (base32 "14aa6zly53j8gx5d32caiabk2j4b102xha0v9149yahz6kbn5b80"))))
121 (build-system gnu-build-system)
124 (modify-phases %standard-phases
125 (add-before 'check 'start-xorg-server
126 ;; The test suite wants to write to /homeless-shelter
127 (lambda _ (setenv "HOME" (getcwd)))))))
129 `(("autoconf" ,autoconf)
130 ("automake" ,automake)
131 ("gettext" ,gettext-minimal)
132 ("ghostscript" ,ghostscript)
133 ("pkg-config" ,pkg-config)
134 ("texlive" ,texlive-tiny)))
137 (home-page "https://github.com/trueroad/extractpdfmark")
138 (synopsis "Extract page mode and named destinations as PDFmark from PDF")
140 "PDFmarks is a technique that accompanies PDF, and that is used to store
141 metadata such as author or title, but also structural information such as
142 bookmarks or hyperlinks.
144 When Ghostscript reads the main PDF generated by the TeX system with embedded
145 PDF files and outputs the final PDF, the PDF page mode and name targets
146 etc. are not preserved. Therefore, when you open the final PDF, it is not
147 displayed correctly. Also, remote PDF links do not work correctly.
149 This program is able to extract the page mode and named targets as PDFmark
150 from PDF. In this way, you can obtain embedded PDF files that have kept this
152 (license license:gpl3)))
154 (define-public flyer-composer
156 (name "flyer-composer")
161 (uri (pypi-uri "flyer-composer" version))
163 (base32 "17igqb5dlcgcq4nimjw6cf9qgz6a728zdx1d0rr90r2z0llcchsv"))))
164 (build-system python-build-system)
166 `(#:tests? #f ;; TODO
168 (modify-phases %standard-phases
169 (add-after 'install 'wrap-executable
170 (lambda* (#:key inputs outputs #:allow-other-keys)
171 (let* ((out (assoc-ref outputs "out"))
172 (qtbase (assoc-ref inputs "qtbase"))
173 (qml "/lib/qt5/qml"))
174 (wrap-program (string-append out "/bin/flyer-composer-gui")
175 `("QT_PLUGIN_PATH" ":" =
176 (,(string-append qtbase "/lib/qt5/plugins")))
177 `("QT_QPA_PLATFORM_PLUGIN_PATH" ":" =
178 (,(string-append qtbase "/lib/qt5/plugins/platforms"))))
181 (list python-pypdf2 python-pyqt python-poppler-qt5 qtbase-5))
182 (home-page "http://crazy-compilers.com/flyer-composer")
183 (synopsis "Rearrange PDF pages to print as flyers on one sheet")
184 (description "@command{flyer-composer} can be used to prepare one- or
185 two-sided flyers for printing on one sheet of paper.
187 Imagine you have designed a flyer in A6 format and want to print it using your
188 A4 printer. Of course, you want to print four flyers on each sheet. This is
189 where Flyer Composer steps in, creating a PDF which holds your flyer four
190 times. If you have a second page, Flyer Composer can arrange it the same way
191 - even if the second page is in a separate PDF file.
193 This package contains both the command line tool and the gui too.")
194 (license license:agpl3+)))
196 (define-public flyer-composer-cli
197 (package/inherit flyer-composer
198 (name "flyer-composer-cli")
200 `(#:tests? #f ;; TODO
202 (modify-phases %standard-phases
203 (add-after 'unpack 'remove-gui
205 (delete-file-recursively "flyer_composer/gui")
206 (substitute* "setup.cfg"
207 (("^\\s+flyer-composer-gui\\s*=.*") ""))
210 `(("python-pypdf2" ,python-pypdf2)))
211 (description "@command{flyer-composer} can be used to prepare one- or
212 two-sided flyers for printing on one sheet of paper.
214 Imagine you have designed a flyer in A6 format and want to print it using your
215 A4 printer. Of course, you want to print four flyers on each sheet. This is
216 where Flyer Composer steps in, creating a PDF which holds your flyer four
217 times. If you have a second page, Flyer Composer can arrange it the same way
218 - even if the second page is in a separate PDF file.
220 This package contains only the command line tool. If you like to use the gui,
221 please install the @code{flyer-composer-gui} package.")))
223 (define-public poppler
229 (uri (string-append "https://poppler.freedesktop.org/poppler-"
233 "1m54hsi8z6c13jdbjwz55flkra1mahmkw2igavbf8p86d2gv4sp2"))))
234 (build-system cmake-build-system)
237 (inputs `(("fontconfig" ,fontconfig)
238 ("freetype" ,freetype)
239 ("libjpeg" ,libjpeg-turbo)
243 ("openjpeg" ,openjpeg)
246 ;; To build poppler-glib (as needed by Evince), we need Cairo and
247 ;; GLib. But of course, that Cairo must not depend on Poppler.
248 ("cairo" ,cairo-sans-poppler)))
250 ;; As per poppler-cairo and poppler-glib.pc.
251 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
252 ;; different solution to the circular dependency mentioned above.
256 `(,glib "bin") ; glib-mkenums, etc.
257 gobject-introspection))
259 `(#:tests? #f ;no test data provided with the tarball
261 (let* ((out (assoc-ref %outputs "out"))
262 (lib (string-append out "/lib")))
263 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
265 "-DENABLE_BOOST=OFF" ;disable Boost to save size
266 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
267 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))
268 ,@(if (%current-target-system)
270 (modify-phases %standard-phases
271 (add-after 'unpack 'set-PKG_CONFIG
273 (setenv "PKG_CONFIG" ,(pkg-config-for-target))))))
275 (synopsis "PDF rendering library")
277 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
278 (license license:gpl2+)
279 (home-page "https://poppler.freedesktop.org/")))
281 (define-public poppler-data
283 (name "poppler-data")
287 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
288 "-" version ".tar.gz"))
291 "137h4m48gc4v0srnr0gkwaqna6kfdqpy5886if5gjfmh3g6hbv1c"))))
292 (build-system gnu-build-system)
294 '(#:tests? #f ; no test suite
295 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
297 (modify-phases %standard-phases
298 ;; The package only provides some data files, so there is nothing to
302 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
303 (description "This package provides optional encoding files for Poppler.
304 When present, Poppler is able to correctly render CJK and Cyrillic text.")
305 (home-page (package-home-page poppler))
306 ;; See COPYING in the source distribution for more information about
308 (license (list license:bsd-3
311 (define-public poppler-qt5
312 (package/inherit poppler
314 (inputs `(("qtbase" ,qtbase-5)
315 ,@(package-inputs poppler)))
316 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
318 (define-public python-poppler-qt5
320 (name "python-poppler-qt5")
325 (uri (pypi-uri "python-poppler-qt5" version))
328 "0b82gm4i75q5v19kfbq0h4y0b2vcwr2213zkhxh6l0h45kdndmxd"))
329 (patches (search-patches "python-poppler-qt5-fix-build.patch"))))
330 (build-system python-build-system)
332 `(;; There are no tests. The check phase just causes a rebuild.
335 (modify-phases %standard-phases
337 (lambda* (#:key inputs #:allow-other-keys)
338 (substitute* "setup.py"
339 ;; This check always fails, so disable it.
340 (("if not check_qtxml\\(\\)")
342 ;; We need to pass an extra flag here. This cannot be in
343 ;; configure-flags because it should not be passed for the
344 ;; installation phase.
345 ((@@ (guix build python-build-system) call-setuppy)
346 "build_ext" (list (string-append "--pyqt-sip-dir="
347 (assoc-ref inputs "python-pyqt")
348 "/share/sip")) #t))))))
352 (list python-sip-4 python-pyqt poppler-qt5 qtbase-5))
353 (home-page "https://pypi.org/project/python-poppler-qt5/")
354 (synopsis "Python bindings for Poppler-Qt5")
356 "This package provides Python bindings for the Qt5 interface of the
357 Poppler PDF rendering library.")
358 (license license:lgpl2.1+)))
360 (define-public libharu
367 (url "https://github.com/libharu/libharu")
368 (commit (string-append
370 (string-join (string-split version #\.) "_")))))
371 (file-name (git-file-name name version))
374 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
375 (build-system gnu-build-system)
378 (list (string-append "--with-zlib="
379 (assoc-ref %build-inputs "zlib"))
380 (string-append "--with-png="
381 (assoc-ref %build-inputs "libpng")))))
385 (list autoconf automake libtool))
386 (home-page "http://libharu.org/")
387 (synopsis "Library for generating PDF files")
389 "libHaru is a library for generating PDF files. libHaru does not support
390 reading and editing of existing PDF files.")
391 (license license:zlib)))
400 (uri (string-append "https://dl.xpdfreader.com/xpdf-" version ".tar.gz"))
402 (base32 "0ip81c9vy0igjnasl9iv2lz214fb01vvvdzbvjmgwc63fi1jgr0g"))))
403 (build-system cmake-build-system)
404 (inputs (list cups freetype libpng qtbase-5 zlib))
406 `(#:tests? #f)) ; there is no check target
407 (synopsis "Viewer for PDF files based on the Motif toolkit")
409 "Xpdf is a viewer for Portable Document Format (PDF) files.")
410 (license license:gpl3) ; or gpl2, but not gpl2+
411 (home-page "https://www.xpdfreader.com/")))
413 (define-public zathura-cb
420 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
424 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
425 (native-inputs (list pkg-config))
426 (inputs (list libarchive zathura))
427 (build-system meson-build-system)
429 `(#:tests? #f ; package does not contain tests
431 (modify-phases %standard-phases
432 (add-after 'unpack 'patch-plugin-directory
433 ;; Something of a regression in 0.1.8: the new Meson build system
434 ;; now hard-codes an incorrect plugin directory. Fix it.
435 (lambda* (#:key outputs #:allow-other-keys)
436 (substitute* "meson.build"
437 (("(install_dir:).*" _ key)
439 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
441 (home-page "https://pwmt.org/projects/zathura-cb/")
442 (synopsis "Comic book support for zathura (libarchive backend)")
443 (description "The zathura-cb plugin adds comic book support to zathura
445 (license license:zlib)))
447 (define-public zathura-ps
454 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
458 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
459 (native-inputs (list pkg-config))
460 (inputs (list libspectre zathura))
461 (build-system meson-build-system)
463 `(#:tests? #f ; package does not contain tests
465 (modify-phases %standard-phases
466 (add-after 'unpack 'patch-plugin-directory
467 ;; Something of a regression in 0.2.6: the new Meson build system
468 ;; now hard-codes an incorrect plugin directory. Fix it.
469 (lambda* (#:key outputs #:allow-other-keys)
470 (substitute* "meson.build"
471 (("(install_dir:).*" _ key)
473 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
475 (home-page "https://pwmt.org/projects/zathura-ps/")
476 (synopsis "PS support for zathura (libspectre backend)")
477 (description "The zathura-ps plugin adds PS support to zathura
479 (license license:zlib)))
481 (define-public zathura-djvu
483 (name "zathura-djvu")
488 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
492 "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"))))
493 (native-inputs (list pkg-config))
495 (list djvulibre zathura))
496 (build-system meson-build-system)
498 `(#:tests? #f ; package does not contain tests
500 (modify-phases %standard-phases
501 (add-after 'unpack 'patch-plugin-directory
502 ;; Something of a regression in 0.2.8: the new Meson build system
503 ;; now hard-codes an incorrect plugin directory. Fix it.
504 (lambda* (#:key outputs #:allow-other-keys)
505 (substitute* "meson.build"
506 (("(install_dir:).*" _ key)
508 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
510 (home-page "https://pwmt.org/projects/zathura-djvu/")
511 (synopsis "DjVu support for zathura (DjVuLibre backend)")
512 (description "The zathura-djvu plugin adds DjVu support to zathura
513 using the DjVuLibre library.")
514 (license license:zlib)))
516 (define-public zathura-pdf-mupdf
518 (name "zathura-pdf-mupdf")
523 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
524 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
527 "1r3v37k9fl2rxipvacgxr36llywvy7n20a25h3ajlyk70697sa66"))))
528 (native-inputs (list pkg-config))
530 `(("jbig2dec" ,jbig2dec)
531 ("libjpeg" ,libjpeg-turbo)
534 ("openjpeg" ,openjpeg)
536 ("zathura" ,zathura)))
537 (build-system meson-build-system)
539 `(#:tests? #f ; package does not contain tests
540 #:configure-flags (list (string-append "-Dplugindir="
541 (assoc-ref %outputs "out")
543 "-Dlink-external=true")
545 (modify-phases %standard-phases
546 (add-after 'unpack 'remove-libmupdfthird.a-requirement
548 ;; Ignore a missing (apparently superfluous) static library.
549 (substitute* "meson.build"
550 ((".*mupdfthird.*") ""))
552 (add-before 'configure 'add-mujs-to-dependencies
554 ;; Add mujs to the 'build_dependencies'.
555 (substitute* "meson.build"
556 (("^ libopenjp2 = dependency.*" x)
557 (string-append x " mujs = cc.find_library('mujs')\n"))
559 " libopenjp2, mujs")))))))
560 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
561 (synopsis "PDF support for zathura (mupdf backend)")
562 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
563 by using the @code{mupdf} rendering library.")
564 (license license:zlib)))
566 (define-public zathura-pdf-poppler
568 (name "zathura-pdf-poppler")
573 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
577 "1vfl4vkyy3rf39r1sqaa7y8113bgkh2bkfq3nn2inis9mrykmk6m"))))
578 (native-inputs (list pkg-config))
580 (list poppler zathura))
581 (build-system meson-build-system)
583 `(#:tests? #f ; package does not include tests
585 (modify-phases %standard-phases
586 (add-after 'unpack 'patch-plugin-directory
587 ;; Something of a regression in 0.2.9: the new Meson build system
588 ;; now hard-codes an incorrect plugin directory. Fix it.
589 (lambda* (#:key outputs #:allow-other-keys)
590 (substitute* "meson.build"
591 (("(install_dir:).*" _ key)
593 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
595 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
596 (synopsis "PDF support for zathura (poppler backend)")
597 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
598 by using the poppler rendering engine.")
599 (license license:zlib)))
601 (define-public zathura
608 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
612 "1nr0ym1mi2afk4ycdf1ppmkcv7i7hyzwn4p3r4m0j2qm3nvaiami"))))
613 (native-inputs `(("pkg-config" ,pkg-config)
614 ("gettext" ,gettext-minimal)
615 ("glib:bin" ,glib "bin")
617 ;; For building documentation.
618 ("python-sphinx" ,python-sphinx)
620 ;; For building icons.
625 ("xorg-server" ,xorg-server-for-tests)))
626 (inputs (list sqlite))
627 ;; Listed in 'Requires.private' of 'zathura.pc'.
628 (propagated-inputs (list cairo girara))
630 (list (search-path-specification
631 (variable "ZATHURA_PLUGINS_PATH")
632 (files '("lib/zathura")))))
633 (build-system meson-build-system)
635 `(#:meson ,meson-0.59
636 #:phases (modify-phases %standard-phases
637 (add-before 'check 'start-xserver
638 ;; Tests require a running X server.
639 (lambda* (#:key inputs #:allow-other-keys)
640 (let ((xorg-server (assoc-ref inputs "xorg-server"))
642 (setenv "DISPLAY" display)
644 ;; On busy machines, tests may take longer than
645 ;; the default of four seconds.
646 (setenv "CK_DEFAULT_TIMEOUT" "20")
648 ;; Don't fail due to missing '/etc/machine-id'.
649 (setenv "DBUS_FATAL_WARNINGS" "0")
650 (zero? (system (string-append xorg-server "/bin/Xvfb "
651 display " &")))))))))
652 (home-page "https://pwmt.org/projects/zathura/")
653 (synopsis "Lightweight keyboard-driven PDF viewer")
654 (description "Zathura is a customizable document viewer. It provides a
655 minimalistic interface and an interface that mainly focuses on keyboard
657 (license license:zlib)))
659 (define-public podofo
665 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
666 "/podofo-" version ".tar.gz"))
669 "1f0yvkx6nf99fp741w2y706d8bs9824x1z2gqm3rdy5fv8bfgwkw"))))
670 (build-system cmake-build-system)
672 (list cppunit pkg-config))
674 `(("libjpeg" ,libjpeg-turbo)
676 ("fontconfig" ,fontconfig)
677 ("freetype" ,freetype)
684 (list "-DPODOFO_BUILD_SHARED=ON")
686 (modify-phases %standard-phases
687 (add-before 'configure 'patch
688 (lambda* (#:key inputs #:allow-other-keys)
689 (let ((freetype (assoc-ref inputs "freetype")))
690 ;; Look for freetype include files in the correct place.
691 (substitute* "cmake/modules/FindFREETYPE.cmake"
692 (("/usr/local") freetype)))
694 (home-page "http://podofo.sourceforge.net")
695 (synopsis "Tools to work with the PDF file format")
697 "PoDoFo is a C++ library and set of command-line tools to work with the
698 PDF file format. It can parse PDF files and load them into memory, and makes
699 it easy to modify them and write the changes to disk. It is primarily useful
700 for applications that wish to do lower level manipulation of PDF, such as
701 extracting content or merging files.")
702 (license license:lgpl2.0+)))
711 (uri (string-append "https://mupdf.com/downloads/archive/"
712 "mupdf-" version "-source.tar.xz"))
714 (base32 "1i98xqgnzp168hnnhradl8658qsif06wlbvcglz0mmh8wi1rkwrq"))
715 (modules '((guix build utils)))
718 ;; Remove bundled software.
719 (let* ((keep (list "extract"
720 "lcms2")) ; different from our lcms2 package
722 (kept (string-append from "~temp")))
724 (for-each (lambda (file) (rename-file (string-append from "/" file)
725 (string-append kept "/" file)))
727 (delete-file-recursively from)
728 (rename-file kept from))
730 (build-system gnu-build-system)
733 ("freeglut" ,freeglut)
734 ("freetype" ,freetype)
735 ("gumbo-parser" ,gumbo-parser)
736 ("harfbuzz" ,harfbuzz)
737 ("jbig2dec" ,jbig2dec)
738 ("libjpeg" ,libjpeg-turbo)
742 ("openjpeg" ,openjpeg)
748 `(#:tests? #f ; no check target
749 #:make-flags (list "verbose=yes"
750 (string-append "CC=" ,(cc-for-target))
752 "USE_SYSTEM_LIBS=yes"
753 "USE_SYSTEM_MUJS=yes"
755 ;; Even with the linkage patch we must fix RUNPATH.
756 (string-append "LDFLAGS=-Wl,-rpath="
757 (assoc-ref %outputs "out") "/lib")
758 (string-append "prefix=" (assoc-ref %outputs "out")))
759 #:phases (modify-phases %standard-phases
760 (delete 'configure)))) ; no configure script
761 (home-page "https://mupdf.com")
762 (synopsis "Lightweight PDF viewer and toolkit")
764 "MuPDF is a C library that implements a PDF and XPS parsing and
765 rendering engine. It is used primarily to render pages into bitmaps,
766 but also provides support for other operations such as searching and
767 listing the table of contents and hyperlinks.
769 The library ships with a rudimentary X11 viewer, and a set of command
770 line tools for batch rendering @command{pdfdraw}, rewriting files
771 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
772 (license (list license:agpl3+
773 license:bsd-3 ; resources/cmaps
774 license:x11 ; thirdparty/lcms2
775 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
776 license:asl2.0)))) ; resources/fonts/droid
784 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
785 "/qpdf-" version ".tar.gz"))
788 "0yw2cpw7ygfd6jlgpwbi8vsnvv9p55zxp9h17x77z2qq733pf8jx"))))
789 (build-system gnu-build-system)
791 `(#:disallowed-references (,perl)
793 (modify-phases %standard-phases
794 (add-before 'configure 'patch-paths
796 (substitute* "make/libtool.mk"
798 (string-append "SHELL=" (which "bash"))))
800 '("qtest/bin/qtest-driver")
801 (find-files "." "\\.test"))
802 (("/usr/bin/env") (which "env")))
805 (list pkg-config perl))
807 ;; In Requires.private of libqpdf.pc.
808 (list libjpeg-turbo zlib))
809 (synopsis "Command-line tools and library for transforming PDF files")
811 "QPDF is a command-line program that does structural, content-preserving
812 transformations on PDF files. It could have been called something like
813 pdf-to-pdf. It includes support for merging and splitting PDFs and to
814 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
815 program capable of converting PDF into other formats.")
816 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
817 ;; Users can still choose to use the old license at their option.
818 (license (list license:asl2.0 license:clarified-artistic))
819 (home-page "http://qpdf.sourceforge.net/")))
821 (define-public qpdfview
828 (uri (string-append "https://launchpad.net/qpdfview/"
829 "trunk/" version "/+download/"
830 "qpdfview-" version ".tar.gz"))
832 (base32 "0v1rl126hvblajnph2hkansgi0s8vjdc5yxrm4y3faa0lxzjwr6c"))
833 (patches (search-patches "qpdfview-qt515-compat.patch"))))
834 (build-system qt-build-system)
845 `(#:tests? #f ; no tests
847 (modify-phases %standard-phases
849 (lambda* (#:key outputs #:allow-other-keys)
850 (substitute* "qpdfview.pri"
851 (("/usr") (assoc-ref outputs "out")))
852 (invoke "qmake" "qpdfview.pro"))))))
853 (home-page "https://launchpad.net/qpdfview")
854 (synopsis "Tabbed document viewer")
855 (description "@command{qpdfview} is a document viewer for PDF, PS and DJVU
856 files. It uses the Qt toolkit and features persistent per-file settings,
857 configurable toolbars and shortcuts, continuous and multi‐page layouts,
858 SyncTeX support, and rudimentary support for annotations and forms.")
859 (license license:gpl2+)))
861 (define-public xournal
864 (version "0.4.8.2016")
868 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
869 "/xournal-" version ".tar.gz"))
872 "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
873 (build-system gnu-build-system)
875 (list gtk+-2 pango poppler glib libgnomecanvas))
878 (home-page "http://xournal.sourceforge.net/")
879 (synopsis "Notetaking using a stylus")
881 "Xournal is an application for notetaking, sketching, keeping a journal
883 (license license:gpl2+)))
885 (define-public xournalpp
893 (url "https://github.com/xournalpp/xournalpp")
895 (file-name (git-file-name name version))
897 (base32 "0ldf58l5sqy52x5dqfpdjdh7ldjilj9mw42jzsl5paxg0md2k0hl"))))
898 (build-system cmake-build-system)
900 `(#:configure-flags (list "-DENABLE_CPPUNIT=ON") ;enable tests
901 #:imported-modules ((guix build glib-or-gtk-build-system)
902 ,@%cmake-build-system-modules)
903 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
904 (guix build cmake-build-system)
907 (modify-phases %standard-phases
908 (add-after 'unpack 'fix-permissions-on-po-files
910 ;; Make sure 'msgmerge' can modify the PO files.
911 (for-each make-file-writable
912 (find-files "." "\\.po$"))))
913 ;; Fix path to addr2line utility, which the crash reporter uses.
914 (add-after 'unpack 'fix-paths
915 (lambda* (#:key inputs #:allow-other-keys)
916 (substitute* "src/util/Stacktrace.cpp"
917 ;; Match only the commandline.
919 (string-append "\"" (which "addr2line") " ")))))
920 (add-after 'install 'glib-or-gtk-wrap
921 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
923 `(("cppunit" ,cppunit)
924 ("gettext" ,gettext-minimal)
925 ("help2man" ,help2man)
926 ("pkg-config" ,pkg-config)))
938 (home-page "https://github.com/xournalpp/xournalpp")
939 (synopsis "Handwriting notetaking software with PDF annotation support")
940 (description "Xournal++ is a hand note taking software written in
941 C++ with the target of flexibility, functionality and speed. Stroke
942 recognizer and other parts are based on Xournal code.
947 @item Support for Pen pressure, e.g., Wacom Tablet
948 @item Support for annotating PDFs
949 @item Fill shape functionality
950 @item PDF Export (with and without paper style)
951 @item PNG Export (with and without transparent background)
952 @item Map different tools / colors etc. to stylus buttons /
954 @item Sidebar with Page Previews with advanced page sorting, PDF
955 Bookmarks and Layers (can be individually hidden, editing layer can be
957 @item enhanced support for image insertion
958 @item Eraser with multiple configurations
960 @item bug reporting, autosave, and auto backup tools
961 @item Customizeable toolbar, with multiple configurations, e.g., to
962 optimize toolbar for portrait / landscape
963 @item Page Template definitions
964 @item Shape drawing (line, arrow, circle, rectangle)
965 @item Shape resizing and rotation
966 @item Rotation snapping every 45 degrees
967 @item Rect snapping to grid
968 @item Audio recording and playback alongside with handwritten notes
969 @item Multi Language Support, Like English, German, Italian...
970 @item Plugins using LUA Scripting
972 (license license:gpl2+)))
974 (define-public python-reportlab
976 (name "python-reportlab")
980 (uri (pypi-uri "reportlab" version))
983 "0i17qgm7gzy7pzp240mkpsx9rn8rr67jh5npp5bylv3sd41g48cw"))))
984 (build-system python-build-system)
986 '(;; FIXME: There is one test failure, building the pdf manual from source,
987 ;; but it does not cause the build to fail.
988 #:test-target "tests"
989 #:configure-flags (list "--use-system-libart")
991 (modify-phases %standard-phases
992 (add-after 'unpack 'find-libraries
993 (lambda* (#:key inputs #:allow-other-keys)
994 (let ((libart (assoc-ref inputs "libart-lgpl"))
995 (freetype (assoc-ref inputs "freetype"))
996 (dlt1 (assoc-ref inputs "font-curve-files")))
997 (substitute* "setup.py"
998 (("/usr/include/libart-\\*")
999 (string-append libart "/include/libart-2.0"))
1000 (("/usr/include/freetype2")
1001 (string-append freetype "/include"))
1002 (("http://www.reportlab.com/ftp/pfbfer-20180109.zip")
1003 (string-append "file://" dlt1)))
1006 `(("freetype" ,freetype)
1007 ("libart-lgpl" ,libart-lgpl)
1011 (uri "http://www.reportlab.com/ftp/pfbfer-20180109.zip")
1014 "1v0gy4mbx02ys96ssx89420y0njknlrxs2bx64bv4rp8a0al66w5"))))))
1016 (list python-pillow))
1017 (home-page "https://www.reportlab.com")
1018 (synopsis "Python library for generating PDFs and graphics")
1019 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
1020 of rich PDF documents, and also creation of charts in a variety of bitmap and
1022 (license license:bsd-3)))
1024 (define-public python2-reportlab
1025 (package-with-python2 python-reportlab))
1027 (define-public impressive
1034 "mirror://sourceforge/impressive/Impressive/"
1035 version "/Impressive-" version ".tar.gz"))
1038 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
1039 (build-system python-build-system)
1041 ;; TODO: Add dependency on pdftk.
1042 (inputs (list python2-pygame python2-pillow sdl xpdf))
1045 `(#:python ,python-2
1046 #:phases (modify-phases %standard-phases
1051 (lambda* (#:key inputs outputs #:allow-other-keys)
1052 ;; There's no 'setup.py' so install things manually.
1053 (let* ((out (assoc-ref outputs "out"))
1054 (bin (string-append out "/bin"))
1055 (man1 (string-append out "/share/man/man1"))
1056 (sdl (assoc-ref inputs "sdl"))
1057 (xpdf (assoc-ref inputs "xpdf")))
1059 (copy-file "impressive.py"
1060 (string-append bin "/impressive"))
1061 (wrap-program (string-append bin "/impressive")
1062 `("LIBRARY_PATH" ":" prefix ;for ctypes
1063 (,(string-append sdl "/lib")))
1064 `("PATH" ":" prefix ;for pdftoppm
1065 (,(string-append xpdf "/bin"))))
1066 (install-file "impressive.1" man1)
1068 (home-page "http://impressive.sourceforge.net")
1069 (synopsis "PDF presentation tool with visual effects")
1071 "Impressive is a tool to display PDF files that provides visual effects
1072 such as smooth alpha-blended slide transitions. It provides additional tools
1073 such as zooming, highlighting an area of the screen, and a tool to navigate
1075 (license license:gpl2)))
1077 (define-public img2pdf
1084 (uri (pypi-uri "img2pdf" version))
1086 (base32 "17z0bn8kihiyqjd1m5jr80m7ry06l1qn0l8v918xg5gs7q2calcf"))))
1087 (build-system python-build-system)
1089 (list python-pikepdf python-pillow
1091 (home-page "https://gitlab.mister-muffin.de/josch/img2pdf")
1092 (synopsis "Convert images to PDF via direct JPEG inclusion")
1094 "img2pdf converts images to PDF via direct JPEG inclusion. That
1095 conversion is lossless: the image embedded in the PDF has the exact same color
1096 information for every pixel as the input.")
1097 (license license:lgpl3)))
1099 (define-public fbida
1103 (home-page "https://www.kraxel.org/blog/linux/fbida/")
1106 (uri (string-append "https://www.kraxel.org/releases/fbida/"
1107 "fbida-" version ".tar.gz"))
1110 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
1111 (build-system gnu-build-system)
1114 (modify-phases %standard-phases
1115 (add-after 'unpack 'patch-FHS-file-names
1117 (substitute* "mk/Autoconf.mk"
1118 (("/bin/echo") "echo")
1119 (("/sbin/ldconfig -p") "echo lib")) #t))
1120 (add-before 'build 'set-fcommon
1122 (setenv "CFLAGS" "-fcommon")))
1123 (delete 'configure))
1126 (list (string-append "CC=" ,(cc-for-target))
1127 (string-append "prefix=" (assoc-ref %outputs "out")))))
1128 (inputs `(("libjpeg" ,libjpeg-turbo)
1130 ("libtiff" ,libtiff)
1132 ("libwebp" ,libwebp)
1136 ("cairo-xcb" ,cairo-xcb)
1137 ("freetype" ,freetype)
1138 ("fontconfig" ,fontconfig)
1139 ("libexif" ,libexif)
1141 ("libepoxy" ,libepoxy)
1143 ("poppler" ,poppler)))
1144 (native-inputs (list pkg-config))
1145 (synopsis "Framebuffer and drm-based image viewer")
1147 "fbida contains a few applications for viewing and editing images on
1149 (license license:gpl2+)))
1151 (define-public pdf2svg
1158 (url "https://github.com/dawbarton/pdf2svg")
1159 (commit (string-append "v" version))))
1160 (file-name (git-file-name name version))
1163 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
1164 (build-system gnu-build-system)
1166 (list cairo poppler))
1169 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
1170 (synopsis "PDF to SVG converter")
1171 (description "@command{pdf2svg} is a simple command-line PDF to SVG
1172 converter using the Poppler and Cairo libraries.")
1173 (license license:gpl2+)))
1175 (define-public python-pypdf2
1177 (name "python-pypdf2")
1181 (uri (pypi-uri "PyPDF2" version))
1184 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
1185 (build-system python-build-system)
1188 (modify-phases %standard-phases
1190 'unpack 'patch-test-suite
1192 ;; The text-file needs to be opened in binary mode for Python 3,
1193 ;; so patch in the "b"
1194 (substitute* "Tests/tests.py"
1195 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
1196 (string-append line "b")))
1200 (invoke "python" "-m" "unittest" "Tests.tests"))))))
1201 (home-page "http://mstamy2.github.com/PyPDF2")
1202 (synopsis "Pure Python PDF toolkit")
1203 (description "PyPDF2 is a pure Python PDF library capable of:
1206 @item extracting document information (title, author, …)
1207 @item splitting documents page by page
1208 @item merging documents page by page
1209 @item cropping pages
1210 @item merging multiple pages into a single page
1211 @item encrypting and decrypting PDF files
1214 By being pure Python, it should run on any Python platform without any
1215 dependencies on external libraries. It can also work entirely on
1216 @code{StringIO} objects rather than file streams, allowing for PDF
1217 manipulation in memory. It is therefore a useful tool for websites that
1218 manage or manipulate PDFs.")
1219 (license license:bsd-3)))
1221 (define-public python2-pypdf2
1222 (package-with-python2 python-pypdf2))
1224 (define-public python2-pypdf
1226 (name "python2-pypdf")
1230 (uri (pypi-uri "pyPdf" version))
1233 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
1234 (build-system python-build-system)
1236 `(#:tests? #f ; no tests
1237 #:python ,python-2))
1238 (home-page "http://pybrary.net/pyPdf/")
1239 (synopsis "Pure Python PDF toolkit")
1240 (description "PyPDF2 is a pure Python PDF toolkit.
1242 Note: This module isn't maintained anymore. For new projects please use
1243 python-pypdf2 instead.")
1244 (license license:bsd-3)))
1246 (define-public pdfarranger
1248 (name "pdfarranger")
1254 (url "https://github.com/jeromerobert/pdfarranger")
1256 (file-name (git-file-name name version))
1258 (base32 "18bpnnwjx72d5ps06dr89mkixiwzc9hf5gr75k8qcnrkshl038v2"))))
1259 (build-system python-build-system)
1261 '(#:tests? #f ;no tests
1263 (modify-phases %standard-phases
1264 (add-after 'install 'wrap-for-typelib
1265 (lambda* (#:key inputs outputs #:allow-other-keys)
1266 (let* ((out (assoc-ref outputs "out"))
1267 (program (string-append out "/bin/pdfarranger")))
1268 (wrap-program program
1269 `("GI_TYPELIB_PATH" ":" prefix
1270 (,(getenv "GI_TYPELIB_PATH"))))))))))
1272 (list intltool python-distutils-extra))
1274 (list gtk+ poppler))
1281 (home-page "https://github.com/jeromerobert/pdfarranger")
1282 (synopsis "Merge, split and re-arrange pages from PDF documents")
1284 "PDF Arranger is a small application which allows one to merge or split
1285 PDF documents and rotate, crop and rearrange their pages using an interactive
1286 and intuitive graphical interface.
1288 PDF Arranger was formerly known as PDF-Shuffler.")
1289 (license license:gpl3+)))
1291 (define-public pdfposter
1294 (version "0.7.post1")
1297 (uri (pypi-uri "pdftools.pdfposter" version))
1300 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
1301 (build-system python-build-system)
1303 `(#:tests? #f)) ; test-suite not included in source archive
1305 (list python-pypdf2))
1306 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1307 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1308 (description "@command{pdfposter} can be used to create a large poster by
1309 building it from multiple pages and/or printing it on large media. It expects
1310 as input a PDF file, normally printing on a single page. The output is again
1311 a PDF file, maybe containing multiple pages together building the poster. The
1312 input page will be scaled to obtain the desired size.
1314 This is much like @command{poster} does for Postscript files, but working with
1315 PDF. Since sometimes @command{poster} does not like your files converted from
1316 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1317 (license license:gpl3+)))
1319 (define-public pdfgrep
1326 (uri (string-append "https://pdfgrep.org/download/"
1327 name "-" version ".tar.gz"))
1330 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
1331 (build-system gnu-build-system)
1335 (list libgcrypt pcre poppler))
1336 (home-page "https://pdfgrep.org")
1337 (synopsis "Command-line utility to search text in PDF files")
1339 "Pdfgrep searches in pdf files for strings matching a regular expression.
1340 Support some GNU grep options as file name output, page number output,
1341 optional case insensitivity, count occurrences, color highlights and search in
1343 (license license:gpl2+)))
1345 (define-public pdfpc
1353 (url "https://github.com/pdfpc/pdfpc")
1354 (commit (string-append "v" version))))
1355 (file-name (git-file-name name version))
1357 (base32 "0bmy51w6ypz927hxwp5g7wapqvzqmsi3w32rch6i3f94kg1152ck"))))
1358 (build-system cmake-build-system)
1360 '(#:tests? #f ; no test target
1362 (modify-phases %standard-phases
1363 ;; This is really a bug in Vala.
1364 ;; https://github.com/pdfpc/pdfpc/issues/594
1365 (add-after 'unpack 'fix-vala-API-conflict
1367 (substitute* "src/classes/action/movie.vala"
1368 (("info.from_caps\\(caps\\)")
1369 "Gst.Video.info_from_caps(out info, caps)")))))))
1372 ("discount" ,discount) ; libmarkdown
1374 ("gstreamer" ,gstreamer)
1375 ("gst-plugins-base" ,gst-plugins-base)
1376 ("json-glib" ,json-glib)
1378 ("poppler" ,poppler)
1381 ("webkitgtk" ,webkitgtk-with-libsoup2)))
1384 (home-page "https://pdfpc.github.io/")
1385 (synopsis "Presenter console with multi-monitor support for PDF files")
1387 "pdfpc is a presentation viewer application which uses multi-monitor
1388 output to provide meta information to the speaker during the presentation. It
1389 is able to show a normal presentation window on one screen, while showing a
1390 more sophisticated overview on the other one providing information like a
1391 picture of the next slide, as well as the left over time till the end of the
1392 presentation. The input files processed by pdfpc are PDF documents.")
1393 (license license:gpl3+)))
1402 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1403 version "/paps-" version ".tar.gz"))
1405 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1406 (build-system gnu-build-system)
1410 (list intltool pkg-config))
1411 (home-page "https://github.com/dov/paps")
1412 (synopsis "Pango to PostScript converter")
1414 "Paps reads a UTF-8 encoded file and generates a PostScript language
1415 rendering of the file through the Pango Cairo back end.")
1416 (license license:lgpl2.0+)))
1418 (define-public stapler
1425 (uri (pypi-uri "stapler" version))
1428 "0b2lbm3f79cdxcsagwhzihbzwahjabxqmbws0c8ki25gpdnygdd7"))))
1429 (build-system python-build-system)
1432 (modify-phases %standard-phases
1433 (add-after 'unpack 'fix-more-itertools-version-requirement
1435 ;; Tests require an version of the more-itertools module older
1436 ;; than the one we have packaged.
1437 (substitute* "setup.py"
1438 (("more-itertools>=2\\.2,<6\\.0\\.0") "more-itertools>=2.2"))
1441 (list python-more-itertools python-pypdf2))
1442 (home-page "https://github.com/hellerbarde/stapler")
1443 (synopsis "PDF manipulation tool")
1444 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1445 manipulating PDF documents from the command line. It supports
1448 @item cherry-picking pages and concatenating them into a new file
1449 @item splitting a PDF document into single pages each in its own file
1450 @item merging PDF documents with their pages interleaved
1451 @item displaying metadata in a PDF document
1452 @item displaying the mapping between logical and physical page numbers
1454 (license license:bsd-3)))
1456 (define-public weasyprint
1464 (url "https://github.com/FelixSchwarz/WeasyPrint")
1465 (commit (string-append "v" version))))
1466 (file-name (git-file-name name version))
1469 "0rcj9yah3bp6bbvkmny3w4csx4l5v49lc7mrk29g0x77qnwswjy7"))))
1470 (build-system python-build-system)
1473 (modify-phases %standard-phases
1474 (add-after 'unpack 'patch-library-paths
1475 (lambda* (#:key inputs #:allow-other-keys)
1476 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1477 (glib (assoc-ref inputs "glib"))
1478 (pango (assoc-ref inputs "pango"))
1479 (pangoft2 (assoc-ref inputs "pangoft2")))
1480 (substitute* "weasyprint/fonts.py"
1482 (format #f "'~a/lib/libfontconfig.so'" fontconfig))
1484 (format #f "'~a/lib/libpangoft2-1.0.so'" pango)))
1485 (substitute* "weasyprint/text.py"
1487 (format #f "'~a/lib/libgobject-2.0.so'" glib))
1489 (format #f "'~a/lib/libpango-1.0.so'" pango))
1490 (("'pangocairo-1.0'")
1491 (format #f "'~a/lib/libpangocairo-1.0.so'" pango)))
1493 (add-after 'unpack 'disable-linters
1494 ;; Their check fails; none of our business.
1496 (substitute* "setup.cfg"
1497 ((".*pytest-flake8.*") "")
1498 ((".*pytest-isort.*") "")
1502 (add-before 'check 'register-dejavu-font
1503 (lambda* (#:key inputs #:allow-other-keys)
1504 ;; TODO: fix FreeType so that fonts found in XDG_DATA_DIRS are
1506 (let* ((HOME "/tmp")
1507 (dejavu (assoc-ref inputs "font-dejavu"))
1508 (fonts-dir (string-append HOME "/.fonts")))
1509 (setenv "HOME" HOME)
1511 (symlink (string-append dejavu "/share/fonts/truetype")
1512 (string-append fonts-dir "/truetype"))
1513 (invoke "fc-cache" "-rv")))))))
1515 `(("fontconfig" ,fontconfig)
1528 (list font-dejavu ;tests depend on it
1529 python-pytest-cov python-pytest-runner))
1530 (home-page "https://weasyprint.org/")
1531 (synopsis "Document factory for creating PDF files from HTML")
1532 (description "WeasyPrint helps web developers to create PDF documents. It
1533 turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1536 From a technical point of view, WeasyPrint is a visual rendering engine for
1537 HTML and CSS that can export to PDF and PNG. It aims to support web standards
1540 It is based on various libraries but not on a full rendering engine like
1541 WebKit or Gecko. The CSS layout engine is written in Python, designed for
1542 pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1545 Keywords: html2pdf, htmltopdf")
1546 (license license:bsd-3)))