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