gnu: python-statsmodels: Fix build
[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 (propagated-inputs
642 `(("python-pillow" ,python-pillow)))
643 (home-page "http://www.reportlab.com")
644 (synopsis "Python library for generating PDFs and graphics")
645 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
646 of rich PDF documents, and also creation of charts in a variety of bitmap and
647 vector formats.")
648 (license license:bsd-3)))
649
650 (define-public python2-reportlab
651 (package-with-python2 python-reportlab))
652
653 (define-public impressive
654 (package
655 (name "impressive")
656 (version "0.11.1")
657 (source (origin
658 (method url-fetch)
659 (uri (string-append
660 "mirror://sourceforge/impressive/Impressive/"
661 version "/Impressive-" version ".tar.gz"))
662 (sha256
663 (base32
664 "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr"))))
665 (build-system python-build-system)
666
667 ;; TODO: Add dependency on pdftk.
668 (inputs `(("python-pygame" ,python-pygame)
669 ("python2-pillow" ,python2-pillow)
670 ("sdl" ,sdl)
671 ("xpdf" ,xpdf)))
672
673 (arguments
674 `(#:python ,python-2
675 #:phases (modify-phases %standard-phases
676 (delete 'build)
677 (delete 'configure)
678 (delete 'check)
679 (replace 'install
680 (lambda* (#:key inputs outputs #:allow-other-keys)
681 ;; There's no 'setup.py' so install things manually.
682 (let* ((out (assoc-ref outputs "out"))
683 (bin (string-append out "/bin"))
684 (man1 (string-append out "/share/man/man1"))
685 (sdl (assoc-ref inputs "sdl"))
686 (xpdf (assoc-ref inputs "xpdf")))
687 (mkdir-p bin)
688 (copy-file "impressive.py"
689 (string-append bin "/impressive"))
690 (wrap-program (string-append bin "/impressive")
691 `("LIBRARY_PATH" ":" prefix ;for ctypes
692 (,(string-append sdl "/lib")))
693 `("PATH" ":" prefix ;for pdftoppm
694 (,(string-append xpdf "/bin"))))
695 (mkdir-p man1)
696 (install-file "impressive.1" man1)
697 #t))))))
698 (home-page "http://impressive.sourceforge.net")
699 (synopsis "PDF presentation tool with visual effects")
700 (description
701 "Impressive is a tool to display PDF files that provides visual effects
702 such as smooth alpha-blended slide transitions. It provides additional tools
703 such as zooming, highlighting an area of the screen, and a tool to navigate
704 the PDF pages.")
705 (license license:gpl2)))
706
707 (define-public fbida
708 (package
709 (name "fbida")
710 (version "2.12")
711 (home-page "https://www.kraxel.org/blog/linux/fbida/")
712 (source (origin
713 (method url-fetch)
714 (uri (string-append "https://www.kraxel.org/releases/fbida/"
715 name "-" version ".tar.gz"))
716 (sha256
717 (base32
718 "0bw224vb7jh0lrqaf4jgxk48xglvxs674qcpj5y0axyfbh896cfk"))))
719 (build-system gnu-build-system)
720 (arguments
721 '(#:phases (alist-cons-after
722 'unpack 'patch-ldconfig
723 (lambda _
724 (substitute* "mk/Autoconf.mk"
725 (("/sbin/ldconfig -p") "echo lib")) #t)
726 (alist-delete 'configure %standard-phases))
727 #:tests? #f
728 #:make-flags (list "CC=gcc"
729 (string-append "prefix=" (assoc-ref %outputs "out")))))
730 (inputs `(("libjpeg" ,libjpeg)
731 ("curl" ,curl)
732 ("libtiff" ,libtiff)
733 ("libudev" ,eudev)
734 ("libwebp" ,libwebp)
735 ("libdrm" ,libdrm)
736 ("imagemagick" ,imagemagick)
737 ("giflib" ,giflib)
738 ("glib" ,glib)
739 ("cairo-xcb" ,cairo-xcb)
740 ("freetype" ,freetype)
741 ("fontconfig" ,fontconfig)
742 ("libexif" ,libexif)
743 ("mesa" ,mesa)
744 ("libepoxy" ,libepoxy)
745 ("libpng" ,libpng)
746 ("poppler" ,poppler)))
747 (native-inputs `(("pkg-config" ,pkg-config)))
748 (synopsis "Framebuffer and drm-based image viewer")
749 (description
750 "fbida contains a few applications for viewing and editing images on
751 the framebuffer.")
752
753 (license license:gpl2+)))
754
755 (define-public pdf2svg
756 (package
757 (name "pdf2svg")
758 (version "0.2.3")
759 (source (origin
760 (method url-fetch)
761 (uri (string-append
762 "https://github.com/dawbarton/pdf2svg/archive/v"
763 version ".tar.gz"))
764 (file-name (string-append name "-" version ".tar.gz"))
765 (sha256
766 (base32
767 "12pa1pajirnlrkz2il3h4l30lc2prryk1qr132jk6z9y1c3qdcag"))))
768 (build-system gnu-build-system)
769 (inputs
770 `(("cairo" ,cairo)
771 ("poppler" ,poppler)))
772 (native-inputs
773 `(("pkg-config" ,pkg-config)))
774 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
775 (synopsis "PDF to SVG converter")
776 (description "@command{pdf2svg} is a simple command-line PDF to SVG
777 converter using the Poppler and Cairo libraries.")
778 (license license:gpl2+)))
779
780 (define-public python-pypdf2
781 (package
782 (name "python-pypdf2")
783 (version "1.26.0")
784 (source (origin
785 (method url-fetch)
786 (uri (pypi-uri "PyPDF2" version))
787 (sha256
788 (base32
789 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
790 (build-system python-build-system)
791 (arguments
792 `(#:phases
793 (modify-phases %standard-phases
794 (add-after
795 'unpack 'patch-test-suite
796 (lambda _
797 ;; The text-file needs to be opened in binary mode for Python 3,
798 ;; so patch in the "b"
799 (substitute* "Tests/tests.py"
800 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
801 (string-append line "b")))
802 #t))
803 (replace 'check
804 (lambda _
805 (zero? (system* "python" "-m" "unittest" "Tests.tests")))))))
806 (home-page "http://mstamy2.github.com/PyPDF2")
807 (synopsis "Pure Python PDF toolkit")
808 (description "PyPDF2 is a pure Python PDF library capable of:
809
810 @enumerate
811 @item extracting document information (title, author, …)
812 @item splitting documents page by page
813 @item merging documents page by page
814 @item cropping pages
815 @item merging multiple pages into a single page
816 @item encrypting and decrypting PDF files
817 @end enumerate
818
819 By being pure Python, it should run on any Python platform without any
820 dependencies on external libraries. It can also work entirely on
821 @code{StringIO} objects rather than file streams, allowing for PDF
822 manipulation in memory. It is therefore a useful tool for websites that
823 manage or manipulate PDFs.")
824 (license license:bsd-3)))
825
826 (define-public python2-pypdf2
827 (package-with-python2 python-pypdf2))
828
829 (define-public python2-pypdf
830 (package
831 (name "python2-pypdf")
832 (version "1.13")
833 (source (origin
834 (method url-fetch)
835 (uri (pypi-uri "pyPdf" version))
836 (sha256
837 (base32
838 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
839 (build-system python-build-system)
840 (arguments
841 `(#:tests? #f ; no tests
842 #:python ,python-2))
843 (home-page "http://pybrary.net/pyPdf/")
844 (synopsis "Pure Python PDF toolkit")
845 (description "PyPDF2 is a pure Python PDF toolkit.
846
847 Note: This module isn't maintained anymore. For new projects please use
848 python-pypdf2 instead.")
849 (license license:bsd-3)))
850
851 (define-public pdfposter
852 (package
853 (name "pdfposter")
854 (version "0.6.0")
855 (source (origin
856 (method url-fetch)
857 (uri (pypi-uri "pdftools.pdfposter" version ".tar.bz2"))
858 (sha256
859 (base32
860 "1i9jqawf279va089ykicglcq4zlsnwgcnsdzaa8vnm836lqhywma"))))
861 (build-system python-build-system)
862 (arguments
863 `(#:tests? #f ; no test suite, only for visual control
864 #:python ,python-2))
865 (inputs
866 ;; pdfposter 0.6.0 still uses the old pyPdf
867 `(("python2-pypdf" ,python2-pypdf)))
868 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
869 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
870 (description "@command{pdfposter} can be used to create a large poster by
871 building it from multple pages and/or printing it on large media. It expects
872 as input a PDF file, normally printing on a single page. The output is again
873 a PDF file, maybe containing multiple pages together building the poster. The
874 input page will be scaled to obtain the desired size.
875
876 This is much like @command{poster} does for Postscript files, but working with
877 PDF. Since sometimes @command{poster} does not like your files converted from
878 PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
879 (license license:gpl3+)))