gnu: zathura-ps: Update to 0.2.5.
[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 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org>
6 ;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
7 ;;; Coypright © 2016 ng0 <ng0@we.make.ritual.n0.is>
8 ;;; Coypright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
9 ;;; Coypright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
10 ;;; Coypright © 2016, 2017 Ludovic Courtès <ludo@gnu.org>
11 ;;; Coypright © 2016 Julien Lepiller <julien@lepiller.eu>
12 ;;; Copyright © 2016 Arun Isaac <arunisaac@systemreboot.net>
13 ;;; Copyright © 2017 Leo Famulari <leo@famulari.name>
14 ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
15 ;;; Copyright © 2017 Rene Saavedra <rennes@openmailbox.org>
16 ;;; Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
17 ;;;
18 ;;; This file is part of GNU Guix.
19 ;;;
20 ;;; GNU Guix is free software; you can redistribute it and/or modify it
21 ;;; under the terms of the GNU General Public License as published by
22 ;;; the Free Software Foundation; either version 3 of the License, or (at
23 ;;; your option) any later version.
24 ;;;
25 ;;; GNU Guix is distributed in the hope that it will be useful, but
26 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
27 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 ;;; GNU General Public License for more details.
29 ;;;
30 ;;; You should have received a copy of the GNU General Public License
31 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
32
33 (define-module (gnu packages pdf)
34 #:use-module ((guix licenses) #:prefix license:)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix utils)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system python)
41 #:use-module (guix build-system trivial)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages backup)
45 #:use-module (gnu packages base)
46 #:use-module (gnu packages bash)
47 #:use-module (gnu packages compression)
48 #:use-module (gnu packages curl)
49 #:use-module (gnu packages databases)
50 #:use-module (gnu packages djvu)
51 #:use-module (gnu packages fontutils)
52 #:use-module (gnu packages game-development)
53 #:use-module (gnu packages gettext)
54 #:use-module (gnu packages ghostscript)
55 #:use-module (gnu packages gl)
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages gnupg)
59 #:use-module (gnu packages gtk)
60 #:use-module (gnu packages image)
61 #:use-module (gnu packages imagemagick)
62 #:use-module (gnu packages javascript)
63 #:use-module (gnu packages lesstif)
64 #:use-module (gnu packages linux)
65 #:use-module (gnu packages lua)
66 #:use-module (gnu packages pcre)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages photo)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages python)
71 #:use-module (gnu packages qt)
72 #:use-module (gnu packages sdl)
73 #:use-module (gnu packages tls)
74 #:use-module (gnu packages xdisorg)
75 #:use-module (gnu packages xorg)
76 #:use-module (srfi srfi-1))
77
78 (define-public poppler
79 (package
80 (name "poppler")
81 (version "0.59.0")
82 (source (origin
83 (method url-fetch)
84 (uri (string-append "https://poppler.freedesktop.org/poppler-"
85 version ".tar.xz"))
86 (sha256
87 (base32
88 "0hcnghliyr8pr887qza18qfgaclw5jr889g1cjcglkni9jr2dmm3"))))
89 (build-system gnu-build-system)
90 ;; FIXME:
91 ;; use libcurl: no
92 (inputs `(("fontconfig" ,fontconfig)
93 ("freetype" ,freetype)
94 ("libjpeg" ,libjpeg)
95 ("libpng" ,libpng)
96 ("libtiff" ,libtiff)
97 ("lcms" ,lcms)
98 ("openjpeg-1" ,openjpeg-1) ; prefers openjpeg-1
99 ("zlib" ,zlib)
100
101 ;; To build poppler-glib (as needed by Evince), we need Cairo and
102 ;; GLib. But of course, that Cairo must not depend on Poppler.
103 ("cairo" ,(package (inherit cairo)
104 (inputs (alist-delete "poppler"
105 (package-inputs cairo)))))
106 ("glib" ,glib)))
107 (native-inputs
108 `(("pkg-config" ,pkg-config)
109 ("glib" ,glib "bin") ; glib-mkenums, etc.
110 ("gobject-introspection" ,gobject-introspection)))
111 (arguments
112 `(#:tests? #f ; no test data provided with the tarball
113 #:configure-flags
114 '("--enable-xpdf-headers" ; to install header files
115 "--enable-zlib"
116
117 ;; Saves 8 MiB of .a files.
118 "--disable-static")
119 #:phases
120 (modify-phases %standard-phases
121 (add-before 'configure 'setenv
122 (lambda _
123 (setenv "CPATH"
124 (string-append (assoc-ref %build-inputs "openjpeg-1")
125 "/include/openjpeg-1.5"
126 ":" (or (getenv "CPATH") "")))
127 #t)))))
128 (synopsis "PDF rendering library")
129 (description
130 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
131 (license license:gpl2+)
132 (home-page "https://poppler.freedesktop.org/")))
133
134 (define-public poppler-qt4
135 (package (inherit poppler)
136 (name "poppler-qt4")
137 (inputs `(("qt-4" ,qt-4)
138 ,@(package-inputs poppler)))
139 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
140
141 (define-public poppler-qt5
142 (package (inherit poppler)
143 (name "poppler-qt5")
144 (inputs `(("qtbase" ,qtbase)
145 ,@(package-inputs poppler)))
146 (arguments
147 (substitute-keyword-arguments (package-arguments poppler)
148 ((#:configure-flags flags)
149 `(cons "CXXFLAGS=-std=gnu++11" ,flags))))
150 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
151
152 (define-public python-poppler-qt4
153 (package
154 (name "python-poppler-qt4")
155 (version "0.24.0")
156 (source
157 (origin
158 (method url-fetch)
159 (uri (string-append "https://pypi.python.org/packages/source/p"
160 "/python-poppler-qt4/python-poppler-qt4-"
161 version ".tar.gz"))
162 (sha256
163 (base32
164 "0x63niylkk4q3h3ay8zrk3m1xiik0x3hlr4gvj7kswx48qi1vb99"))))
165 (build-system python-build-system)
166 (arguments
167 `(#:phases
168 (modify-phases %standard-phases
169 (add-after
170 'unpack 'patch-poppler-include-paths
171 (lambda _
172 (substitute* (find-files "." "poppler-.*\\.sip")
173 (("qt4/poppler-.*\\.h" header)
174 (string-append "poppler/" header)))
175 #t)))))
176 (native-inputs
177 `(("pkg-config" ,pkg-config)))
178 (inputs
179 `(("python-sip" ,python-sip)
180 ("python-pyqt-4" ,python-pyqt-4)
181 ("poppler-qt4" ,poppler-qt4)))
182 (home-page "https://pypi.python.org/pypi/python-poppler-qt4")
183 (synopsis "Python bindings for Poppler-Qt4")
184 (description
185 "This package provides Python bindings for the Qt4 interface of the
186 Poppler PDF rendering library.")
187 (license license:lgpl2.1+)))
188
189 (define-public python-poppler-qt5
190 (package
191 (name "python-poppler-qt5")
192 (version "0.24.2")
193 (source
194 (origin
195 (method url-fetch)
196 (uri (pypi-uri "python-poppler-qt5" version))
197 (sha256
198 (base32
199 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
200 (build-system python-build-system)
201 (arguments
202 `(;; There are no tests. The check phase just causes a rebuild.
203 #:tests? #f
204 #:phases
205 (modify-phases %standard-phases
206 (replace 'build
207 (lambda* (#:key inputs #:allow-other-keys)
208 (substitute* "setup.py"
209 ;; This check always fails, so disable it.
210 (("if not check_qtxml\\(\\)")
211 "if True")
212 ;; Enable C++11, which is needed because of Qt5.
213 (("\\*\\*ext_args" line)
214 (string-append "extra_compile_args=['-std=gnu++11'], " line)))
215 ;; We need to pass an extra flag here. This cannot be in
216 ;; configure-flags because it should not be passed for the
217 ;; installation phase.
218 ((@@ (guix build python-build-system) call-setuppy)
219 "build_ext" (list (string-append "--pyqt-sip-dir="
220 (assoc-ref inputs "python-pyqt")
221 "/share/sip")) #t))))))
222 (native-inputs
223 `(("pkg-config" ,pkg-config)))
224 (inputs
225 `(("python-sip" ,python-sip)
226 ("python-pyqt" ,python-pyqt)
227 ("poppler-qt5" ,poppler-qt5)
228 ("qtbase" ,qtbase)))
229 (home-page "https://pypi.python.org/pypi/python-poppler-qt5")
230 (synopsis "Python bindings for Poppler-Qt5")
231 (description
232 "This package provides Python bindings for the Qt5 interface of the
233 Poppler PDF rendering library.")
234 (license license:lgpl2.1+)))
235
236 (define-public libharu
237 (package
238 (name "libharu")
239 (version "2.3.0")
240 (source (origin
241 (method url-fetch)
242 (uri (string-append "https://github.com/libharu/libharu/archive/"
243 "RELEASE_"
244 (string-join (string-split version #\.) "_")
245 ".tar.gz"))
246 (file-name (string-append name "-" version ".tar.gz"))
247 (sha256
248 (base32
249 "1lm4v539y9cb1lvbq387j57sy7yxda3yv8b1pk8m6zazbp66i7lg"))))
250 (build-system gnu-build-system)
251 (arguments
252 `(#:configure-flags
253 (list (string-append "--with-zlib="
254 (assoc-ref %build-inputs "zlib"))
255 (string-append "--with-png="
256 (assoc-ref %build-inputs "libpng")))
257 #:phases
258 (modify-phases %standard-phases
259 (add-after 'unpack 'autogen
260 (lambda _ (zero? (system* "autoreconf" "-vif")))))))
261 (inputs
262 `(("zlib" ,zlib)
263 ("libpng" ,libpng)))
264 (native-inputs
265 `(("autoconf" ,autoconf)
266 ("automake" ,automake)
267 ("libtool" ,libtool)))
268 (home-page "http://libharu.org/")
269 (synopsis "Library for generating PDF files")
270 (description
271 "libHaru is a library for generating PDF files. libHaru does not support
272 reading and editing of existing PDF files.")
273 (license license:zlib)))
274
275 (define-public xpdf
276 (package
277 (name "xpdf")
278 (version "3.04")
279 (source (origin
280 (method url-fetch)
281 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
282 version ".tar.gz"))
283 (sha256 (base32
284 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
285 (build-system gnu-build-system)
286 (inputs `(("freetype" ,freetype)
287 ("gs-fonts" ,gs-fonts)
288 ("lesstif" ,lesstif)
289 ("libpaper" ,libpaper)
290 ("libx11" ,libx11)
291 ("libxext" ,libxext)
292 ("libxp" ,libxp)
293 ("libxpm" ,libxpm)
294 ("libxt" ,libxt)
295 ("libpng" ,libpng)
296 ("zlib" ,zlib)))
297 (arguments
298 `(#:tests? #f ; there is no check target
299 #:parallel-build? #f ; build fails randomly on 8-way machines
300 #:configure-flags
301 (list (string-append "--with-freetype2-includes="
302 (assoc-ref %build-inputs "freetype")
303 "/include/freetype2"))
304 #:phases
305 (modify-phases %standard-phases
306 (replace 'install
307 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
308 (let* ((install (assoc-ref %standard-phases 'install))
309 (out (assoc-ref outputs "out"))
310 (xpdfrc (string-append out "/etc/xpdfrc"))
311 (gs-fonts (assoc-ref inputs "gs-fonts")))
312 (apply install args)
313 (substitute* xpdfrc
314 (("/usr/local/share/ghostscript/fonts")
315 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
316 (("#fontFile") "fontFile")))
317 #t)))))
318 (synopsis "Viewer for PDF files based on the Motif toolkit")
319 (description
320 "Xpdf is a viewer for Portable Document Format (PDF) files.")
321 (license license:gpl3) ; or gpl2, but not gpl2+
322 (home-page "http://www.foolabs.com/xpdf/")))
323
324 (define-public zathura-cb
325 (package
326 (name "zathura-cb")
327 (version "0.1.7")
328 (source (origin
329 (method url-fetch)
330 (uri
331 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
332 version ".tar.gz"))
333 (sha256
334 (base32
335 "0r4viisycj39kaz4281cmkr7n9w5q96dmlf7nf45n8zq8qy2npw3"))))
336 (native-inputs `(("pkg-config" ,pkg-config)))
337 (propagated-inputs `(("girara" ,girara)))
338 (inputs `(("libarchive" ,libarchive)
339 ("gtk+" ,gtk+)
340 ("zathura" ,zathura)))
341 (build-system gnu-build-system)
342 (arguments
343 `(#:make-flags (list (string-append "PREFIX=" %output)
344 (string-append "PLUGINDIR=" %output "/lib/zathura")
345 "CC=gcc")
346 #:tests? #f ; Package does not contain tests.
347 #:phases
348 (modify-phases %standard-phases (delete 'configure))))
349 (home-page "https://pwmt.org/projects/zathura-cb/")
350 (synopsis "Comic book support for zathura (libarchive backend)")
351 (description "The zathura-cb plugin adds comic book support to zathura
352 using libarchive.")
353 (license license:zlib)))
354
355 (define-public zathura-ps
356 (package
357 (name "zathura-ps")
358 (version "0.2.5")
359 (source (origin
360 (method url-fetch)
361 (uri
362 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
363 version ".tar.gz"))
364 (sha256
365 (base32
366 "1x4knqja8pw2a5cb3y2209nr3iddj1z8nwasy48v5nprj61fdxqj"))))
367 (native-inputs `(("pkg-config" ,pkg-config)))
368 (propagated-inputs `(("girara" ,girara)))
369 (inputs `(("libspectre" ,libspectre)
370 ("gtk+" ,gtk+)
371 ("zathura" ,zathura)))
372 (build-system gnu-build-system)
373 (arguments
374 `(#:make-flags (list (string-append "PREFIX=" %output)
375 (string-append "PLUGINDIR=" %output "/lib/zathura")
376 "CC=gcc")
377 #:tests? #f ; Package does not contain tests.
378 #:phases
379 (modify-phases %standard-phases (delete 'configure))))
380 (home-page "https://pwmt.org/projects/zathura-ps/")
381 (synopsis "PS support for zathura (libspectre backend)")
382 (description "The zathura-ps plugin adds PS support to zathura
383 using libspectre.")
384 (license license:zlib)))
385
386 (define-public zathura-djvu
387 (package
388 (name "zathura-djvu")
389 (version "0.2.6")
390 (source (origin
391 (method url-fetch)
392 (uri
393 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
394 version ".tar.gz"))
395 (sha256
396 (base32
397 "0py0ra44f65cg064xzds0qr6vnglj2a5bwhnbwa0dyh2nyizdzmf"))))
398 (native-inputs `(("pkg-config" ,pkg-config)))
399 (propagated-inputs `(("girara" ,girara)))
400 (inputs
401 `(("djvulibre" ,djvulibre)
402 ("gtk+" ,gtk+)
403 ("zathura" ,zathura)))
404 (build-system gnu-build-system)
405 (arguments
406 `(#:make-flags (list (string-append "PREFIX=" %output)
407 (string-append "PLUGINDIR=" %output "/lib/zathura")
408 "CC=gcc")
409 #:tests? #f ; Package does not contain tests.
410 #:phases
411 (modify-phases %standard-phases (delete 'configure))))
412 (home-page "https://pwmt.org/projects/zathura-djvu/")
413 (synopsis "DjVu support for zathura (DjVuLibre backend)")
414 (description "The zathura-djvu plugin adds DjVu support to zathura
415 using the DjVuLibre library.")
416 (license license:zlib)))
417
418 (define-public zathura-pdf-mupdf
419 (package
420 (name "zathura-pdf-mupdf")
421 (version "0.3.1")
422 (source (origin
423 (method url-fetch)
424 (uri
425 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
426 "/download/zathura-pdf-mupdf-" version ".tar.gz"))
427 (sha256
428 (base32
429 "06zqn8z6a0hfsx3s1kzqvqzb73afgcl6z5r062sxv7kv570fvffr"))))
430 (native-inputs `(("pkg-config" ,pkg-config)))
431 (propagated-inputs `(("girara" ,girara)))
432 (inputs
433 `(("gtk+" ,gtk+)
434 ("jbig2dec" ,jbig2dec)
435 ("libjpeg" ,libjpeg)
436 ("mupdf" ,mupdf)
437 ("openjpeg" ,openjpeg)
438 ("openssl" ,openssl)
439 ("zathura" ,zathura)))
440 (build-system gnu-build-system)
441 (arguments
442 `(#:make-flags (list (string-append "PREFIX=" %output)
443 (string-append "PLUGINDIR=" %output "/lib/zathura")
444 "CC=gcc")
445 #:tests? #f ;No tests.
446 #:phases (modify-phases %standard-phases (delete 'configure))))
447 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
448 (synopsis "PDF support for zathura (mupdf backend)")
449 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
450 by using the @code{mupdf} rendering library.")
451 (license license:zlib)))
452
453 (define-public zathura-pdf-poppler
454 (package
455 (name "zathura-pdf-poppler")
456 (version "0.2.7")
457 (source (origin
458 (method url-fetch)
459 (uri
460 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
461 version ".tar.gz"))
462 (sha256
463 (base32
464 "1h43sgxpsbrsnn5z19661642plzhpv6b0y3f4kyzshv1rr6lwplq"))))
465 (native-inputs `(("pkg-config" ,pkg-config)))
466 (propagated-inputs `(("girara" ,girara)))
467 (inputs
468 `(("poppler" ,poppler)
469 ("gtk+" ,gtk+)
470 ("zathura" ,zathura)
471 ("cairo" ,cairo)))
472 (build-system gnu-build-system)
473 (arguments
474 `(#:make-flags (list (string-append "PREFIX=" %output)
475 (string-append "PLUGINDIR=" %output "/lib/zathura")
476 "CC=gcc")
477 #:tests? #f ; Package does not include tests.
478 #:phases
479 (modify-phases %standard-phases (delete 'configure))))
480 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
481 (synopsis "PDF support for zathura (poppler backend)")
482 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
483 by using the poppler rendering engine.")
484 (license license:zlib)))
485
486 (define-public zathura
487 (package
488 (name "zathura")
489 (version "0.3.8")
490 (source (origin
491 (method url-fetch)
492 (uri
493 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
494 version ".tar.gz"))
495 (sha256
496 (base32
497 "0dz5pky3vmf3s2cp2rv1c099gb1s49p9xlgm3ghyy4pzyxc8bgs6"))
498 (patches (search-patches
499 "zathura-plugindir-environment-variable.patch"))))
500 (native-inputs `(("pkg-config" ,pkg-config)
501 ("gettext" ,gettext-minimal)
502 ("glib:bin" ,glib "bin")))
503 (inputs `(("girara" ,girara)
504 ("sqlite" ,sqlite)
505 ("gtk+" ,gtk+)))
506 (native-search-paths
507 (list (search-path-specification
508 (variable "ZATHURA_PLUGIN_PATH")
509 (files '("lib/zathura")))))
510 (build-system gnu-build-system)
511 (arguments
512 `(#:make-flags
513 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
514 "CC=gcc" "COLOR=0")
515 #:tests? #f ; Tests fail: "Gtk cannot open display".
516 #:test-target "test"
517 #:phases
518 (modify-phases %standard-phases (delete 'configure))))
519 (home-page "https://pwmt.org/projects/zathura/")
520 (synopsis "Lightweight keyboard-driven PDF viewer")
521 (description "Zathura is a customizable document viewer. It provides a
522 minimalistic interface and an interface that mainly focuses on keyboard
523 interaction.")
524 (license license:zlib)))
525
526 (define-public podofo
527 (package
528 (name "podofo")
529 (version "0.9.5")
530 (source (origin
531 (method url-fetch)
532 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
533 "/podofo-" version ".tar.gz"))
534 (sha256
535 (base32
536 "012kgfx5j5n6w4zkc1d290d2cwjk60jhzsjlr2x19g3yi75q2jc5"))))
537 (build-system cmake-build-system)
538 (inputs ; TODO: Add cppunit for tests
539 `(("lua" ,lua-5.1)
540 ("libpng" ,libpng)
541 ("openssl" ,openssl)
542 ("fontconfig" ,fontconfig)
543 ("libtiff" ,libtiff)
544 ("libjpeg" ,libjpeg-8)
545 ("freetype" ,freetype)
546 ("zlib" ,zlib)))
547 (arguments
548 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
549 "-DPODOFO_BUILD_STATIC=ON")
550 #:phases
551 (modify-phases %standard-phases
552 (add-before 'configure 'patch
553 (lambda* (#:key inputs #:allow-other-keys)
554 (let ((freetype (assoc-ref inputs "freetype")))
555 ;; Look for freetype include files in the correct place.
556 (substitute* "cmake/modules/FindFREETYPE.cmake"
557 (("/usr/local") freetype)))
558 #t)))))
559 (home-page "http://podofo.sourceforge.net")
560 (synopsis "Tools to work with the PDF file format")
561 (description
562 "PoDoFo is a C++ library and set of command-line tools to work with the
563 PDF file format. It can parse PDF files and load them into memory, and makes
564 it easy to modify them and write the changes to disk. It is primarily useful
565 for applications that wish to do lower level manipulation of PDF, such as
566 extracting content or merging files.")
567 (license license:lgpl2.0+)))
568
569 (define-public mupdf
570 (package
571 (name "mupdf")
572 (version "1.12.0")
573 (source
574 (origin
575 (method url-fetch)
576 (uri (string-append "https://mupdf.com/downloads/archive/"
577 name "-" version "-source.tar.xz"))
578 (patches (search-patches "mupdf-build-with-latest-openjpeg.patch"))
579 (sha256
580 (base32
581 "0b9j0gqbc3jhmx87r6idcsh8lnb30840c3hyx6dk2gdjqqh3hysp"))
582 (modules '((guix build utils)))
583 (snippet '(delete-file-recursively "thirdparty"))))
584 (build-system gnu-build-system)
585 (inputs
586 `(("curl" ,curl)
587 ("freeglut" ,freeglut)
588 ("freetype" ,freetype)
589 ("harfbuzz" ,harfbuzz)
590 ("jbig2dec" ,jbig2dec)
591 ("libjpeg" ,libjpeg)
592 ("libx11" ,libx11)
593 ("libxext" ,libxext)
594 ("mujs" ,mujs)
595 ("openjpeg" ,openjpeg)
596 ("openssl" ,openssl)
597 ("zlib" ,zlib)))
598 (native-inputs
599 `(("pkg-config" ,pkg-config)))
600 (arguments
601 '(#:tests? #f ; no check target
602 #:make-flags (list "CC=gcc"
603 "XCFLAGS=-fpic"
604 (string-append "prefix=" (assoc-ref %outputs "out")))
605 #:phases (modify-phases %standard-phases
606 (delete 'configure))))
607 (home-page "https://mupdf.com")
608 (synopsis "Lightweight PDF viewer and toolkit")
609 (description
610 "MuPDF is a C library that implements a PDF and XPS parsing and
611 rendering engine. It is used primarily to render pages into bitmaps,
612 but also provides support for other operations such as searching and
613 listing the table of contents and hyperlinks.
614
615 The library ships with a rudimentary X11 viewer, and a set of command
616 line tools for batch rendering @command{pdfdraw}, rewriting files
617 @command{pdfclean}, and examining the file structure @command{pdfshow}.")
618 (license license:agpl3+)))
619
620 (define-public qpdf
621 (package
622 (name "qpdf")
623 (version "6.0.0")
624 (source (origin
625 (method url-fetch)
626 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
627 "/qpdf-" version ".tar.gz"))
628 (sha256
629 (base32
630 "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9"))
631 (modules '((guix build utils)))
632 (snippet
633 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
634 ;; dependency on Perl.
635 '(substitute* "qpdf/fix-qdf"
636 (("#!/usr/bin/env perl")
637 "\
638 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
639 & eval 'exec perl -wS \"$0\" $argv:q'
640 if 0;\n")))))
641 (build-system gnu-build-system)
642 (arguments
643 `(#:disallowed-references (,perl)
644 #:phases
645 (modify-phases %standard-phases
646 (add-before 'configure 'patch-paths
647 (lambda _
648 (substitute* "make/libtool.mk"
649 (("SHELL=/bin/bash")
650 (string-append "SHELL=" (which "bash"))))
651 (substitute* (append
652 '("qtest/bin/qtest-driver")
653 (find-files "." "\\.test"))
654 (("/usr/bin/env") (which "env"))))))))
655 (native-inputs
656 `(("pkg-config" ,pkg-config)
657 ("perl" ,perl)))
658 (propagated-inputs
659 `(("pcre" ,pcre)))
660 (inputs
661 `(("zlib" ,zlib)))
662 (synopsis "Command-line tools and library for transforming PDF files")
663 (description
664 "QPDF is a command-line program that does structural, content-preserving
665 transformations on PDF files. It could have been called something like
666 pdf-to-pdf. It includes support for merging and splitting PDFs and to
667 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
668 program capable of converting PDF into other formats.")
669 (license license:clarified-artistic)
670 (home-page "http://qpdf.sourceforge.net/")))
671
672 (define-public xournal
673 (package
674 (name "xournal")
675 (version "0.4.8")
676 (source
677 (origin
678 (method url-fetch)
679 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
680 "/xournal-" version ".tar.gz"))
681 (sha256
682 (base32
683 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
684 (build-system gnu-build-system)
685 (inputs
686 `(("gtk" ,gtk+-2)
687 ("pango" ,pango)
688 ("poppler" ,poppler)
689 ("glib" ,glib)
690 ("libgnomecanvas" ,libgnomecanvas)))
691 (native-inputs
692 `(("pkg-config" ,pkg-config)))
693 (home-page "http://xournal.sourceforge.net/")
694 (synopsis "Notetaking using a stylus")
695 (description
696 "Xournal is an application for notetaking, sketching, keeping a journal
697 using a stylus.")
698 (license license:gpl2+)))
699
700 (define-public python-reportlab
701 (package
702 (name "python-reportlab")
703 (version "3.4.0")
704 (source (origin
705 (method url-fetch)
706 (uri (pypi-uri "reportlab" version))
707 (sha256
708 (base32
709 "0hy304pzsz9lblmk7mrbk2682bi911lxgvzx2kcfpmfzb5gg7sjv"))))
710 (build-system python-build-system)
711 (arguments
712 '(;; FIXME: There is one test failure, but it does not cause the
713 ;; build to fail. No time to investigate right now.
714 #:test-target "tests"))
715 (propagated-inputs
716 `(("python-pillow" ,python-pillow)))
717 (home-page "https://www.reportlab.com")
718 (synopsis "Python library for generating PDFs and graphics")
719 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
720 of rich PDF documents, and also creation of charts in a variety of bitmap and
721 vector formats.")
722 (license license:bsd-3)))
723
724 (define-public python2-reportlab
725 (package-with-python2 python-reportlab))
726
727 (define-public impressive
728 (package
729 (name "impressive")
730 (version "0.11.1")
731 (source (origin
732 (method url-fetch)
733 (uri (string-append
734 "mirror://sourceforge/impressive/Impressive/"
735 version "/Impressive-" version ".tar.gz"))
736 (sha256
737 (base32
738 "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr"))))
739 (build-system python-build-system)
740
741 ;; TODO: Add dependency on pdftk.
742 (inputs `(("python2-pygame" ,python2-pygame)
743 ("python2-pillow" ,python2-pillow)
744 ("sdl" ,sdl)
745 ("xpdf" ,xpdf)))
746
747 (arguments
748 `(#:python ,python-2
749 #:phases (modify-phases %standard-phases
750 (delete 'build)
751 (delete 'configure)
752 (delete 'check)
753 (replace 'install
754 (lambda* (#:key inputs outputs #:allow-other-keys)
755 ;; There's no 'setup.py' so install things manually.
756 (let* ((out (assoc-ref outputs "out"))
757 (bin (string-append out "/bin"))
758 (man1 (string-append out "/share/man/man1"))
759 (sdl (assoc-ref inputs "sdl"))
760 (xpdf (assoc-ref inputs "xpdf")))
761 (mkdir-p bin)
762 (copy-file "impressive.py"
763 (string-append bin "/impressive"))
764 (wrap-program (string-append bin "/impressive")
765 `("LIBRARY_PATH" ":" prefix ;for ctypes
766 (,(string-append sdl "/lib")))
767 `("PATH" ":" prefix ;for pdftoppm
768 (,(string-append xpdf "/bin"))))
769 (install-file "impressive.1" man1)
770 #t))))))
771 (home-page "http://impressive.sourceforge.net")
772 (synopsis "PDF presentation tool with visual effects")
773 (description
774 "Impressive is a tool to display PDF files that provides visual effects
775 such as smooth alpha-blended slide transitions. It provides additional tools
776 such as zooming, highlighting an area of the screen, and a tool to navigate
777 the PDF pages.")
778 (license license:gpl2)))
779
780 (define-public fbida
781 (package
782 (name "fbida")
783 (version "2.12")
784 (home-page "https://www.kraxel.org/blog/linux/fbida/")
785 (source (origin
786 (method url-fetch)
787 (uri (string-append "https://www.kraxel.org/releases/fbida/"
788 name "-" version ".tar.gz"))
789 (sha256
790 (base32
791 "0bw224vb7jh0lrqaf4jgxk48xglvxs674qcpj5y0axyfbh896cfk"))))
792 (build-system gnu-build-system)
793 (arguments
794 '(#:phases
795 (modify-phases %standard-phases
796 (add-after 'unpack 'patch-ldconfig
797 (lambda _
798 (substitute* "mk/Autoconf.mk"
799 (("/sbin/ldconfig -p") "echo lib")) #t))
800 (delete 'configure))
801 #:tests? #f
802 #:make-flags (list "CC=gcc"
803 (string-append "prefix=" (assoc-ref %outputs "out")))))
804 (inputs `(("libjpeg" ,libjpeg)
805 ("curl" ,curl)
806 ("libtiff" ,libtiff)
807 ("libudev" ,eudev)
808 ("libwebp" ,libwebp)
809 ("libdrm" ,libdrm)
810 ("imagemagick" ,imagemagick)
811 ("giflib" ,giflib)
812 ("glib" ,glib)
813 ("cairo-xcb" ,cairo-xcb)
814 ("freetype" ,freetype)
815 ("fontconfig" ,fontconfig)
816 ("libexif" ,libexif)
817 ("mesa" ,mesa)
818 ("libepoxy" ,libepoxy)
819 ("libpng" ,libpng)
820 ("poppler" ,poppler)))
821 (native-inputs `(("pkg-config" ,pkg-config)))
822 (synopsis "Framebuffer and drm-based image viewer")
823 (description
824 "fbida contains a few applications for viewing and editing images on
825 the framebuffer.")
826
827 (license license:gpl2+)))
828
829 (define-public pdf2svg
830 (package
831 (name "pdf2svg")
832 (version "0.2.3")
833 (source (origin
834 (method url-fetch)
835 (uri (string-append
836 "https://github.com/dawbarton/pdf2svg/archive/v"
837 version ".tar.gz"))
838 (file-name (string-append name "-" version ".tar.gz"))
839 (sha256
840 (base32
841 "12pa1pajirnlrkz2il3h4l30lc2prryk1qr132jk6z9y1c3qdcag"))))
842 (build-system gnu-build-system)
843 (inputs
844 `(("cairo" ,cairo)
845 ("poppler" ,poppler)))
846 (native-inputs
847 `(("pkg-config" ,pkg-config)))
848 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
849 (synopsis "PDF to SVG converter")
850 (description "@command{pdf2svg} is a simple command-line PDF to SVG
851 converter using the Poppler and Cairo libraries.")
852 (license license:gpl2+)))
853
854 (define-public python-pypdf2
855 (package
856 (name "python-pypdf2")
857 (version "1.26.0")
858 (source (origin
859 (method url-fetch)
860 (uri (pypi-uri "PyPDF2" version))
861 (sha256
862 (base32
863 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
864 (build-system python-build-system)
865 (arguments
866 `(#:phases
867 (modify-phases %standard-phases
868 (add-after
869 'unpack 'patch-test-suite
870 (lambda _
871 ;; The text-file needs to be opened in binary mode for Python 3,
872 ;; so patch in the "b"
873 (substitute* "Tests/tests.py"
874 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
875 (string-append line "b")))
876 #t))
877 (replace 'check
878 (lambda _
879 (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))
880 (home-page "http://mstamy2.github.com/PyPDF2")
881 (synopsis "Pure Python PDF toolkit")
882 (description "PyPDF2 is a pure Python PDF library capable of:
883
884 @enumerate
885 @item extracting document information (title, author, …)
886 @item splitting documents page by page
887 @item merging documents page by page
888 @item cropping pages
889 @item merging multiple pages into a single page
890 @item encrypting and decrypting PDF files
891 @end enumerate
892
893 By being pure Python, it should run on any Python platform without any
894 dependencies on external libraries. It can also work entirely on
895 @code{StringIO} objects rather than file streams, allowing for PDF
896 manipulation in memory. It is therefore a useful tool for websites that
897 manage or manipulate PDFs.")
898 (license license:bsd-3)))
899
900 (define-public python2-pypdf2
901 (package-with-python2 python-pypdf2))
902
903 (define-public python2-pypdf
904 (package
905 (name "python2-pypdf")
906 (version "1.13")
907 (source (origin
908 (method url-fetch)
909 (uri (pypi-uri "pyPdf" version))
910 (sha256
911 (base32
912 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
913 (build-system python-build-system)
914 (arguments
915 `(#:tests? #f ; no tests
916 #:python ,python-2))
917 (home-page "http://pybrary.net/pyPdf/")
918 (synopsis "Pure Python PDF toolkit")
919 (description "PyPDF2 is a pure Python PDF toolkit.
920
921 Note: This module isn't maintained anymore. For new projects please use
922 python-pypdf2 instead.")
923 (license license:bsd-3)))
924
925 (define-public pdfposter
926 (package
927 (name "pdfposter")
928 (version "0.6.0")
929 (source (origin
930 (method url-fetch)
931 (uri (pypi-uri "pdftools.pdfposter" version ".tar.bz2"))
932 (sha256
933 (base32
934 "1i9jqawf279va089ykicglcq4zlsnwgcnsdzaa8vnm836lqhywma"))))
935 (build-system python-build-system)
936 (arguments
937 `(#:tests? #f ; no test suite, only for visual control
938 #:python ,python-2))
939 (inputs
940 ;; pdfposter 0.6.0 still uses the old pyPdf
941 `(("python2-pypdf" ,python2-pypdf)))
942 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
943 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
944 (description "@command{pdfposter} can be used to create a large poster by
945 building it from multple pages and/or printing it on large media. It expects
946 as input a PDF file, normally printing on a single page. The output is again
947 a PDF file, maybe containing multiple pages together building the poster. The
948 input page will be scaled to obtain the desired size.
949
950 This is much like @command{poster} does for Postscript files, but working with
951 PDF. Since sometimes @command{poster} does not like your files converted from
952 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
953 (license license:gpl3+)))
954
955 (define-public pdfgrep
956 (package
957 (name "pdfgrep")
958 (version "2.0.1")
959 (source
960 (origin
961 (method url-fetch)
962 (uri (string-append "https://pdfgrep.org/download/"
963 name "-" version ".tar.gz"))
964 (sha256
965 (base32
966 "07llkrkcfjwd3ybai9ad10ybhr0biffcplmy7lw4fb87nd2dfw03"))))
967 (build-system gnu-build-system)
968 (native-inputs
969 `(("pkg-config" ,pkg-config)))
970 (inputs
971 `(("libgcrypt" ,libgcrypt)
972 ("pcre" ,pcre)
973 ("poppler" ,poppler)))
974 (home-page "https://pdfgrep.org")
975 (synopsis "Command-line utility to search text in PDF files")
976 (description
977 "Pdfgrep searches in pdf files for strings matching a regular expression.
978 Support some GNU grep options as file name output, page number output,
979 optional case insensitivity, count occurrences, color highlights and search in
980 multiple files.")
981 (license license:gpl2+)))