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