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