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–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>
25 ;;; This file is part of GNU Guix.
27 ;;; GNU Guix is free software; you can redistribute it and/or modify it
28 ;;; under the terms of the GNU General Public License as published by
29 ;;; the Free Software Foundation; either version 3 of the License, or (at
30 ;;; your option) any later version.
32 ;;; GNU Guix is distributed in the hope that it will be useful, but
33 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
34 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 ;;; GNU General Public License for more details.
37 ;;; You should have received a copy of the GNU General Public License
38 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
40 (define-module (gnu packages pdf)
41 #:use-module ((guix licenses) #:prefix license:)
42 #:use-module (guix packages)
43 #:use-module (guix download)
44 #:use-module (guix git-download)
45 #:use-module (guix utils)
46 #:use-module (guix build-system gnu)
47 #:use-module (guix build-system cmake)
48 #:use-module (guix build-system meson)
49 #:use-module (guix build-system python)
50 #:use-module (guix build-system qt)
51 #:use-module (guix build-system trivial)
52 #:use-module (gnu packages)
53 #:use-module (gnu packages audio)
54 #:use-module (gnu packages autotools)
55 #:use-module (gnu packages backup)
56 #:use-module (gnu packages base)
57 #:use-module (gnu packages bash)
58 #:use-module (gnu packages check)
59 #:use-module (gnu packages compression)
60 #:use-module (gnu packages cups)
61 #:use-module (gnu packages curl)
62 #:use-module (gnu packages djvu)
63 #:use-module (gnu packages fonts)
64 #:use-module (gnu packages fontutils)
65 #:use-module (gnu packages game-development)
66 #:use-module (gnu packages gcc)
67 #:use-module (gnu packages gettext)
68 #:use-module (gnu packages ghostscript)
69 #:use-module (gnu packages gl)
70 #:use-module (gnu packages glib)
71 #:use-module (gnu packages gnome)
72 #:use-module (gnu packages gnupg)
73 #:use-module (gnu packages gstreamer)
74 #:use-module (gnu packages gtk)
75 #:use-module (gnu packages image)
76 #:use-module (gnu packages javascript)
77 #:use-module (gnu packages lesstif)
78 #:use-module (gnu packages libffi)
79 #:use-module (gnu packages linux)
80 #:use-module (gnu packages lua)
81 #:use-module (gnu packages pcre)
82 #:use-module (gnu packages perl)
83 #:use-module (gnu packages photo)
84 #:use-module (gnu packages pkg-config)
85 #:use-module (gnu packages pulseaudio)
86 #:use-module (gnu packages python)
87 #:use-module (gnu packages python-check)
88 #:use-module (gnu packages python-web)
89 #:use-module (gnu packages python-xyz)
90 #:use-module (gnu packages qt)
91 #:use-module (gnu packages sdl)
92 #:use-module (gnu packages sphinx)
93 #:use-module (gnu packages sqlite)
94 #:use-module (gnu packages tex)
95 #:use-module (gnu packages time)
96 #:use-module (gnu packages tls)
97 #:use-module (gnu packages web)
98 #:use-module (gnu packages xdisorg)
99 #:use-module (gnu packages xml)
100 #:use-module (gnu packages xorg)
101 #:use-module (srfi srfi-1))
103 (define-public flyer-composer
105 (name "flyer-composer")
110 (uri (pypi-uri "flyer-composer" version))
112 (base32 "17igqb5dlcgcq4nimjw6cf9qgz6a728zdx1d0rr90r2z0llcchsv"))))
113 (build-system python-build-system)
115 `(#:tests? #f ;; TODO
117 (modify-phases %standard-phases
118 (add-after 'install 'wrap-executable
119 (lambda* (#:key inputs outputs #:allow-other-keys)
120 (let* ((out (assoc-ref outputs "out"))
121 (qtbase (assoc-ref inputs "qtbase"))
122 (qml "/lib/qt5/qml"))
123 (wrap-program (string-append out "/bin/flyer-composer-gui")
124 `("QT_PLUGIN_PATH" ":" =
125 (,(string-append qtbase "/lib/qt5/plugins")))
126 `("QT_QPA_PLATFORM_PLUGIN_PATH" ":" =
127 (,(string-append qtbase "/lib/qt5/plugins/platforms"))))
130 `(("python-pypdf2" ,python-pypdf2)
131 ("python-pyqt" ,python-pyqt)
132 ("python-poppler-qt5" ,python-poppler-qt5)
134 (home-page "http://crazy-compilers.com/flyer-composer")
135 (synopsis "Rearrange PDF pages to print as flyers on one sheet")
136 (description "@command{flyer-composer} can be used to prepare one- or
137 two-sided flyers for printing on one sheet of paper.
139 Imagine you have designed a flyer in A6 format and want to print it using your
140 A4 printer. Of course, you want to print four flyers on each sheet. This is
141 where Flyer Composer steps in, creating a PDF which holds your flyer four
142 times. If you have a second page, Flyer Composer can arrange it the same way
143 - even if the second page is in a separate PDF file.
145 This package contains both the command line tool and the gui too.")
146 (license license:agpl3+)))
148 (define-public flyer-composer-cli
149 (package/inherit flyer-composer
150 (name "flyer-composer-cli")
152 `(#:tests? #f ;; TODO
154 (modify-phases %standard-phases
155 (add-after 'unpack 'remove-gui
157 (delete-file-recursively "flyer_composer/gui")
158 (substitute* "setup.cfg"
159 (("^\\s+flyer-composer-gui\\s*=.*") ""))
162 `(("python-pypdf2" ,python-pypdf2)))
163 (description "@command{flyer-composer} can be used to prepare one- or
164 two-sided flyers for printing on one sheet of paper.
166 Imagine you have designed a flyer in A6 format and want to print it using your
167 A4 printer. Of course, you want to print four flyers on each sheet. This is
168 where Flyer Composer steps in, creating a PDF which holds your flyer four
169 times. If you have a second page, Flyer Composer can arrange it the same way
170 - even if the second page is in a separate PDF file.
172 This package contains only the command line tool. If you like to use the gui,
173 please install the @code{flyer-composer-gui} package.")))
175 (define-public poppler
181 (uri (string-append "https://poppler.freedesktop.org/poppler-"
185 "0v3z4mk1rr8i0c4cfkab7pnxdbil30j4cm4w6cqlq6cfghkhlqxg"))))
186 (build-system cmake-build-system)
189 (inputs `(("fontconfig" ,fontconfig)
190 ("freetype" ,freetype)
191 ("libjpeg" ,libjpeg-turbo)
195 ("openjpeg" ,openjpeg)
198 ;; To build poppler-glib (as needed by Evince), we need Cairo and
199 ;; GLib. But of course, that Cairo must not depend on Poppler.
200 ("cairo" ,cairo-sans-poppler)))
202 ;; As per poppler-cairo and poppler-glib.pc.
203 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
204 ;; different solution to the circular dependency mentioned above.
207 `(("pkg-config" ,pkg-config)
208 ("glib" ,glib "bin") ; glib-mkenums, etc.
209 ("gobject-introspection" ,gobject-introspection)))
211 `(#:tests? #f ; no test data provided with the tarball
213 (let* ((out (assoc-ref %outputs "out"))
214 (lib (string-append out "/lib")))
215 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
217 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
218 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
219 (synopsis "PDF rendering library")
221 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
222 (license license:gpl2+)
223 (home-page "https://poppler.freedesktop.org/")))
225 (define-public poppler-data
227 (name "poppler-data")
231 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
232 "-" version ".tar.gz"))
235 "0c3vjs3p7rjc4yfacnhd865r27czmzwcr4j2z4jldi68dvvcwbvf"))))
236 (build-system gnu-build-system)
238 '(#:tests? #f ; no test suite
239 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
241 (modify-phases %standard-phases
242 ;; The package only provides some data files, so there is nothing to
246 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
247 (description "This package provides optional encoding files for Poppler.
248 When present, Poppler is able to correctly render CJK and Cyrillic text.")
249 (home-page (package-home-page poppler))
250 ;; See COPYING in the source distribution for more information about
252 (license (list license:bsd-3
255 (define-public poppler-qt4
256 (package/inherit poppler
258 (inputs `(("qt-4" ,qt-4)
259 ,@(package-inputs poppler)))
260 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
262 (define-public poppler-qt5
263 (package/inherit poppler
265 (inputs `(("qtbase" ,qtbase)
266 ,@(package-inputs poppler)))
267 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
269 (define-public python-poppler-qt5
271 (name "python-poppler-qt5")
276 (uri (pypi-uri "python-poppler-qt5" version))
279 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
280 (build-system python-build-system)
282 `(;; There are no tests. The check phase just causes a rebuild.
285 (modify-phases %standard-phases
287 (lambda* (#:key inputs #:allow-other-keys)
288 (substitute* "setup.py"
289 ;; This check always fails, so disable it.
290 (("if not check_qtxml\\(\\)")
292 ;; We need to pass an extra flag here. This cannot be in
293 ;; configure-flags because it should not be passed for the
294 ;; installation phase.
295 ((@@ (guix build python-build-system) call-setuppy)
296 "build_ext" (list (string-append "--pyqt-sip-dir="
297 (assoc-ref inputs "python-pyqt")
298 "/share/sip")) #t))))))
300 `(("pkg-config" ,pkg-config)))
302 `(("python-sip" ,python-sip)
303 ("python-pyqt" ,python-pyqt)
304 ("poppler-qt5" ,poppler-qt5)
306 (home-page "https://pypi.org/project/python-poppler-qt5/")
307 (synopsis "Python bindings for Poppler-Qt5")
309 "This package provides Python bindings for the Qt5 interface of the
310 Poppler PDF rendering library.")
311 (license license:lgpl2.1+)))
313 (define-public libharu
320 (url "https://github.com/libharu/libharu")
321 (commit (string-append
323 (string-join (string-split version #\.) "_")))))
324 (file-name (git-file-name name version))
327 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
328 (build-system gnu-build-system)
331 (list (string-append "--with-zlib="
332 (assoc-ref %build-inputs "zlib"))
333 (string-append "--with-png="
334 (assoc-ref %build-inputs "libpng")))))
339 `(("autoconf" ,autoconf)
340 ("automake" ,automake)
341 ("libtool" ,libtool)))
342 (home-page "http://libharu.org/")
343 (synopsis "Library for generating PDF files")
345 "libHaru is a library for generating PDF files. libHaru does not support
346 reading and editing of existing PDF files.")
347 (license license:zlib)))
356 (uri (string-append "https://xpdfreader-dl.s3.amazonaws.com/xpdf-"
357 version "4.02.tar.gz"))
359 (base32 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
360 (build-system gnu-build-system)
361 (inputs `(("freetype" ,freetype)
362 ("gs-fonts" ,gs-fonts)
364 ("libpaper" ,libpaper)
373 `(#:tests? #f ; there is no check target
374 #:parallel-build? #f ; build fails randomly on 8-way machines
376 (list (string-append "--with-freetype2-includes="
377 (assoc-ref %build-inputs "freetype")
378 "/include/freetype2"))
380 (modify-phases %standard-phases
382 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
383 (let* ((install (assoc-ref %standard-phases 'install))
384 (out (assoc-ref outputs "out"))
385 (xpdfrc (string-append out "/etc/xpdfrc"))
386 (gs-fonts (assoc-ref inputs "gs-fonts")))
389 (("/usr/local/share/ghostscript/fonts")
390 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
391 (("#fontFile") "fontFile")))
393 (synopsis "Viewer for PDF files based on the Motif toolkit")
395 "Xpdf is a viewer for Portable Document Format (PDF) files.")
396 (license license:gpl3) ; or gpl2, but not gpl2+
397 (home-page "https://www.xpdfreader.com/")))
399 (define-public zathura-cb
406 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
410 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
411 (native-inputs `(("pkg-config" ,pkg-config)))
412 (inputs `(("libarchive" ,libarchive)
413 ("zathura" ,zathura)))
414 (build-system meson-build-system)
416 `(#:tests? #f ; package does not contain tests
418 (modify-phases %standard-phases
419 (add-after 'unpack 'patch-plugin-directory
420 ;; Something of a regression in 0.1.8: the new Meson build system
421 ;; now hard-codes an incorrect plugin directory. Fix it.
422 (lambda* (#:key outputs #:allow-other-keys)
423 (substitute* "meson.build"
424 (("(install_dir:).*" _ key)
426 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
428 (home-page "https://pwmt.org/projects/zathura-cb/")
429 (synopsis "Comic book support for zathura (libarchive backend)")
430 (description "The zathura-cb plugin adds comic book support to zathura
432 (license license:zlib)))
434 (define-public zathura-ps
441 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
445 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
446 (native-inputs `(("pkg-config" ,pkg-config)))
447 (inputs `(("libspectre" ,libspectre)
448 ("zathura" ,zathura)))
449 (build-system meson-build-system)
451 `(#:tests? #f ; package does not contain tests
453 (modify-phases %standard-phases
454 (add-after 'unpack 'patch-plugin-directory
455 ;; Something of a regression in 0.2.6: the new Meson build system
456 ;; now hard-codes an incorrect plugin directory. Fix it.
457 (lambda* (#:key outputs #:allow-other-keys)
458 (substitute* "meson.build"
459 (("(install_dir:).*" _ key)
461 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
463 (home-page "https://pwmt.org/projects/zathura-ps/")
464 (synopsis "PS support for zathura (libspectre backend)")
465 (description "The zathura-ps plugin adds PS support to zathura
467 (license license:zlib)))
469 (define-public zathura-djvu
471 (name "zathura-djvu")
476 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
480 "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"))))
481 (native-inputs `(("pkg-config" ,pkg-config)))
483 `(("djvulibre" ,djvulibre)
484 ("zathura" ,zathura)))
485 (build-system meson-build-system)
487 `(#:tests? #f ; package does not contain tests
489 (modify-phases %standard-phases
490 (add-after 'unpack 'patch-plugin-directory
491 ;; Something of a regression in 0.2.8: the new Meson build system
492 ;; now hard-codes an incorrect plugin directory. Fix it.
493 (lambda* (#:key outputs #:allow-other-keys)
494 (substitute* "meson.build"
495 (("(install_dir:).*" _ key)
497 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
499 (home-page "https://pwmt.org/projects/zathura-djvu/")
500 (synopsis "DjVu support for zathura (DjVuLibre backend)")
501 (description "The zathura-djvu plugin adds DjVu support to zathura
502 using the DjVuLibre library.")
503 (license license:zlib)))
505 (define-public zathura-pdf-mupdf
507 (name "zathura-pdf-mupdf")
512 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
513 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
516 "1r3v37k9fl2rxipvacgxr36llywvy7n20a25h3ajlyk70697sa66"))))
517 (native-inputs `(("pkg-config" ,pkg-config)))
519 `(("jbig2dec" ,jbig2dec)
520 ("libjpeg" ,libjpeg-turbo)
523 ("openjpeg" ,openjpeg)
525 ("zathura" ,zathura)))
526 (build-system meson-build-system)
528 `(#:tests? #f ; package does not contain tests
529 #:configure-flags (list (string-append "-Dplugindir="
530 (assoc-ref %outputs "out")
532 "-Dlink-external=true")
534 (modify-phases %standard-phases
535 (add-after 'unpack 'remove-libmupdfthird.a-requirement
537 ;; Ignore a missing (apparently superfluous) static library.
538 (substitute* "meson.build"
539 ((".*mupdfthird.*") ""))
541 (add-before 'configure 'add-mujs-to-dependencies
543 ;; Add mujs to the 'build_dependencies'.
544 (substitute* "meson.build"
545 (("^ libopenjp2 = dependency.*" x)
546 (string-append x " mujs = cc.find_library('mujs')\n"))
548 " libopenjp2, mujs")))))))
549 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
550 (synopsis "PDF support for zathura (mupdf backend)")
551 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
552 by using the @code{mupdf} rendering library.")
553 (license license:zlib)))
555 (define-public zathura-pdf-poppler
557 (name "zathura-pdf-poppler")
562 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
566 "1vfl4vkyy3rf39r1sqaa7y8113bgkh2bkfq3nn2inis9mrykmk6m"))))
567 (native-inputs `(("pkg-config" ,pkg-config)))
569 `(("poppler" ,poppler)
570 ("zathura" ,zathura)))
571 (build-system meson-build-system)
573 `(#:tests? #f ; package does not include tests
575 (modify-phases %standard-phases
576 (add-after 'unpack 'patch-plugin-directory
577 ;; Something of a regression in 0.2.9: the new Meson build system
578 ;; now hard-codes an incorrect plugin directory. Fix it.
579 (lambda* (#:key outputs #:allow-other-keys)
580 (substitute* "meson.build"
581 (("(install_dir:).*" _ key)
583 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
585 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
586 (synopsis "PDF support for zathura (poppler backend)")
587 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
588 by using the poppler rendering engine.")
589 (license license:zlib)))
591 (define-public zathura
598 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
602 "1rx1fk9s556fk59lmqgvhwrmv71ashh89bx9adjq46wq5gzdn4p0"))))
603 (native-inputs `(("pkg-config" ,pkg-config)
604 ("gettext" ,gettext-minimal)
605 ("glib:bin" ,glib "bin")
607 ;; For building documentation.
608 ("python-sphinx" ,python-sphinx)
610 ;; For building icons.
615 ("xorg-server" ,xorg-server-for-tests)))
616 (inputs `(("sqlite" ,sqlite)))
617 ;; Listed in 'Requires.private' of 'zathura.pc'.
618 (propagated-inputs `(("cairo" ,cairo)
621 (list (search-path-specification
622 (variable "ZATHURA_PLUGINS_PATH")
623 (files '("lib/zathura")))))
624 (build-system meson-build-system)
626 `(#:phases (modify-phases %standard-phases
627 (add-before 'check 'start-xserver
628 ;; Tests require a running X server.
629 (lambda* (#:key inputs #:allow-other-keys)
630 (let ((xorg-server (assoc-ref inputs "xorg-server"))
632 (setenv "DISPLAY" display)
634 ;; On busy machines, tests may take longer than
635 ;; the default of four seconds.
636 (setenv "CK_DEFAULT_TIMEOUT" "20")
638 ;; Don't fail due to missing '/etc/machine-id'.
639 (setenv "DBUS_FATAL_WARNINGS" "0")
640 (zero? (system (string-append xorg-server "/bin/Xvfb "
641 display " &")))))))))
642 (home-page "https://pwmt.org/projects/zathura/")
643 (synopsis "Lightweight keyboard-driven PDF viewer")
644 (description "Zathura is a customizable document viewer. It provides a
645 minimalistic interface and an interface that mainly focuses on keyboard
647 (license license:zlib)))
649 (define-public podofo
655 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
656 "/podofo-" version ".tar.gz"))
659 "1f0yvkx6nf99fp741w2y706d8bs9824x1z2gqm3rdy5fv8bfgwkw"))))
660 (build-system cmake-build-system)
662 `(("cppunit" ,cppunit)
663 ("pkg-config" ,pkg-config)))
665 `(("libjpeg" ,libjpeg-turbo)
667 ("fontconfig" ,fontconfig)
668 ("freetype" ,freetype)
675 (list "-DPODOFO_BUILD_SHARED=ON")
677 (modify-phases %standard-phases
678 (add-before 'configure 'patch
679 (lambda* (#:key inputs #:allow-other-keys)
680 (let ((freetype (assoc-ref inputs "freetype")))
681 ;; Look for freetype include files in the correct place.
682 (substitute* "cmake/modules/FindFREETYPE.cmake"
683 (("/usr/local") freetype)))
685 (home-page "http://podofo.sourceforge.net")
686 (synopsis "Tools to work with the PDF file format")
688 "PoDoFo is a C++ library and set of command-line tools to work with the
689 PDF file format. It can parse PDF files and load them into memory, and makes
690 it easy to modify them and write the changes to disk. It is primarily useful
691 for applications that wish to do lower level manipulation of PDF, such as
692 extracting content or merging files.")
693 (license license:lgpl2.0+)))
702 (uri (string-append "https://mupdf.com/downloads/archive/"
703 "mupdf-" version "-source.tar.xz"))
705 (base32 "16m5sksil22sshxy70xkslsb2qhvcqb1d95i9savnhds1xn4ybar"))
706 (patches (search-patches "mupdf-fix-linkage.patch"))
707 (modules '((guix build utils)))
710 ;; Remove bundled software.
711 (let* ((keep (list "lcms2")) ; different from our lcms2 package
713 (kept (string-append from "~temp")))
715 (for-each (lambda (file) (rename-file (string-append from "/" file)
716 (string-append kept "/" file)))
718 (delete-file-recursively from)
719 (rename-file kept from))
721 (build-system gnu-build-system)
724 ("freeglut" ,freeglut)
725 ("freetype" ,freetype)
726 ("gumbo-parser" ,gumbo-parser)
727 ("harfbuzz" ,harfbuzz)
728 ("jbig2dec" ,jbig2dec)
729 ("libjpeg" ,libjpeg-turbo)
733 ("openjpeg" ,openjpeg)
737 `(("pkg-config" ,pkg-config)))
739 `(#:tests? #f ; no check target
740 #:make-flags (list "verbose=yes"
741 (string-append "CC=" ,(cc-for-target))
743 "USE_SYSTEM_LIBS=yes"
744 "USE_SYSTEM_MUJS=yes"
746 ;; Even with the linkage patch we must fix RUNPATH.
747 (string-append "LDFLAGS=-Wl,-rpath="
748 (assoc-ref %outputs "out") "/lib")
749 (string-append "prefix=" (assoc-ref %outputs "out")))
750 #:phases (modify-phases %standard-phases
751 (delete 'configure)))) ; no configure script
752 (home-page "https://mupdf.com")
753 (synopsis "Lightweight PDF viewer and toolkit")
755 "MuPDF is a C library that implements a PDF and XPS parsing and
756 rendering engine. It is used primarily to render pages into bitmaps,
757 but also provides support for other operations such as searching and
758 listing the table of contents and hyperlinks.
760 The library ships with a rudimentary X11 viewer, and a set of command
761 line tools for batch rendering @command{pdfdraw}, rewriting files
762 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
763 (license (list license:agpl3+
764 license:bsd-3 ; resources/cmaps
765 license:x11 ; thirdparty/lcms2
766 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
767 license:asl2.0)))) ; resources/fonts/droid
775 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
776 "/qpdf-" version ".tar.gz"))
779 "0yw2cpw7ygfd6jlgpwbi8vsnvv9p55zxp9h17x77z2qq733pf8jx"))))
780 (build-system gnu-build-system)
782 `(#:disallowed-references (,perl)
784 (modify-phases %standard-phases
785 (add-before 'configure 'patch-paths
787 (substitute* "make/libtool.mk"
789 (string-append "SHELL=" (which "bash"))))
791 '("qtest/bin/qtest-driver")
792 (find-files "." "\\.test"))
793 (("/usr/bin/env") (which "env")))
796 `(("pkg-config" ,pkg-config)
799 ;; In Requires.private of libqpdf.pc.
800 `(("libjpeg-turbo" ,libjpeg-turbo)
802 (synopsis "Command-line tools and library for transforming PDF files")
804 "QPDF is a command-line program that does structural, content-preserving
805 transformations on PDF files. It could have been called something like
806 pdf-to-pdf. It includes support for merging and splitting PDFs and to
807 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
808 program capable of converting PDF into other formats.")
809 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
810 ;; Users can still choose to use the old license at their option.
811 (license (list license:asl2.0 license:clarified-artistic))
812 (home-page "http://qpdf.sourceforge.net/")))
814 (define-public qpdfview
821 (uri (string-append "https://launchpad.net/qpdfview/"
822 "trunk/" version "/+download/"
823 "qpdfview-" version ".tar.gz"))
825 (base32 "0v1rl126hvblajnph2hkansgi0s8vjdc5yxrm4y3faa0lxzjwr6c"))))
826 (build-system gnu-build-system)
828 `(("pkg-config" ,pkg-config)))
831 ("djvulibre" ,djvulibre)
832 ("libspectre" ,libspectre)
833 ("poppler-qt5" ,poppler-qt5)
837 `(#:imported-modules ((guix build qt-build-system)
838 (guix build cmake-build-system)
839 ,@%gnu-build-system-modules)
840 #:modules ((guix build utils)
841 (guix build gnu-build-system)
842 ((guix build qt-build-system) #:prefix qt:))
844 (modify-phases %standard-phases
847 (substitute* "qpdfview.pri"
848 (("/usr") (assoc-ref %outputs "out")))
849 (invoke "qmake" "qpdfview.pro")))
850 ;; Otherwise, the user interface will not display any icons.
851 (add-after 'install 'qt-wrap
852 (assoc-ref qt:%standard-phases 'qt-wrap)))))
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)
879 ("libgnomecanvas" ,libgnomecanvas)))
881 `(("pkg-config" ,pkg-config)))
882 (home-page "http://xournal.sourceforge.net/")
883 (synopsis "Notetaking using a stylus")
885 "Xournal is an application for notetaking, sketching, keeping a journal
887 (license license:gpl2+)))
889 (define-public xournalpp
897 (url "https://github.com/xournalpp/xournalpp")
899 (file-name (git-file-name name version))
901 (base32 "1c7n03xm3m4lwcwxgplkn25i8c6s3i7rijbkcx86br1j4jadcs3k"))))
902 (build-system cmake-build-system)
904 `(#:configure-flags (list "-DENABLE_CPPUNIT=ON") ;enable tests
905 #:imported-modules ((guix build glib-or-gtk-build-system)
906 ,@%cmake-build-system-modules)
907 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
908 (guix build cmake-build-system)
911 (modify-phases %standard-phases
912 (add-after 'unpack 'fix-permissions-on-po-files
914 ;; Make sure 'msgmerge' can modify the PO files.
915 (for-each (lambda (po) (chmod po #o666))
916 (find-files "." "\\.po$"))
918 ;; Fix path to addr2line utility, which the crash reporter uses.
919 (add-after 'unpack 'fix-paths
920 (lambda* (#:key inputs #:allow-other-keys)
921 (substitute* "src/util/Stacktrace.cpp"
922 ;; Match only the commandline.
924 (string-append "\"" (which "addr2line") " ")))
926 (add-after 'install 'glib-or-gtk-wrap
927 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
929 `(("cppunit" ,cppunit)
930 ("gettext" ,gettext-minimal)
931 ("pkg-config" ,pkg-config)))
933 `(("alsa-lib" ,alsa-lib)
936 ("libsndfile" ,libsndfile)
939 ("lua" ,lua) ;FIXME: It cannot find the Lua library.
941 ("portaudio" ,portaudio)
942 ("texlive-bin" ,texlive-bin)))
943 (home-page "https://github.com/xournalpp/xournalpp")
944 (synopsis "Handwriting notetaking software with PDF annotation support")
945 (description "Xournal++ is a hand note taking software written in
946 C++ with the target of flexibility, functionality and speed. Stroke
947 recognizer and other parts are based on Xournal code.
952 @item Support for Pen pressure, e.g., Wacom Tablet
953 @item Support for annotating PDFs
954 @item Fill shape functionality
955 @item PDF Export (with and without paper style)
956 @item PNG Export (with and without transparent background)
957 @item Map different tools / colors etc. to stylus buttons /
959 @item Sidebar with Page Previews with advanced page sorting, PDF
960 Bookmarks and Layers (can be individually hidden, editing layer can be
962 @item enhanced support for image insertion
963 @item Eraser with multiple configurations
965 @item bug reporting, autosave, and auto backup tools
966 @item Customizeable toolbar, with multiple configurations, e.g., to
967 optimize toolbar for portrait / landscape
968 @item Page Template definitions
969 @item Shape drawing (line, arrow, circle, rectangle)
970 @item Shape resizing and rotation
971 @item Rotation snapping every 45 degrees
972 @item Rect snapping to grid
973 @item Audio recording and playback alongside with handwritten notes
974 @item Multi Language Support, Like English, German, Italian...
975 @item Plugins using LUA Scripting
977 (license license:gpl2+)))
979 (define-public python-reportlab
981 (name "python-reportlab")
985 (uri (pypi-uri "reportlab" version))
988 "0i17qgm7gzy7pzp240mkpsx9rn8rr67jh5npp5bylv3sd41g48cw"))))
989 (build-system python-build-system)
991 '(;; FIXME: There is one test failure, building the pdf manual from source,
992 ;; but it does not cause the build to fail.
993 #:test-target "tests"
994 #:configure-flags (list "--use-system-libart")
996 (modify-phases %standard-phases
997 (add-after 'unpack 'find-libraries
998 (lambda* (#:key inputs #:allow-other-keys)
999 (let ((libart (assoc-ref inputs "libart-lgpl"))
1000 (freetype (assoc-ref inputs "freetype"))
1001 (dlt1 (assoc-ref inputs "font-curve-files")))
1002 (substitute* "setup.py"
1003 (("/usr/include/libart-\\*")
1004 (string-append libart "/include/libart-2.0"))
1005 (("/usr/include/freetype2")
1006 (string-append freetype "/include"))
1007 (("http://www.reportlab.com/ftp/pfbfer-20180109.zip")
1008 (string-append "file://" dlt1)))
1011 `(("freetype" ,freetype)
1012 ("libart-lgpl" ,libart-lgpl)
1016 (uri "http://www.reportlab.com/ftp/pfbfer-20180109.zip")
1019 "1v0gy4mbx02ys96ssx89420y0njknlrxs2bx64bv4rp8a0al66w5"))))))
1021 `(("python-pillow" ,python-pillow)))
1022 (home-page "https://www.reportlab.com")
1023 (synopsis "Python library for generating PDFs and graphics")
1024 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
1025 of rich PDF documents, and also creation of charts in a variety of bitmap and
1027 (license license:bsd-3)))
1029 (define-public python2-reportlab
1030 (package-with-python2 python-reportlab))
1032 (define-public impressive
1039 "mirror://sourceforge/impressive/Impressive/"
1040 version "/Impressive-" version ".tar.gz"))
1043 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
1044 (build-system python-build-system)
1046 ;; TODO: Add dependency on pdftk.
1047 (inputs `(("python2-pygame" ,python2-pygame)
1048 ("python2-pillow" ,python2-pillow)
1053 `(#:python ,python-2
1054 #:phases (modify-phases %standard-phases
1059 (lambda* (#:key inputs outputs #:allow-other-keys)
1060 ;; There's no 'setup.py' so install things manually.
1061 (let* ((out (assoc-ref outputs "out"))
1062 (bin (string-append out "/bin"))
1063 (man1 (string-append out "/share/man/man1"))
1064 (sdl (assoc-ref inputs "sdl"))
1065 (xpdf (assoc-ref inputs "xpdf")))
1067 (copy-file "impressive.py"
1068 (string-append bin "/impressive"))
1069 (wrap-program (string-append bin "/impressive")
1070 `("LIBRARY_PATH" ":" prefix ;for ctypes
1071 (,(string-append sdl "/lib")))
1072 `("PATH" ":" prefix ;for pdftoppm
1073 (,(string-append xpdf "/bin"))))
1074 (install-file "impressive.1" man1)
1076 (home-page "http://impressive.sourceforge.net")
1077 (synopsis "PDF presentation tool with visual effects")
1079 "Impressive is a tool to display PDF files that provides visual effects
1080 such as smooth alpha-blended slide transitions. It provides additional tools
1081 such as zooming, highlighting an area of the screen, and a tool to navigate
1083 (license license:gpl2)))
1085 (define-public fbida
1089 (home-page "https://www.kraxel.org/blog/linux/fbida/")
1092 (uri (string-append "https://www.kraxel.org/releases/fbida/"
1093 "fbida-" version ".tar.gz"))
1096 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
1097 (build-system gnu-build-system)
1100 (modify-phases %standard-phases
1101 (add-after 'unpack 'patch-FHS-file-names
1103 (substitute* "mk/Autoconf.mk"
1104 (("/bin/echo") "echo")
1105 (("/sbin/ldconfig -p") "echo lib")) #t))
1106 (delete 'configure))
1108 #:make-flags (list "CC=gcc"
1109 (string-append "prefix=" (assoc-ref %outputs "out")))))
1110 (inputs `(("libjpeg" ,libjpeg-turbo)
1112 ("libtiff" ,libtiff)
1114 ("libwebp" ,libwebp)
1118 ("cairo-xcb" ,cairo-xcb)
1119 ("freetype" ,freetype)
1120 ("fontconfig" ,fontconfig)
1121 ("libexif" ,libexif)
1123 ("libepoxy" ,libepoxy)
1125 ("poppler" ,poppler)))
1126 (native-inputs `(("pkg-config" ,pkg-config)))
1127 (synopsis "Framebuffer and drm-based image viewer")
1129 "fbida contains a few applications for viewing and editing images on
1132 (license license:gpl2+)))
1134 (define-public pdf2svg
1141 (url "https://github.com/dawbarton/pdf2svg")
1142 (commit (string-append "v" version))))
1143 (file-name (git-file-name name version))
1146 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
1147 (build-system gnu-build-system)
1150 ("poppler" ,poppler)))
1152 `(("pkg-config" ,pkg-config)))
1153 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
1154 (synopsis "PDF to SVG converter")
1155 (description "@command{pdf2svg} is a simple command-line PDF to SVG
1156 converter using the Poppler and Cairo libraries.")
1157 (license license:gpl2+)))
1159 (define-public python-pypdf2
1161 (name "python-pypdf2")
1165 (uri (pypi-uri "PyPDF2" version))
1168 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
1169 (build-system python-build-system)
1172 (modify-phases %standard-phases
1174 'unpack 'patch-test-suite
1176 ;; The text-file needs to be opened in binary mode for Python 3,
1177 ;; so patch in the "b"
1178 (substitute* "Tests/tests.py"
1179 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
1180 (string-append line "b")))
1184 (invoke "python" "-m" "unittest" "Tests.tests"))))))
1185 (home-page "http://mstamy2.github.com/PyPDF2")
1186 (synopsis "Pure Python PDF toolkit")
1187 (description "PyPDF2 is a pure Python PDF library capable of:
1190 @item extracting document information (title, author, …)
1191 @item splitting documents page by page
1192 @item merging documents page by page
1193 @item cropping pages
1194 @item merging multiple pages into a single page
1195 @item encrypting and decrypting PDF files
1198 By being pure Python, it should run on any Python platform without any
1199 dependencies on external libraries. It can also work entirely on
1200 @code{StringIO} objects rather than file streams, allowing for PDF
1201 manipulation in memory. It is therefore a useful tool for websites that
1202 manage or manipulate PDFs.")
1203 (license license:bsd-3)))
1205 (define-public python2-pypdf2
1206 (package-with-python2 python-pypdf2))
1208 (define-public python2-pypdf
1210 (name "python2-pypdf")
1214 (uri (pypi-uri "pyPdf" version))
1217 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
1218 (build-system python-build-system)
1220 `(#:tests? #f ; no tests
1221 #:python ,python-2))
1222 (home-page "http://pybrary.net/pyPdf/")
1223 (synopsis "Pure Python PDF toolkit")
1224 (description "PyPDF2 is a pure Python PDF toolkit.
1226 Note: This module isn't maintained anymore. For new projects please use
1227 python-pypdf2 instead.")
1228 (license license:bsd-3)))
1230 (define-public pdfarranger
1232 (name "pdfarranger")
1238 (url "https://github.com/jeromerobert/pdfarranger")
1240 (file-name (git-file-name name version))
1242 (base32 "0dmgmvpghsm938iznalbg8h8k17a5h3q466yfc67mcll428n4nx3"))))
1243 (build-system python-build-system)
1245 '(#:tests? #f ;no tests
1246 #:phases (modify-phases %standard-phases
1247 (add-after 'install 'wrap-for-typelib
1248 (lambda* (#:key inputs outputs #:allow-other-keys)
1249 (let* ((out (assoc-ref outputs "out"))
1250 (program (string-append out "/bin/pdfarranger")))
1251 (wrap-program program
1252 `("GI_TYPELIB_PATH" ":" prefix
1253 (,(getenv "GI_TYPELIB_PATH"))))
1256 `(("intltool" ,intltool)
1257 ("python-distutils-extra" ,python-distutils-extra)))
1260 ("poppler" ,poppler)
1261 ("python-dateutil" ,python-dateutil)
1262 ("python-pikepdf" ,python-pikepdf)
1263 ("python-pycairo" ,python-pycairo)
1264 ("python-pygobject" ,python-pygobject)))
1265 (home-page "https://github.com/jeromerobert/pdfarranger")
1266 (synopsis "Merge, split and re-arrange pages from PDF documents")
1268 "PDF Arranger is a small application which allows one to merge or split
1269 PDF documents and rotate, crop and rearrange their pages using an interactive
1270 and intuitive graphical interface.
1272 PDF Arranger was formerly known as PDF-Shuffler.")
1273 (license license:gpl3+)))
1275 (define-public pdfposter
1278 (version "0.7.post1")
1281 (uri (pypi-uri "pdftools.pdfposter" version))
1284 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
1285 (build-system python-build-system)
1287 `(#:tests? #f)) ; test-suite not included in source archive
1289 `(("python-pypdf2" ,python-pypdf2)))
1290 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1291 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1292 (description "@command{pdfposter} can be used to create a large poster by
1293 building it from multiple pages and/or printing it on large media. It expects
1294 as input a PDF file, normally printing on a single page. The output is again
1295 a PDF file, maybe containing multiple pages together building the poster. The
1296 input page will be scaled to obtain the desired size.
1298 This is much like @command{poster} does for Postscript files, but working with
1299 PDF. Since sometimes @command{poster} does not like your files converted from
1300 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1301 (license license:gpl3+)))
1303 (define-public pdfgrep
1310 (uri (string-append "https://pdfgrep.org/download/"
1311 name "-" version ".tar.gz"))
1314 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
1315 (build-system gnu-build-system)
1317 `(("pkg-config" ,pkg-config)))
1319 `(("libgcrypt" ,libgcrypt)
1321 ("poppler" ,poppler)))
1322 (home-page "https://pdfgrep.org")
1323 (synopsis "Command-line utility to search text in PDF files")
1325 "Pdfgrep searches in pdf files for strings matching a regular expression.
1326 Support some GNU grep options as file name output, page number output,
1327 optional case insensitivity, count occurrences, color highlights and search in
1329 (license license:gpl2+)))
1331 (define-public pdfpc
1339 (url "https://github.com/pdfpc/pdfpc")
1340 (commit (string-append "v" version))))
1341 (file-name (git-file-name name version))
1343 (base32 "11n925c5jj3yfwnqkgxzqrmsrpqh8ls1g4idmqqzpsanpam1xvna"))))
1344 (build-system cmake-build-system)
1345 (arguments '(#:tests? #f)) ; no test target
1349 ("gstreamer" ,gstreamer)
1350 ("gst-plugins-base" ,gst-plugins-base)
1352 ("poppler" ,poppler)
1356 `(("pkg-config" ,pkg-config)))
1357 (home-page "https://pdfpc.github.io/")
1358 (synopsis "Presenter console with multi-monitor support for PDF files")
1360 "pdfpc is a presentation viewer application which uses multi-monitor
1361 output to provide meta information to the speaker during the presentation. It
1362 is able to show a normal presentation window on one screen, while showing a
1363 more sophisticated overview on the other one providing information like a
1364 picture of the next slide, as well as the left over time till the end of the
1365 presentation. The input files processed by pdfpc are PDF documents.")
1366 (license license:gpl2+)))
1375 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1376 version "/paps-" version ".tar.gz"))
1378 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1379 (build-system gnu-build-system)
1381 `(("pango" ,pango)))
1383 `(("intltool" ,intltool)
1384 ("pkg-config" ,pkg-config)))
1385 (home-page "https://github.com/dov/paps")
1386 (synopsis "Pango to PostScript converter")
1388 "Paps reads a UTF-8 encoded file and generates a PostScript language
1389 rendering of the file through the Pango Cairo back end.")
1390 (license license:lgpl2.0+)))
1392 (define-public stapler
1399 (uri (pypi-uri "stapler" version))
1402 "0b2lbm3f79cdxcsagwhzihbzwahjabxqmbws0c8ki25gpdnygdd7"))))
1403 (build-system python-build-system)
1406 (modify-phases %standard-phases
1407 (add-after 'unpack 'fix-more-itertools-version-requirement
1409 ;; Tests require an version of the more-itertools module older
1410 ;; than the one we have packaged.
1411 (substitute* "setup.py"
1412 (("more-itertools>=2\\.2,<6\\.0\\.0") "more-itertools>=2.2"))
1415 `(("python-more-itertools" ,python-more-itertools)
1416 ("python-pypdf2" ,python-pypdf2)))
1417 (home-page "https://github.com/hellerbarde/stapler")
1418 (synopsis "PDF manipulation tool")
1419 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1420 manipulating PDF documents from the command line. It supports
1423 @item cherry-picking pages and concatenating them into a new file
1424 @item splitting a PDF document into single pages each in its own file
1425 @item merging PDF documents with their pages interleaved
1426 @item displaying metadata in a PDF document
1427 @item displaying the mapping between logical and physical page numbers
1429 (license license:bsd-3)))
1431 (define-public weasyprint
1439 (url "https://github.com/FelixSchwarz/WeasyPrint")
1440 (commit (string-append "v" version))))
1441 (file-name (git-file-name name version))
1444 "0rcj9yah3bp6bbvkmny3w4csx4l5v49lc7mrk29g0x77qnwswjy7"))))
1445 (build-system python-build-system)
1448 (modify-phases %standard-phases
1449 (add-after 'unpack 'patch-library-paths
1450 (lambda* (#:key inputs #:allow-other-keys)
1451 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1452 (glib (assoc-ref inputs "glib"))
1453 (pango (assoc-ref inputs "pango"))
1454 (pangoft2 (assoc-ref inputs "pangoft2")))
1455 (substitute* "weasyprint/fonts.py"
1457 (format #f "'~a/lib/libfontconfig.so'" fontconfig))
1459 (format #f "'~a/lib/libpangoft2-1.0.so'" pango)))
1460 (substitute* "weasyprint/text.py"
1462 (format #f "'~a/lib/libgobject-2.0.so'" glib))
1464 (format #f "'~a/lib/libpango-1.0.so'" pango))
1465 (("'pangocairo-1.0'")
1466 (format #f "'~a/lib/libpangocairo-1.0.so'" pango)))
1468 (add-after 'unpack 'disable-linters
1469 ;; Their check fails; none of our business.
1471 (substitute* "setup.cfg"
1472 ((".*pytest-flake8.*") "")
1473 ((".*pytest-isort.*") "")
1477 (add-before 'check 'register-dejavu-font
1478 (lambda* (#:key inputs #:allow-other-keys)
1479 ;; TODO: fix FreeType so that fonts found in XDG_DATA_DIRS are
1481 (let* ((HOME "/tmp")
1482 (dejavu (assoc-ref inputs "font-dejavu"))
1483 (fonts-dir (string-append HOME "/.fonts")))
1484 (setenv "HOME" HOME)
1486 (symlink (string-append dejavu "/share/fonts/truetype")
1487 (string-append fonts-dir "/truetype"))
1488 (invoke "fc-cache" "-rv")))))))
1490 `(("fontconfig" ,fontconfig)
1494 `(("gdk-pixbuf" ,gdk-pixbuf)
1495 ("python-cairocffi" ,python-cairocffi)
1496 ("python-cairosvg" ,python-cairosvg)
1497 ("python-cffi" ,python-cffi)
1498 ("python-cssselect2" ,python-cssselect2)
1499 ("python-html5lib" ,python-html5lib)
1500 ("python-pyphen" ,python-pyphen)
1501 ("python-tinycss2" ,python-tinycss2)))
1503 `(("font-dejavu" ,font-dejavu) ;tests depend on it
1504 ("python-pytest-cov" ,python-pytest-cov)
1505 ("python-pytest-runner" ,python-pytest-runner)))
1506 (home-page "https://weasyprint.org/")
1507 (synopsis "Document factory for creating PDF files from HTML")
1508 (description "WeasyPrint helps web developers to create PDF documents. It
1509 turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1512 From a technical point of view, WeasyPrint is a visual rendering engine for
1513 HTML and CSS that can export to PDF and PNG. It aims to support web standards
1516 It is based on various libraries but not on a full rendering engine like
1517 WebKit or Gecko. The CSS layout engine is written in Python, designed for
1518 pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1521 Keywords: html2pdf, htmltopdf")
1522 (license license:bsd-3)))