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