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