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