gnu: Replace uses of 'libjpeg' with 'libjpeg-turbo'.
[jackhill/guix/guix.git] / gnu / packages / pdf.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2014, 2015, 2016, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
6 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2016 ng0 <ng0@n0.is>
8 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
11 ;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
12 ;;; Copyright © 2016, 2019 Arun Isaac <arunisaac@systemreboot.net>
13 ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
14 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
15 ;;; Copyright © 2017, 2018 Rene Saavedra <pacoon@protonmail.com>
16 ;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
17 ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
18 ;;; Copyright © 2019 Ben Sturmfels <ben@sturm.com.au>
19 ;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
20 ;;;
21 ;;; This file is part of GNU Guix.
22 ;;;
23 ;;; GNU Guix is free software; you can redistribute it and/or modify it
24 ;;; under the terms of the GNU General Public License as published by
25 ;;; the Free Software Foundation; either version 3 of the License, or (at
26 ;;; your option) any later version.
27 ;;;
28 ;;; GNU Guix is distributed in the hope that it will be useful, but
29 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31 ;;; GNU General Public License for more details.
32 ;;;
33 ;;; You should have received a copy of the GNU General Public License
34 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35
36 (define-module (gnu packages pdf)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (guix packages)
39 #:use-module (guix download)
40 #:use-module (guix git-download)
41 #:use-module (guix utils)
42 #:use-module (guix build-system gnu)
43 #:use-module (guix build-system cmake)
44 #:use-module (guix build-system meson)
45 #:use-module (guix build-system python)
46 #:use-module (guix build-system trivial)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages backup)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages bash)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages curl)
55 #:use-module (gnu packages djvu)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages game-development)
58 #:use-module (gnu packages gettext)
59 #:use-module (gnu packages ghostscript)
60 #:use-module (gnu packages gl)
61 #:use-module (gnu packages glib)
62 #:use-module (gnu packages gnome)
63 #:use-module (gnu packages gnupg)
64 #:use-module (gnu packages gstreamer)
65 #:use-module (gnu packages gtk)
66 #:use-module (gnu packages image)
67 #:use-module (gnu packages imagemagick)
68 #:use-module (gnu packages javascript)
69 #:use-module (gnu packages lesstif)
70 #:use-module (gnu packages libffi)
71 #:use-module (gnu packages linux)
72 #:use-module (gnu packages lua)
73 #:use-module (gnu packages pcre)
74 #:use-module (gnu packages perl)
75 #:use-module (gnu packages photo)
76 #:use-module (gnu packages pkg-config)
77 #:use-module (gnu packages python)
78 #:use-module (gnu packages python-check)
79 #:use-module (gnu packages python-web)
80 #:use-module (gnu packages python-xyz)
81 #:use-module (gnu packages qt)
82 #:use-module (gnu packages sdl)
83 #:use-module (gnu packages sphinx)
84 #:use-module (gnu packages sqlite)
85 #:use-module (gnu packages tls)
86 #:use-module (gnu packages xdisorg)
87 #:use-module (gnu packages xorg)
88 #:use-module (srfi srfi-1))
89
90 (define-public poppler
91 (package
92 (name "poppler")
93 (version "0.84.0")
94 (source (origin
95 (method url-fetch)
96 (uri (string-append "https://poppler.freedesktop.org/poppler-"
97 version ".tar.xz"))
98 (sha256
99 (base32
100 "0ccp2gx05cz5y04k5pgbyi4ikyq60nafa7x2yx4aaf1vfkd318f7"))))
101 (build-system cmake-build-system)
102 ;; FIXME:
103 ;; use libcurl: no
104 (inputs `(("fontconfig" ,fontconfig)
105 ("freetype" ,freetype)
106 ("libjpeg" ,libjpeg-turbo)
107 ("libpng" ,libpng)
108 ("libtiff" ,libtiff)
109 ("lcms" ,lcms)
110 ("openjpeg" ,openjpeg)
111 ("zlib" ,zlib)
112
113 ;; To build poppler-glib (as needed by Evince), we need Cairo and
114 ;; GLib. But of course, that Cairo must not depend on Poppler.
115 ("cairo" ,(package (inherit cairo)
116 (inputs (alist-delete "poppler"
117 (package-inputs cairo)))))))
118 (propagated-inputs
119 ;; As per poppler-cairo and poppler-glib.pc.
120 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
121 ;; different solution to the circular dependency mentioned above.
122 `(("glib" ,glib)))
123 (native-inputs
124 `(("pkg-config" ,pkg-config)
125 ("glib" ,glib "bin") ; glib-mkenums, etc.
126 ("gobject-introspection" ,gobject-introspection)))
127 (arguments
128 `(#:tests? #f ; no test data provided with the tarball
129 #:configure-flags
130 (let* ((out (assoc-ref %outputs "out"))
131 (lib (string-append out "/lib")))
132 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
133 "-DENABLE_ZLIB=ON"
134 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
135 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
136 (synopsis "PDF rendering library")
137 (description
138 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
139 (license license:gpl2+)
140 (home-page "https://poppler.freedesktop.org/")))
141
142 (define-public poppler-data
143 (package
144 (name "poppler-data")
145 (version "0.4.9")
146 (source (origin
147 (method url-fetch)
148 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
149 "-" version ".tar.gz"))
150 (sha256
151 (base32
152 "04i0wgdkn5lhda8cyxd1ll4a2p41pwqrwd47n9mdpl7cx5ypx70z"))))
153 (build-system gnu-build-system)
154 (arguments
155 '(#:tests? #f ; no test suite
156 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
157 #:phases
158 (modify-phases %standard-phases
159 ;; The package only provides some data files, so there is nothing to
160 ;; build.
161 (delete 'configure)
162 (delete 'build))))
163 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
164 (description "This package provides optional encoding files for Poppler.
165 When present, Poppler is able to correctly render CJK and Cyrillic text.")
166 (home-page (package-home-page poppler))
167 ;; See COPYING in the source distribution for more information about
168 ;; the licensing.
169 (license (list license:bsd-3
170 license:gpl2))))
171
172 (define-public poppler-qt4
173 (package/inherit poppler
174 (name "poppler-qt4")
175 (inputs `(("qt-4" ,qt-4)
176 ,@(package-inputs poppler)))
177 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
178
179 (define-public poppler-qt5
180 (package/inherit poppler
181 (name "poppler-qt5")
182 (inputs `(("qtbase" ,qtbase)
183 ,@(package-inputs poppler)))
184 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
185
186 (define-public python-poppler-qt5
187 (package
188 (name "python-poppler-qt5")
189 (version "0.24.2")
190 (source
191 (origin
192 (method url-fetch)
193 (uri (pypi-uri "python-poppler-qt5" version))
194 (sha256
195 (base32
196 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
197 (build-system python-build-system)
198 (arguments
199 `(;; There are no tests. The check phase just causes a rebuild.
200 #:tests? #f
201 #:phases
202 (modify-phases %standard-phases
203 (replace 'build
204 (lambda* (#:key inputs #:allow-other-keys)
205 (substitute* "setup.py"
206 ;; This check always fails, so disable it.
207 (("if not check_qtxml\\(\\)")
208 "if True"))
209 ;; We need to pass an extra flag here. This cannot be in
210 ;; configure-flags because it should not be passed for the
211 ;; installation phase.
212 ((@@ (guix build python-build-system) call-setuppy)
213 "build_ext" (list (string-append "--pyqt-sip-dir="
214 (assoc-ref inputs "python-pyqt")
215 "/share/sip")) #t))))))
216 (native-inputs
217 `(("pkg-config" ,pkg-config)))
218 (inputs
219 `(("python-sip" ,python-sip)
220 ("python-pyqt" ,python-pyqt)
221 ("poppler-qt5" ,poppler-qt5)
222 ("qtbase" ,qtbase)))
223 (home-page "https://pypi.python.org/pypi/python-poppler-qt5")
224 (synopsis "Python bindings for Poppler-Qt5")
225 (description
226 "This package provides Python bindings for the Qt5 interface of the
227 Poppler PDF rendering library.")
228 (license license:lgpl2.1+)))
229
230 (define-public libharu
231 (package
232 (name "libharu")
233 (version "2.3.0")
234 (source (origin
235 (method git-fetch)
236 (uri (git-reference
237 (url "https://github.com/libharu/libharu.git")
238 (commit (string-append
239 "RELEASE_"
240 (string-join (string-split version #\.) "_")))))
241 (file-name (git-file-name name version))
242 (sha256
243 (base32
244 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
245 (build-system gnu-build-system)
246 (arguments
247 `(#:configure-flags
248 (list (string-append "--with-zlib="
249 (assoc-ref %build-inputs "zlib"))
250 (string-append "--with-png="
251 (assoc-ref %build-inputs "libpng")))))
252 (inputs
253 `(("zlib" ,zlib)
254 ("libpng" ,libpng)))
255 (native-inputs
256 `(("autoconf" ,autoconf)
257 ("automake" ,automake)
258 ("libtool" ,libtool)))
259 (home-page "http://libharu.org/")
260 (synopsis "Library for generating PDF files")
261 (description
262 "libHaru is a library for generating PDF files. libHaru does not support
263 reading and editing of existing PDF files.")
264 (license license:zlib)))
265
266 (define-public xpdf
267 (package
268 (name "xpdf")
269 (version "3.04")
270 (source (origin
271 (method url-fetch)
272 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
273 version ".tar.gz"))
274 (sha256 (base32
275 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
276 (build-system gnu-build-system)
277 (inputs `(("freetype" ,freetype)
278 ("gs-fonts" ,gs-fonts)
279 ("lesstif" ,lesstif)
280 ("libpaper" ,libpaper)
281 ("libx11" ,libx11)
282 ("libxext" ,libxext)
283 ("libxp" ,libxp)
284 ("libxpm" ,libxpm)
285 ("libxt" ,libxt)
286 ("libpng" ,libpng)
287 ("zlib" ,zlib)))
288 (arguments
289 `(#:tests? #f ; there is no check target
290 #:parallel-build? #f ; build fails randomly on 8-way machines
291 #:configure-flags
292 (list (string-append "--with-freetype2-includes="
293 (assoc-ref %build-inputs "freetype")
294 "/include/freetype2"))
295 #:phases
296 (modify-phases %standard-phases
297 (replace 'install
298 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
299 (let* ((install (assoc-ref %standard-phases 'install))
300 (out (assoc-ref outputs "out"))
301 (xpdfrc (string-append out "/etc/xpdfrc"))
302 (gs-fonts (assoc-ref inputs "gs-fonts")))
303 (apply install args)
304 (substitute* xpdfrc
305 (("/usr/local/share/ghostscript/fonts")
306 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
307 (("#fontFile") "fontFile")))
308 #t)))))
309 (synopsis "Viewer for PDF files based on the Motif toolkit")
310 (description
311 "Xpdf is a viewer for Portable Document Format (PDF) files.")
312 (license license:gpl3) ; or gpl2, but not gpl2+
313 (home-page "http://www.foolabs.com/xpdf/")))
314
315 (define-public zathura-cb
316 (package
317 (name "zathura-cb")
318 (version "0.1.8")
319 (source (origin
320 (method url-fetch)
321 (uri
322 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
323 version ".tar.xz"))
324 (sha256
325 (base32
326 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
327 (native-inputs `(("pkg-config" ,pkg-config)))
328 (inputs `(("libarchive" ,libarchive)
329 ("zathura" ,zathura)))
330 (build-system meson-build-system)
331 (arguments
332 `(#:tests? #f ; package does not contain tests
333 #:phases
334 (modify-phases %standard-phases
335 (add-after 'unpack 'patch-plugin-directory
336 ;; Something of a regression in 0.1.8: the new Meson build system
337 ;; now hard-codes an incorrect plugin directory. Fix it.
338 (lambda* (#:key outputs #:allow-other-keys)
339 (substitute* "meson.build"
340 (("(install_dir:).*" _ key)
341 (string-append key
342 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
343 #t)))))
344 (home-page "https://pwmt.org/projects/zathura-cb/")
345 (synopsis "Comic book support for zathura (libarchive backend)")
346 (description "The zathura-cb plugin adds comic book support to zathura
347 using libarchive.")
348 (license license:zlib)))
349
350 (define-public zathura-ps
351 (package
352 (name "zathura-ps")
353 (version "0.2.6")
354 (source (origin
355 (method url-fetch)
356 (uri
357 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
358 version ".tar.xz"))
359 (sha256
360 (base32
361 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
362 (native-inputs `(("pkg-config" ,pkg-config)))
363 (inputs `(("libspectre" ,libspectre)
364 ("zathura" ,zathura)))
365 (build-system meson-build-system)
366 (arguments
367 `(#:tests? #f ; package does not contain tests
368 #:phases
369 (modify-phases %standard-phases
370 (add-after 'unpack 'patch-plugin-directory
371 ;; Something of a regression in 0.2.6: the new Meson build system
372 ;; now hard-codes an incorrect plugin directory. Fix it.
373 (lambda* (#:key outputs #:allow-other-keys)
374 (substitute* "meson.build"
375 (("(install_dir:).*" _ key)
376 (string-append key
377 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
378 #t)))))
379 (home-page "https://pwmt.org/projects/zathura-ps/")
380 (synopsis "PS support for zathura (libspectre backend)")
381 (description "The zathura-ps plugin adds PS support to zathura
382 using libspectre.")
383 (license license:zlib)))
384
385 (define-public zathura-djvu
386 (package
387 (name "zathura-djvu")
388 (version "0.2.8")
389 (source (origin
390 (method url-fetch)
391 (uri
392 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
393 version ".tar.xz"))
394 (sha256
395 (base32
396 "0axkv1crdxn0z44whaqp2ibkdqcykhjnxk7qzms0dp1b67an9rnh"))))
397 (native-inputs `(("pkg-config" ,pkg-config)))
398 (inputs
399 `(("djvulibre" ,djvulibre)
400 ("zathura" ,zathura)))
401 (build-system meson-build-system)
402 (arguments
403 `(#:tests? #f ; package does not contain tests
404 #:phases
405 (modify-phases %standard-phases
406 (add-after 'unpack 'patch-plugin-directory
407 ;; Something of a regression in 0.2.8: the new Meson build system
408 ;; now hard-codes an incorrect plugin directory. Fix it.
409 (lambda* (#:key outputs #:allow-other-keys)
410 (substitute* "meson.build"
411 (("(install_dir:).*" _ key)
412 (string-append key
413 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
414 #t)))))
415 (home-page "https://pwmt.org/projects/zathura-djvu/")
416 (synopsis "DjVu support for zathura (DjVuLibre backend)")
417 (description "The zathura-djvu plugin adds DjVu support to zathura
418 using the DjVuLibre library.")
419 (license license:zlib)))
420
421 (define-public zathura-pdf-mupdf
422 (package
423 (name "zathura-pdf-mupdf")
424 (version "0.3.5")
425 (source (origin
426 (method url-fetch)
427 (uri
428 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
429 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
430 (sha256
431 (base32
432 "1pjwsb7zwclxsvz229fl7y2saf1pv3ifwv3ay8viqxgrp9x3z9hq"))))
433 (native-inputs `(("pkg-config" ,pkg-config)))
434 (inputs
435 `(("jbig2dec" ,jbig2dec)
436 ("libjpeg" ,libjpeg-turbo)
437 ("mujs" ,mujs)
438 ("mupdf" ,mupdf)
439 ("openjpeg" ,openjpeg)
440 ("openssl" ,openssl)
441 ("zathura" ,zathura)))
442 (build-system meson-build-system)
443 (arguments
444 `(#:tests? #f ; package does not contain tests
445 #:configure-flags (list (string-append "-Dplugindir="
446 (assoc-ref %outputs "out")
447 "/lib/zathura")
448 "-Dlink-external=true")
449 #:phases
450 (modify-phases %standard-phases
451 (add-before 'configure 'add-mujs-to-dependencies
452 (lambda _
453 ;; Add mujs to the 'build_dependencies'.
454 (substitute* "meson.build"
455 (("^ libopenjp2 = dependency.*" x)
456 (string-append x " mujs = cc.find_library('mujs')\n"))
457 (("^ libopenjp2")
458 " libopenjp2, mujs")))))))
459 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
460 (synopsis "PDF support for zathura (mupdf backend)")
461 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
462 by using the @code{mupdf} rendering library.")
463 (license license:zlib)))
464
465 (define-public zathura-pdf-poppler
466 (package
467 (name "zathura-pdf-poppler")
468 (version "0.2.9")
469 (source (origin
470 (method url-fetch)
471 (uri
472 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
473 version ".tar.xz"))
474 (sha256
475 (base32
476 "1p4jcny0jniygns78mcf0nlm298dszh49qpmjmackrm6dq8hc25y"))))
477 (native-inputs `(("pkg-config" ,pkg-config)))
478 (inputs
479 `(("poppler" ,poppler)
480 ("zathura" ,zathura)))
481 (build-system meson-build-system)
482 (arguments
483 `(#:tests? #f ; package does not include tests
484 #:phases
485 (modify-phases %standard-phases
486 (add-after 'unpack 'patch-plugin-directory
487 ;; Something of a regression in 0.2.9: the new Meson build system
488 ;; now hard-codes an incorrect plugin directory. Fix it.
489 (lambda* (#:key outputs #:allow-other-keys)
490 (substitute* "meson.build"
491 (("(install_dir:).*" _ key)
492 (string-append key
493 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
494 #t)))))
495 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
496 (synopsis "PDF support for zathura (poppler backend)")
497 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
498 by using the poppler rendering engine.")
499 (license license:zlib)))
500
501 (define-public zathura
502 (package
503 (name "zathura")
504 (version "0.4.3")
505 (source (origin
506 (method url-fetch)
507 (uri
508 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
509 version ".tar.xz"))
510 (sha256
511 (base32
512 "0hgx5x09i6d0z45llzdmh4l348fxh1y102sb1w76f2fp4r21j4ky"))))
513 (native-inputs `(("pkg-config" ,pkg-config)
514 ("gettext" ,gettext-minimal)
515 ("glib:bin" ,glib "bin")
516
517 ;; For building documentation.
518 ("python-sphinx" ,python-sphinx)
519
520 ;; For building icons.
521 ("librsvg" ,librsvg)
522
523 ;; For tests.
524 ("check" ,check)
525 ("xorg-server" ,xorg-server-for-tests)))
526 (inputs `(("sqlite" ,sqlite)))
527 ;; Listed in 'Requires.private' of 'zathura.pc'.
528 (propagated-inputs `(("cairo" ,cairo)
529 ("girara" ,girara)))
530 (native-search-paths
531 (list (search-path-specification
532 (variable "ZATHURA_PLUGINS_PATH")
533 (files '("lib/zathura")))))
534 (build-system meson-build-system)
535 (arguments
536 `(#:phases (modify-phases %standard-phases
537 (add-before 'check 'start-xserver
538 ;; Tests require a running X server.
539 (lambda* (#:key inputs #:allow-other-keys)
540 (let ((xorg-server (assoc-ref inputs "xorg-server"))
541 (display ":1"))
542 (setenv "DISPLAY" display)
543
544 ;; On busy machines, tests may take longer than
545 ;; the default of four seconds.
546 (setenv "CK_DEFAULT_TIMEOUT" "20")
547
548 ;; Don't fail due to missing '/etc/machine-id'.
549 (setenv "DBUS_FATAL_WARNINGS" "0")
550 (zero? (system (string-append xorg-server "/bin/Xvfb "
551 display " &")))))))))
552 (home-page "https://pwmt.org/projects/zathura/")
553 (synopsis "Lightweight keyboard-driven PDF viewer")
554 (description "Zathura is a customizable document viewer. It provides a
555 minimalistic interface and an interface that mainly focuses on keyboard
556 interaction.")
557 (license license:zlib)))
558
559 (define-public podofo
560 (package
561 (name "podofo")
562 (version "0.9.6")
563 (source (origin
564 (method url-fetch)
565 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
566 "/podofo-" version ".tar.gz"))
567 (sha256
568 (base32
569 "0wj0y4zcmj4q79wrn3vv3xq4bb0vhhxs8yifafwy9f2sjm83c5p9"))
570 (patches (search-patches "podofo-cmake-3.12.patch"))))
571 (build-system cmake-build-system)
572 (native-inputs
573 `(("cppunit" ,cppunit)
574 ("pkg-config" ,pkg-config)))
575 (inputs
576 `(("libjpeg" ,libjpeg-turbo)
577 ("libtiff" ,libtiff)
578 ("fontconfig" ,fontconfig)
579 ("freetype" ,freetype)
580 ("libpng" ,libpng)
581 ("lua" ,lua-5.1)
582 ("openssl" ,openssl)
583 ("zlib" ,zlib)))
584 (arguments
585 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
586 "-DPODOFO_BUILD_STATIC=ON")
587 #:phases
588 (modify-phases %standard-phases
589 (add-before 'configure 'patch
590 (lambda* (#:key inputs #:allow-other-keys)
591 (let ((freetype (assoc-ref inputs "freetype")))
592 ;; Look for freetype include files in the correct place.
593 (substitute* "cmake/modules/FindFREETYPE.cmake"
594 (("/usr/local") freetype)))
595 #t)))))
596 (home-page "http://podofo.sourceforge.net")
597 (synopsis "Tools to work with the PDF file format")
598 (description
599 "PoDoFo is a C++ library and set of command-line tools to work with the
600 PDF file format. It can parse PDF files and load them into memory, and makes
601 it easy to modify them and write the changes to disk. It is primarily useful
602 for applications that wish to do lower level manipulation of PDF, such as
603 extracting content or merging files.")
604 (license license:lgpl2.0+)))
605
606 (define-public mupdf
607 (package
608 (name "mupdf")
609 (version "1.16.1")
610 (source
611 (origin
612 (method url-fetch)
613 (uri (string-append "https://mupdf.com/downloads/archive/"
614 name "-" version "-source.tar.xz"))
615 (sha256
616 (base32
617 "1npmy92lkj41nnc14b4fpq7z62pminy94zsdbrczj22jpn283rvg"))
618 (modules '((guix build utils)))
619 (snippet
620 ;; We keep lcms2 since it is different than our lcms.
621 '(begin
622 (for-each
623 (lambda (dir)
624 (delete-file-recursively (string-append "thirdparty/" dir)))
625 '("freeglut" "freetype" "harfbuzz" "jbig2dec"
626 "libjpeg" "mujs" "openjpeg" "zlib"))
627 #t))))
628 (build-system gnu-build-system)
629 (inputs
630 `(("curl" ,curl)
631 ("freeglut" ,freeglut)
632 ("freetype" ,freetype)
633 ("harfbuzz" ,harfbuzz)
634 ("jbig2dec" ,jbig2dec)
635 ("libjpeg" ,libjpeg-turbo)
636 ("libx11" ,libx11)
637 ("libxext" ,libxext)
638 ("mujs" ,mujs)
639 ("openjpeg" ,openjpeg)
640 ("openssl" ,openssl)
641 ("zlib" ,zlib)))
642 (native-inputs
643 `(("pkg-config" ,pkg-config)))
644 (arguments
645 '(#:tests? #f ; no check target
646 #:make-flags (list "CC=gcc"
647 "XCFLAGS=-fpic"
648 "USE_SYSTEM_LIBS=yes"
649 "USE_SYSTEM_MUJS=yes"
650 (string-append "prefix=" (assoc-ref %outputs "out")))
651 #:phases (modify-phases %standard-phases
652 (delete 'configure))))
653 (home-page "https://mupdf.com")
654 (synopsis "Lightweight PDF viewer and toolkit")
655 (description
656 "MuPDF is a C library that implements a PDF and XPS parsing and
657 rendering engine. It is used primarily to render pages into bitmaps,
658 but also provides support for other operations such as searching and
659 listing the table of contents and hyperlinks.
660
661 The library ships with a rudimentary X11 viewer, and a set of command
662 line tools for batch rendering @command{pdfdraw}, rewriting files
663 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
664 (license (list license:agpl3+
665 license:bsd-3 ; resources/cmaps
666 license:x11 ; thirdparty/lcms2
667 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
668 license:asl2.0)))) ; resources/fonts/droid
669
670 (define-public qpdf
671 (package
672 (name "qpdf")
673 (version "9.1.0")
674 (source (origin
675 (method url-fetch)
676 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
677 "/qpdf-" version ".tar.gz"))
678 (sha256
679 (base32
680 "0ygd80wxcmh613n04x2kmf8wlsl0drxyd5wwdcrm1rzj0xwvpfrs"))
681 (modules '((guix build utils)))
682 (snippet
683 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
684 ;; dependency on Perl.
685 '(begin
686 (substitute* "qpdf/fix-qdf"
687 (("#!/usr/bin/env perl")
688 "\
689 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
690 & eval 'exec perl -wS \"$0\" $argv:q'
691 if 0;\n"))
692 #t))))
693 (build-system gnu-build-system)
694 (arguments
695 `(#:disallowed-references (,perl)
696 #:phases
697 (modify-phases %standard-phases
698 (add-before 'configure 'patch-paths
699 (lambda _
700 (substitute* "make/libtool.mk"
701 (("SHELL=/bin/bash")
702 (string-append "SHELL=" (which "bash"))))
703 (substitute* (append
704 '("qtest/bin/qtest-driver")
705 (find-files "." "\\.test"))
706 (("/usr/bin/env") (which "env")))
707 #t)))))
708 (native-inputs
709 `(("pkg-config" ,pkg-config)
710 ("perl" ,perl)))
711 (propagated-inputs
712 ;; In Requires.private of libqpdf.pc.
713 `(("libjpeg-turbo" ,libjpeg-turbo)
714 ("zlib" ,zlib)))
715 (synopsis "Command-line tools and library for transforming PDF files")
716 (description
717 "QPDF is a command-line program that does structural, content-preserving
718 transformations on PDF files. It could have been called something like
719 pdf-to-pdf. It includes support for merging and splitting PDFs and to
720 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
721 program capable of converting PDF into other formats.")
722 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
723 ;; Users can still choose to use the old license at their option.
724 (license (list license:asl2.0 license:clarified-artistic))
725 (home-page "http://qpdf.sourceforge.net/")))
726
727 (define-public xournal
728 (package
729 (name "xournal")
730 (version "0.4.8.2016")
731 (source
732 (origin
733 (method url-fetch)
734 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
735 "/xournal-" version ".tar.gz"))
736 (sha256
737 (base32
738 "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
739 (build-system gnu-build-system)
740 (inputs
741 `(("gtk" ,gtk+-2)
742 ("pango" ,pango)
743 ("poppler" ,poppler)
744 ("glib" ,glib)
745 ("libgnomecanvas" ,libgnomecanvas)))
746 (native-inputs
747 `(("pkg-config" ,pkg-config)))
748 (home-page "http://xournal.sourceforge.net/")
749 (synopsis "Notetaking using a stylus")
750 (description
751 "Xournal is an application for notetaking, sketching, keeping a journal
752 using a stylus.")
753 (license license:gpl2+)))
754
755 (define-public python-reportlab
756 (package
757 (name "python-reportlab")
758 (version "3.5.32")
759 (source (origin
760 (method url-fetch)
761 (uri (pypi-uri "reportlab" version))
762 (sha256
763 (base32
764 "0lf8hil9nbm74zl27l8rydxbhwnpr0pbghibsqrc9sglds9l9vw3"))))
765 (build-system python-build-system)
766 (arguments
767 '(;; FIXME: There is one test failure, but it does not cause the
768 ;; build to fail. No time to investigate right now.
769 #:test-target "tests"))
770 (inputs
771 `(("freetype" ,freetype)))
772 (propagated-inputs
773 `(("python-pillow" ,python-pillow)))
774 (home-page "https://www.reportlab.com")
775 (synopsis "Python library for generating PDFs and graphics")
776 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
777 of rich PDF documents, and also creation of charts in a variety of bitmap and
778 vector formats.")
779 (license license:bsd-3)))
780
781 (define-public python2-reportlab
782 (package-with-python2 python-reportlab))
783
784 (define-public impressive
785 (package
786 (name "impressive")
787 (version "0.12.1")
788 (source (origin
789 (method url-fetch)
790 (uri (string-append
791 "mirror://sourceforge/impressive/Impressive/"
792 version "/Impressive-" version ".tar.gz"))
793 (sha256
794 (base32
795 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
796 (build-system python-build-system)
797
798 ;; TODO: Add dependency on pdftk.
799 (inputs `(("python2-pygame" ,python2-pygame)
800 ("python2-pillow" ,python2-pillow)
801 ("sdl" ,sdl)
802 ("xpdf" ,xpdf)))
803
804 (arguments
805 `(#:python ,python-2
806 #:phases (modify-phases %standard-phases
807 (delete 'build)
808 (delete 'configure)
809 (delete 'check)
810 (replace 'install
811 (lambda* (#:key inputs outputs #:allow-other-keys)
812 ;; There's no 'setup.py' so install things manually.
813 (let* ((out (assoc-ref outputs "out"))
814 (bin (string-append out "/bin"))
815 (man1 (string-append out "/share/man/man1"))
816 (sdl (assoc-ref inputs "sdl"))
817 (xpdf (assoc-ref inputs "xpdf")))
818 (mkdir-p bin)
819 (copy-file "impressive.py"
820 (string-append bin "/impressive"))
821 (wrap-program (string-append bin "/impressive")
822 `("LIBRARY_PATH" ":" prefix ;for ctypes
823 (,(string-append sdl "/lib")))
824 `("PATH" ":" prefix ;for pdftoppm
825 (,(string-append xpdf "/bin"))))
826 (install-file "impressive.1" man1)
827 #t))))))
828 (home-page "http://impressive.sourceforge.net")
829 (synopsis "PDF presentation tool with visual effects")
830 (description
831 "Impressive is a tool to display PDF files that provides visual effects
832 such as smooth alpha-blended slide transitions. It provides additional tools
833 such as zooming, highlighting an area of the screen, and a tool to navigate
834 the PDF pages.")
835 (license license:gpl2)))
836
837 (define-public fbida
838 (package
839 (name "fbida")
840 (version "2.14")
841 (home-page "https://www.kraxel.org/blog/linux/fbida/")
842 (source (origin
843 (method url-fetch)
844 (uri (string-append "https://www.kraxel.org/releases/fbida/"
845 "fbida-" version ".tar.gz"))
846 (sha256
847 (base32
848 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
849 (build-system gnu-build-system)
850 (arguments
851 '(#:phases
852 (modify-phases %standard-phases
853 (add-after 'unpack 'patch-FHS-file-names
854 (lambda _
855 (substitute* "mk/Autoconf.mk"
856 (("/bin/echo") "echo")
857 (("/sbin/ldconfig -p") "echo lib")) #t))
858 (delete 'configure))
859 #:tests? #f
860 #:make-flags (list "CC=gcc"
861 (string-append "prefix=" (assoc-ref %outputs "out")))))
862 (inputs `(("libjpeg" ,libjpeg-turbo)
863 ("curl" ,curl)
864 ("libtiff" ,libtiff)
865 ("libudev" ,eudev)
866 ("libwebp" ,libwebp)
867 ("libdrm" ,libdrm)
868 ("imagemagick" ,imagemagick)
869 ("giflib" ,giflib)
870 ("glib" ,glib)
871 ("cairo-xcb" ,cairo-xcb)
872 ("freetype" ,freetype)
873 ("fontconfig" ,fontconfig)
874 ("libexif" ,libexif)
875 ("mesa" ,mesa)
876 ("libepoxy" ,libepoxy)
877 ("libpng" ,libpng)
878 ("poppler" ,poppler)))
879 (native-inputs `(("pkg-config" ,pkg-config)))
880 (synopsis "Framebuffer and drm-based image viewer")
881 (description
882 "fbida contains a few applications for viewing and editing images on
883 the framebuffer.")
884
885 (license license:gpl2+)))
886
887 (define-public pdf2svg
888 (package
889 (name "pdf2svg")
890 (version "0.2.3")
891 (source (origin
892 (method git-fetch)
893 (uri (git-reference
894 (url "https://github.com/dawbarton/pdf2svg.git")
895 (commit (string-append "v" version))))
896 (file-name (git-file-name name version))
897 (sha256
898 (base32
899 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
900 (build-system gnu-build-system)
901 (inputs
902 `(("cairo" ,cairo)
903 ("poppler" ,poppler)))
904 (native-inputs
905 `(("pkg-config" ,pkg-config)))
906 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
907 (synopsis "PDF to SVG converter")
908 (description "@command{pdf2svg} is a simple command-line PDF to SVG
909 converter using the Poppler and Cairo libraries.")
910 (license license:gpl2+)))
911
912 (define-public python-pypdf2
913 (package
914 (name "python-pypdf2")
915 (version "1.26.0")
916 (source (origin
917 (method url-fetch)
918 (uri (pypi-uri "PyPDF2" version))
919 (sha256
920 (base32
921 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
922 (build-system python-build-system)
923 (arguments
924 `(#:phases
925 (modify-phases %standard-phases
926 (add-after
927 'unpack 'patch-test-suite
928 (lambda _
929 ;; The text-file needs to be opened in binary mode for Python 3,
930 ;; so patch in the "b"
931 (substitute* "Tests/tests.py"
932 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
933 (string-append line "b")))
934 #t))
935 (replace 'check
936 (lambda _
937 (invoke "python" "-m" "unittest" "Tests.tests"))))))
938 (home-page "http://mstamy2.github.com/PyPDF2")
939 (synopsis "Pure Python PDF toolkit")
940 (description "PyPDF2 is a pure Python PDF library capable of:
941
942 @enumerate
943 @item extracting document information (title, author, …)
944 @item splitting documents page by page
945 @item merging documents page by page
946 @item cropping pages
947 @item merging multiple pages into a single page
948 @item encrypting and decrypting PDF files
949 @end enumerate
950
951 By being pure Python, it should run on any Python platform without any
952 dependencies on external libraries. It can also work entirely on
953 @code{StringIO} objects rather than file streams, allowing for PDF
954 manipulation in memory. It is therefore a useful tool for websites that
955 manage or manipulate PDFs.")
956 (license license:bsd-3)))
957
958 (define-public python2-pypdf2
959 (package-with-python2 python-pypdf2))
960
961 (define-public python2-pypdf
962 (package
963 (name "python2-pypdf")
964 (version "1.13")
965 (source (origin
966 (method url-fetch)
967 (uri (pypi-uri "pyPdf" version))
968 (sha256
969 (base32
970 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
971 (build-system python-build-system)
972 (arguments
973 `(#:tests? #f ; no tests
974 #:python ,python-2))
975 (home-page "http://pybrary.net/pyPdf/")
976 (synopsis "Pure Python PDF toolkit")
977 (description "PyPDF2 is a pure Python PDF toolkit.
978
979 Note: This module isn't maintained anymore. For new projects please use
980 python-pypdf2 instead.")
981 (license license:bsd-3)))
982
983 (define-public pdfarranger
984 (package
985 (name "pdfarranger")
986 (version "1.3.1")
987 (source
988 (origin
989 (method git-fetch)
990 (uri (git-reference
991 (url "https://github.com/jeromerobert/pdfarranger.git")
992 (commit version)))
993 (file-name (git-file-name name version))
994 (sha256
995 (base32 "1f8m8r81322i97wkqpmf7a4kiwnq244n6cnbldh03jc49vwq2kxx"))))
996 (build-system python-build-system)
997 (arguments
998 '(#:tests? #f ;no tests
999 #:phases (modify-phases %standard-phases
1000 (add-after 'install 'wrap-for-typelib
1001 (lambda* (#:key inputs outputs #:allow-other-keys)
1002 (let* ((out (assoc-ref outputs "out"))
1003 (program (string-append out "/bin/pdfarranger")))
1004 (wrap-program program
1005 `("GI_TYPELIB_PATH" ":" prefix
1006 (,(getenv "GI_TYPELIB_PATH"))))
1007 #t))))))
1008 (native-inputs
1009 `(("intltool" ,intltool)
1010 ("python-distutils-extra" ,python-distutils-extra)))
1011 (propagated-inputs
1012 `(("gtk+" ,gtk+)
1013 ("poppler" ,poppler)
1014 ("python-pycairo" ,python-pycairo)
1015 ("python-pygobject" ,python-pygobject)
1016 ("python-pypdf2" ,python-pypdf2)))
1017 (home-page "https://github.com/jeromerobert/pdfarranger")
1018 (synopsis "Merge, split and re-arrange pages from PDF documents")
1019 (description
1020 "PDF Arranger is a small application which allows one to merge or split
1021 PDF documents and rotate, crop and rearrange their pages using an interactive
1022 and intuitive graphical interface.
1023
1024 PDF Arranger was formerly known as PDF-Shuffler.")
1025 (license license:gpl3+)))
1026
1027 (define-public pdfposter
1028 (package
1029 (name "pdfposter")
1030 (version "0.7.post1")
1031 (source (origin
1032 (method url-fetch)
1033 (uri (pypi-uri "pdftools.pdfposter" version))
1034 (sha256
1035 (base32
1036 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
1037 (build-system python-build-system)
1038 (arguments
1039 `(#:tests? #f)) ; test-suite not included in source archive
1040 (inputs
1041 `(("python-pypdf2" ,python-pypdf2)))
1042 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1043 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1044 (description "@command{pdfposter} can be used to create a large poster by
1045 building it from multiple pages and/or printing it on large media. It expects
1046 as input a PDF file, normally printing on a single page. The output is again
1047 a PDF file, maybe containing multiple pages together building the poster. The
1048 input page will be scaled to obtain the desired size.
1049
1050 This is much like @command{poster} does for Postscript files, but working with
1051 PDF. Since sometimes @command{poster} does not like your files converted from
1052 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1053 (license license:gpl3+)))
1054
1055 (define-public pdfgrep
1056 (package
1057 (name "pdfgrep")
1058 (version "2.1.2")
1059 (source
1060 (origin
1061 (method url-fetch)
1062 (uri (string-append "https://pdfgrep.org/download/"
1063 name "-" version ".tar.gz"))
1064 (sha256
1065 (base32
1066 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
1067 (build-system gnu-build-system)
1068 (native-inputs
1069 `(("pkg-config" ,pkg-config)))
1070 (inputs
1071 `(("libgcrypt" ,libgcrypt)
1072 ("pcre" ,pcre)
1073 ("poppler" ,poppler)))
1074 (home-page "https://pdfgrep.org")
1075 (synopsis "Command-line utility to search text in PDF files")
1076 (description
1077 "Pdfgrep searches in pdf files for strings matching a regular expression.
1078 Support some GNU grep options as file name output, page number output,
1079 optional case insensitivity, count occurrences, color highlights and search in
1080 multiple files.")
1081 (license license:gpl2+)))
1082
1083 (define-public pdfpc
1084 (package
1085 (name "pdfpc")
1086 (version "4.3.4")
1087 (source
1088 (origin
1089 (method git-fetch)
1090 (uri (git-reference
1091 (url "https://github.com/pdfpc/pdfpc.git")
1092 (commit (string-append "v" version))))
1093 (file-name (git-file-name name version))
1094 (sha256
1095 (base32 "07aafsm4jzdgpahz83p0ajv40hry7gviyadqi13ahr8xdhhwy2sd"))))
1096 (build-system cmake-build-system)
1097 (arguments '(#:tests? #f)) ; no test target
1098 (inputs
1099 `(("cairo" ,cairo)
1100 ("gtk+" ,gtk+)
1101 ("gstreamer" ,gstreamer)
1102 ("gst-plugins-base" ,gst-plugins-base)
1103 ("libgee" ,libgee)
1104 ("poppler" ,poppler)
1105 ("pango" ,pango)
1106 ("vala" ,vala)))
1107 (native-inputs
1108 `(("pkg-config" ,pkg-config)))
1109 (home-page "https://pdfpc.github.io/")
1110 (synopsis "Presenter console with multi-monitor support for PDF files")
1111 (description
1112 "pdfpc is a presentation viewer application which uses multi-monitor
1113 output to provide meta information to the speaker during the presentation. It
1114 is able to show a normal presentation window on one screen, while showing a
1115 more sophisticated overview on the other one providing information like a
1116 picture of the next slide, as well as the left over time till the end of the
1117 presentation. The input files processed by pdfpc are PDF documents.")
1118 (license license:gpl2+)))
1119
1120 (define-public paps
1121 (package
1122 (name "paps")
1123 (version "0.7.1")
1124 (source
1125 (origin
1126 (method url-fetch)
1127 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1128 version "/paps-" version ".tar.gz"))
1129 (sha256
1130 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1131 (build-system gnu-build-system)
1132 (inputs
1133 `(("pango" ,pango)))
1134 (native-inputs
1135 `(("intltool" ,intltool)
1136 ("pkg-config" ,pkg-config)))
1137 (home-page "https://github.com/dov/paps")
1138 (synopsis "Pango to PostScript converter")
1139 (description
1140 "Paps reads a UTF-8 encoded file and generates a PostScript language
1141 rendering of the file. The rendering is done by creating outline curves
1142 through the Pango @code{ft2} backend.")
1143 (license license:lgpl2.0+)))
1144
1145 (define-public stapler
1146 (package
1147 (name "stapler")
1148 (version "0.3.2")
1149 (source
1150 (origin
1151 (method git-fetch)
1152 (uri (git-reference
1153 (url "https://github.com/hellerbarde/stapler")
1154 (commit version)))
1155 (file-name (git-file-name name version))
1156 (sha256
1157 (base32
1158 "06w7xanzr7cicqik62g7zqs57j4y6fc7hflrc1rlmphxx40hkg6r"))))
1159 (build-system python-build-system)
1160 (inputs
1161 `(("python2-pypdf2" ,python2-pypdf2)))
1162 (arguments
1163 `(#:python ,python-2
1164 #:phases
1165 (modify-phases %standard-phases
1166 (add-after 'unpack 'fix-pypdf-version-requirement
1167 ;; A PyPDF2 version requirement of 1.25.1 is hard-coded in
1168 ;; setup.py. Relax it to work with any version of PyPDF2.
1169 (lambda _
1170 (substitute* "setup.py"
1171 (("PyPDF2==1.25.1") "PyPDF2"))
1172 #t)))))
1173 (home-page "https://github.com/hellerbarde/stapler")
1174 (synopsis "PDF manipulation tool")
1175 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1176 manipulating PDF documents from the command line. It supports
1177
1178 @itemize
1179 @item cherry-picking pages and concatenating them into a new file
1180 @item splitting a PDF document into single pages each in its own file
1181 @item merging PDF documents with their pages interleaved
1182 @item displaying metadata in a PDF document
1183 @item displaying the mapping between logical and physical page numbers
1184 @end itemize")
1185 (license license:bsd-3)))
1186
1187 (define-public weasyprint
1188 (package
1189 (name "weasyprint")
1190 (version "50")
1191 (source
1192 (origin
1193 (method url-fetch)
1194 (uri (pypi-uri "WeasyPrint" version))
1195 (sha256
1196 (base32 "0invs96zvmcr6wh5klj52jrcnr9qg150v9wpmbhcsf3vv1d1hbcw"))
1197 (patches (search-patches "weasyprint-library-paths.patch"))))
1198 (build-system python-build-system)
1199 (arguments
1200 `(#:phases
1201 (modify-phases %standard-phases
1202 (add-after 'unpack 'patch-library-paths
1203 (lambda* (#:key inputs #:allow-other-keys)
1204 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1205 (glib (assoc-ref inputs "glib"))
1206 (pango (assoc-ref inputs "pango"))
1207 (pangoft2 (assoc-ref inputs "pangoft2")))
1208 (substitute* "weasyprint/fonts.py"
1209 (("@fontconfig@")
1210 (string-append fontconfig "/lib/libfontconfig.so"))
1211 (("@pangoft2@")
1212 (string-append pango "/lib/libpangoft2-1.0.so")))
1213 (substitute* "weasyprint/text.py"
1214 (("@gobject@")
1215 (string-append glib "/lib/libgobject-2.0.so"))
1216 (("@pango@")
1217 (string-append pango "/lib/libpango-1.0.so"))
1218 (("@pangocairo@")
1219 (string-append pango "/lib/libpangocairo-1.0.so"))))))
1220 (add-after 'unpack 'remove-pytest-options
1221 (lambda _
1222 (substitute* "setup.cfg"
1223 ;; flake8 and isort syntax checks fail, which is not our
1224 ;; business
1225 (("addopts = --flake8 --isort") ""))))
1226 (replace 'check
1227 (lambda _
1228 ;; run pytest, excluding one failing test
1229 (invoke "pytest" "-k" "not test_flex_column_wrap_reverse"))))))
1230 (inputs
1231 `(("fontconfig" ,fontconfig)
1232 ("glib" ,glib)
1233 ("pango" ,pango)))
1234 (propagated-inputs
1235 `(("gdk-pixbuf" ,gdk-pixbuf)
1236 ("python-cairocffi" ,python-cairocffi)
1237 ("python-cairosvg" ,python-cairosvg)
1238 ("python-cffi" ,python-cffi)
1239 ("python-cssselect2" ,python-cssselect2)
1240 ("python-html5lib" ,python-html5lib)
1241 ("python-pyphen" ,python-pyphen)
1242 ("python-tinycss2" ,python-tinycss2)))
1243 (native-inputs
1244 `(("python-pytest-cov" ,python-pytest-cov)
1245 ("python-pytest-runner" ,python-pytest-runner)))
1246 (home-page "https://weasyprint.org/")
1247 (synopsis "Document factory for creating PDF files from HTML")
1248 (description "WeasyPrint helps web developers to create PDF documents. It
1249 turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1250 etc.
1251
1252 From a technical point of view, WeasyPrint is a visual rendering engine for
1253 HTML and CSS that can export to PDF and PNG. It aims to support web standards
1254 for printing.
1255
1256 It is based on various libraries but not on a full rendering engine like
1257 WebKit or Gecko. The CSS layout engine is written in Python, designed for
1258 pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1259 python library.
1260
1261 Keywords: html2pdf, htmltopdf")
1262 (license license:bsd-3)))