Merge branch 'master' into core-updates
[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 ;;;
12 ;;; This file is part of GNU Guix.
13 ;;;
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
18 ;;;
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
23 ;;;
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
26
27 (define-module (gnu packages pdf)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix download)
31 #:use-module (guix utils)
32 #:use-module (guix build-system gnu)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system python)
35 #:use-module (guix build-system trivial)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages base)
39 #:use-module (gnu packages bash)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages fontutils)
42 #:use-module (gnu packages game-development)
43 #:use-module (gnu packages ghostscript)
44 #:use-module (gnu packages databases)
45 #:use-module (gnu packages djvu)
46 #:use-module (gnu packages gettext)
47 #:use-module (gnu packages backup)
48 #:use-module (gnu packages lesstif)
49 #:use-module (gnu packages image)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages qt)
52 #:use-module (gnu packages xorg)
53 #:use-module (gnu packages gnome)
54 #:use-module (gnu packages glib)
55 #:use-module (gnu packages gtk)
56 #:use-module (gnu packages lua)
57 #:use-module (gnu packages curl)
58 #:use-module (gnu packages pcre)
59 #:use-module (gnu packages perl)
60 #:use-module (gnu packages python)
61 #:use-module (gnu packages sdl)
62 #:use-module (gnu packages tls)
63 #:use-module (srfi srfi-1))
64
65 (define-public poppler
66 (package
67 (name "poppler")
68 (version "0.47.0")
69 (source (origin
70 (method url-fetch)
71 (uri (string-append "https://poppler.freedesktop.org/poppler-"
72 version ".tar.xz"))
73 (sha256
74 (base32
75 "0hnjkcqqk87dw3hlda4gh4l7brkslniax9a79g772jn3iwiffwmq"))))
76 (build-system gnu-build-system)
77 ;; FIXME:
78 ;; use libcurl: no
79 (inputs `(("fontconfig" ,fontconfig)
80 ("freetype" ,freetype)
81 ("libjpeg" ,libjpeg)
82 ("libpng" ,libpng)
83 ("libtiff" ,libtiff)
84 ("lcms" ,lcms)
85 ("openjpeg-1" ,openjpeg-1)
86 ("zlib" ,zlib)
87
88 ;; To build poppler-glib (as needed by Evince), we need Cairo and
89 ;; GLib. But of course, that Cairo must not depend on Poppler.
90 ("cairo" ,(package (inherit cairo)
91 (inputs (alist-delete "poppler"
92 (package-inputs cairo)))))
93 ("glib" ,glib)))
94 (native-inputs
95 `(("pkg-config" ,pkg-config)
96 ("glib" ,glib "bin") ; glib-mkenums, etc.
97 ("gobject-introspection" ,gobject-introspection)))
98 (arguments
99 `(#:tests? #f ; no test data provided with the tarball
100 #:configure-flags
101 '("--enable-xpdf-headers" ; to install header files
102 "--enable-zlib"
103
104 ;; Saves 8 MiB of .a files.
105 "--disable-static")
106 #:phases
107 (modify-phases %standard-phases
108 (add-before 'configure 'setenv
109 (lambda _
110 (setenv "CPATH"
111 (string-append (assoc-ref %build-inputs "openjpeg-1")
112 "/include/openjpeg-1.5"
113 ":" (or (getenv "CPATH") ""))))))))
114 (synopsis "PDF rendering library")
115 (description
116 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
117 (license license:gpl2+)
118 (home-page "https://poppler.freedesktop.org/")))
119
120 (define-public poppler-qt4
121 (package (inherit poppler)
122 (name "poppler-qt4")
123 (inputs `(("qt-4" ,qt-4)
124 ,@(package-inputs poppler)))
125 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
126
127 (define-public poppler-qt5
128 (package (inherit poppler)
129 (name "poppler-qt5")
130 (inputs `(("qtbase" ,qtbase)
131 ,@(package-inputs poppler)))
132 (arguments
133 (substitute-keyword-arguments (package-arguments poppler)
134 ((#:configure-flags flags)
135 `(cons "CXXFLAGS=-std=gnu++11" ,flags))))
136 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
137
138 (define-public python-poppler-qt4
139 (package
140 (name "python-poppler-qt4")
141 (version "0.24.0")
142 (source
143 (origin
144 (method url-fetch)
145 (uri (string-append "https://pypi.python.org/packages/source/p"
146 "/python-poppler-qt4/python-poppler-qt4-"
147 version ".tar.gz"))
148 (sha256
149 (base32
150 "0x63niylkk4q3h3ay8zrk3m1xiik0x3hlr4gvj7kswx48qi1vb99"))))
151 (build-system python-build-system)
152 (arguments
153 `(#:phases
154 (modify-phases %standard-phases
155 (add-after
156 'unpack 'patch-poppler-include-paths
157 (lambda _
158 (substitute* (find-files "." "poppler-.*\\.sip")
159 (("qt4/poppler-.*\\.h" header)
160 (string-append "poppler/" header)))
161 #t)))))
162 (native-inputs
163 `(("pkg-config" ,pkg-config)))
164 (inputs
165 `(("python-sip" ,python-sip)
166 ("python-pyqt-4" ,python-pyqt-4)
167 ("poppler-qt4" ,poppler-qt4)))
168 (home-page "https://pypi.python.org/pypi/python-poppler-qt4")
169 (synopsis "Python bindings for Poppler-Qt4")
170 (description
171 "This package provides Python bindings for the Qt4 interface of the
172 Poppler PDF rendering library.")
173 (license license:lgpl2.1+)))
174
175 (define-public libharu
176 (package
177 (name "libharu")
178 (version "2.3.0")
179 (source (origin
180 (method url-fetch)
181 (uri (string-append "https://github.com/libharu/libharu/archive/"
182 "RELEASE_"
183 (string-join (string-split version #\.) "_")
184 ".tar.gz"))
185 (file-name (string-append name "-" version ".tar.gz"))
186 (sha256
187 (base32
188 "1lm4v539y9cb1lvbq387j57sy7yxda3yv8b1pk8m6zazbp66i7lg"))))
189 (build-system gnu-build-system)
190 (arguments
191 `(#:configure-flags
192 (list (string-append "--with-zlib="
193 (assoc-ref %build-inputs "zlib"))
194 (string-append "--with-png="
195 (assoc-ref %build-inputs "libpng")))
196 #:phases
197 (modify-phases %standard-phases
198 (add-before 'configure 'autogen
199 (lambda _ (zero? (system* "autoreconf" "-vif")))))))
200 (inputs
201 `(("zlib" ,zlib)
202 ("libpng" ,libpng)))
203 (native-inputs
204 `(("autoconf" ,autoconf)
205 ("automake" ,automake)
206 ("libtool" ,libtool)))
207 (home-page "http://libharu.org/")
208 (synopsis "Library for generating PDF files")
209 (description
210 "libHaru is a library for generating PDF files. libHaru does not support
211 reading and editing of existing PDF files.")
212 (license license:zlib)))
213
214 (define-public xpdf
215 (package
216 (name "xpdf")
217 (version "3.04")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-"
221 version ".tar.gz"))
222 (sha256 (base32
223 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
224 (build-system gnu-build-system)
225 (inputs `(("freetype" ,freetype)
226 ("gs-fonts" ,gs-fonts)
227 ("lesstif" ,lesstif)
228 ("libpaper" ,libpaper)
229 ("libx11" ,libx11)
230 ("libxext" ,libxext)
231 ("libxp" ,libxp)
232 ("libxpm" ,libxpm)
233 ("libxt" ,libxt)
234 ("libpng" ,libpng)
235 ("zlib" ,zlib)))
236 (arguments
237 `(#:tests? #f ; there is no check target
238 #:parallel-build? #f ; build fails randomly on 8-way machines
239 #:configure-flags
240 (list (string-append "--with-freetype2-includes="
241 (assoc-ref %build-inputs "freetype")
242 "/include/freetype2"))
243 #:phases
244 (alist-replace
245 'install
246 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
247 (let* ((install (assoc-ref %standard-phases 'install))
248 (out (assoc-ref outputs "out"))
249 (xpdfrc (string-append out "/etc/xpdfrc"))
250 (gs-fonts (assoc-ref inputs "gs-fonts")))
251 (apply install args)
252 (substitute* xpdfrc
253 (("/usr/local/share/ghostscript/fonts")
254 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
255 (("#fontFile") "fontFile"))))
256 %standard-phases)))
257 (synopsis "Viewer for PDF files based on the Motif toolkit")
258 (description
259 "Xpdf is a viewer for Portable Document Format (PDF) files.")
260 (license license:gpl3) ; or gpl2, but not gpl2+
261 (home-page "http://www.foolabs.com/xpdf/")))
262
263 (define-public zathura-cb
264 (package
265 (name "zathura-cb")
266 (version "0.1.5")
267 (source (origin
268 (method url-fetch)
269 (uri
270 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
271 version ".tar.gz"))
272 (sha256
273 (base32
274 "1zbazysdjwwnzw01qlnzyixwmsi8rqskc76mp81qcr3rpl96jprp"))))
275 (native-inputs `(("pkg-config" ,pkg-config)))
276 (propagated-inputs `(("girara" ,girara)))
277 (inputs `(("libarchive" ,libarchive)
278 ("gtk+" ,gtk+)
279 ("zathura" ,zathura)))
280 (build-system gnu-build-system)
281 (arguments
282 `(#:make-flags (list (string-append "PREFIX=" %output)
283 (string-append "PLUGINDIR=" %output "/lib/zathura")
284 "CC=gcc")
285 #:tests? #f ; Package does not contain tests.
286 #:phases
287 (alist-delete 'configure %standard-phases)))
288 (home-page "https://pwmt.org/projects/zathura-cb/")
289 (synopsis "Comic book support for zathura (libarchive backend)")
290 (description "The zathura-cb plugin adds comic book support to zathura
291 using libarchive.")
292 (license license:zlib)))
293
294 (define-public zathura-ps
295 (package
296 (name "zathura-ps")
297 (version "0.2.3")
298 (source (origin
299 (method url-fetch)
300 (uri
301 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
302 version ".tar.gz"))
303 (sha256
304 (base32
305 "18wsfy8pqficdgj8wy2aws7j4fy8z78157rhqk17mj5f295zgvm9"))))
306 (native-inputs `(("pkg-config" ,pkg-config)))
307 (propagated-inputs `(("girara" ,girara)))
308 (inputs `(("libspectre" ,libspectre)
309 ("gtk+" ,gtk+)
310 ("zathura" ,zathura)))
311 (build-system gnu-build-system)
312 (arguments
313 `(#:make-flags (list (string-append "PREFIX=" %output)
314 (string-append "PLUGINDIR=" %output "/lib/zathura")
315 "CC=gcc")
316 #:tests? #f ; Package does not contain tests.
317 #:phases
318 (alist-delete 'configure %standard-phases)))
319 (home-page "https://pwmt.org/projects/zathura-ps/")
320 (synopsis "PS support for zathura (libspectre backend)")
321 (description "The zathura-ps plugin adds PS support to zathura
322 using libspectre.")
323 (license license:zlib)))
324
325 (define-public zathura-djvu
326 (package
327 (name "zathura-djvu")
328 (version "0.2.5")
329 (source (origin
330 (method url-fetch)
331 (uri
332 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
333 version ".tar.gz"))
334 (sha256
335 (base32
336 "03cw54d2fipvbrnbqy0xccqkx6s77dyhyymx479aj5ryy4513dq8"))))
337 (native-inputs `(("pkg-config" ,pkg-config)))
338 (propagated-inputs `(("girara" ,girara)))
339 (inputs
340 `(("djvulibre" ,djvulibre)
341 ("gtk+" ,gtk+)
342 ("zathura" ,zathura)))
343 (build-system gnu-build-system)
344 (arguments
345 `(#:make-flags (list (string-append "PREFIX=" %output)
346 (string-append "PLUGINDIR=" %output "/lib/zathura")
347 "CC=gcc")
348 #:tests? #f ; Package does not contain tests.
349 #:phases
350 (alist-delete 'configure %standard-phases)))
351 (home-page "https://pwmt.org/projects/zathura-djvu/")
352 (synopsis "DjVu support for zathura (DjVuLibre backend)")
353 (description "The zathura-djvu plugin adds DjVu support to zathura
354 using the DjVuLibre library.")
355 (license license:zlib)))
356
357 (define-public zathura-pdf-poppler
358 (package
359 (name "zathura-pdf-poppler")
360 (version "0.2.6")
361 (source (origin
362 (method url-fetch)
363 (uri
364 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
365 version ".tar.gz"))
366 (sha256
367 (base32
368 "1maqiv7yv8d8hymlffa688c5z71v85kbzmx2j88i8z349xx0rsyi"))))
369 (native-inputs `(("pkg-config" ,pkg-config)))
370 (propagated-inputs `(("girara" ,girara)))
371 (inputs
372 `(("poppler" ,poppler)
373 ("gtk+" ,gtk+)
374 ("zathura" ,zathura)
375 ("cairo" ,cairo)))
376 (build-system gnu-build-system)
377 (arguments
378 `(#:make-flags (list (string-append "PREFIX=" %output)
379 (string-append "PLUGINDIR=" %output "/lib/zathura")
380 "CC=gcc")
381 #:tests? #f ; Package does not include tests.
382 #:phases
383 (alist-delete 'configure %standard-phases)))
384 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
385 (synopsis "PDF support for zathura (poppler backend)")
386 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
387 by using the poppler rendering engine.")
388 (license license:zlib)))
389
390 (define-public zathura
391 (package
392 (name "zathura")
393 (version "0.3.6")
394 (source (origin
395 (method url-fetch)
396 (uri
397 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
398 version ".tar.gz"))
399 (sha256
400 (base32
401 "0fyb5hak0knqvg90rmdavwcmilhnrwgg1s5ykx9wd3skbpi8nsh8"))
402 (patches (search-patches
403 "zathura-plugindir-environment-variable.patch"))))
404 (native-inputs `(("pkg-config" ,pkg-config)
405 ("gettext" ,gettext-minimal)))
406 (inputs `(("girara" ,girara)
407 ("sqlite" ,sqlite)
408 ("gtk+" ,gtk+)))
409 (native-search-paths
410 (list (search-path-specification
411 (variable "ZATHURA_PLUGIN_PATH")
412 (files '("lib/zathura")))))
413 (build-system gnu-build-system)
414 (arguments
415 `(#:make-flags
416 `(,(string-append "PREFIX=" (assoc-ref %outputs "out"))
417 "CC=gcc" "COLOR=0")
418 #:tests? #f ; Tests fail: "Gtk cannot open display".
419 #:test-target "test"
420 #:phases
421 (alist-delete 'configure %standard-phases)))
422 (home-page "https://pwmt.org/projects/zathura/")
423 (synopsis "Lightweight keyboard-driven PDF viewer")
424 (description "Zathura is a customizable document viewer. It provides a
425 minimalistic interface and an interface that mainly focuses on keyboard
426 interaction.")
427 (license license:zlib)))
428
429 (define-public podofo
430 (package
431 (name "podofo")
432 (version "0.9.3")
433 (source (origin
434 (method url-fetch)
435 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
436 "/podofo-" version ".tar.gz"))
437 (sha256
438 (base32
439 "1n12lbq9x15vqn7dc0hsccp56l5jdff1xrhvlfqlbklxx0qiw9pc"))))
440 (build-system cmake-build-system)
441 (inputs ; TODO: Add cppunit for tests
442 `(("lua" ,lua-5.1)
443 ("libpng" ,libpng)
444 ("openssl" ,openssl)
445 ("fontconfig" ,fontconfig)
446 ("libtiff" ,libtiff)
447 ("libjpeg" ,libjpeg-8)
448 ("freetype" ,freetype)
449 ("zlib" ,zlib)))
450 (arguments
451 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
452 "-DPODOFO_BUILD_STATIC=ON")
453 #:phases
454 (alist-cons-before
455 'configure 'patch
456 (lambda* (#:key inputs #:allow-other-keys)
457 (let ((freetype (assoc-ref inputs "freetype")))
458 ;; Look for freetype include files in the correct place.
459 (substitute* "cmake/modules/FindFREETYPE.cmake"
460 (("/usr/local") freetype))))
461 %standard-phases)))
462 (home-page "http://podofo.sourceforge.net")
463 (synopsis "Tools to work with the PDF file format")
464 (description
465 "PoDoFo is a C++ library and set of command-line tools to work with the
466 PDF file format. It can parse PDF files and load them into memory, and makes
467 it easy to modify them and write the changes to disk. It is primarily useful
468 for applications that wish to do lower level manipulation of PDF, such as
469 extracting content or merging files.")
470 (license license:lgpl2.0+)))
471
472 (define-public mupdf
473 (package
474 (name "mupdf")
475 (version "1.9a")
476 (source
477 (origin
478 (method url-fetch)
479 (uri (string-append "http://mupdf.com/downloads/archive/"
480 name "-" version "-source.tar.gz"))
481 (sha256
482 (base32
483 "1k64pdapyj8a336jw3j61fhn0rp4q6az7d0dqp9r5n3d9rgwa5c0"))
484 (patches (search-patches "mupdf-build-with-openjpeg-2.1.patch"
485 "mupdf-CVE-2016-6265.patch"
486 "mupdf-CVE-2016-6525.patch"))
487 (modules '((guix build utils)))
488 (snippet
489 ;; Delete all the bundled libraries except for mujs, which is
490 ;; developed by the same team as mupdf and has no releases.
491 ;; TODO Package mujs and don't use the bundled copy.
492 '(for-each delete-file-recursively
493 '("thirdparty/curl"
494 "thirdparty/freetype"
495 "thirdparty/glfw"
496 "thirdparty/harfbuzz"
497 "thirdparty/jbig2dec"
498 "thirdparty/jpeg"
499 "thirdparty/openjpeg"
500 "thirdparty/zlib")))))
501 (build-system gnu-build-system)
502 (inputs
503 `(("curl" ,curl)
504 ("freetype" ,freetype)
505 ("harfbuzz" ,harfbuzz)
506 ("jbig2dec" ,jbig2dec)
507 ("libjpeg" ,libjpeg)
508 ("libx11" ,libx11)
509 ("libxext" ,libxext)
510 ("openjpeg" ,openjpeg)
511 ("openssl" ,openssl)
512 ("zlib" ,zlib)))
513 (native-inputs
514 `(("pkg-config" ,pkg-config)))
515 (arguments
516 '(#:tests? #f ; no check target
517 #:make-flags (list "CC=gcc"
518 "XCFLAGS=-fpic"
519 (string-append "prefix=" (assoc-ref %outputs "out")))
520 #:phases (modify-phases %standard-phases
521 (delete 'configure))))
522 (home-page "http://mupdf.com")
523 (synopsis "Lightweight PDF viewer and toolkit")
524 (description
525 "MuPDF is a C library that implements a PDF and XPS parsing and
526 rendering engine. It is used primarily to render pages into bitmaps,
527 but also provides support for other operations such as searching and
528 listing the table of contents and hyperlinks.
529
530 The library ships with a rudimentary X11 viewer, and a set of command
531 line tools for batch rendering (pdfdraw), rewriting files (pdfclean),
532 and examining the file structure (pdfshow).")
533 (license license:agpl3+)))
534
535 (define-public qpdf
536 (package
537 (name "qpdf")
538 (version "6.0.0")
539 (source (origin
540 (method url-fetch)
541 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
542 "/qpdf-" version ".tar.gz"))
543 (sha256
544 (base32
545 "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9"))
546 (modules '((guix build utils)))
547 (snippet
548 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
549 ;; dependency on Perl.
550 '(substitute* "qpdf/fix-qdf"
551 (("#!/usr/bin/env perl")
552 "\
553 eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
554 & eval 'exec perl -wS \"$0\" $argv:q'
555 if 0;\n")))))
556 (build-system gnu-build-system)
557 (arguments
558 `(#:disallowed-references (,perl)
559 #:phases
560 (modify-phases %standard-phases
561 (add-before 'configure 'patch-paths
562 (lambda _
563 (substitute* "make/libtool.mk"
564 (("SHELL=/bin/bash")
565 (string-append "SHELL=" (which "bash"))))
566 (substitute* (append
567 '("qtest/bin/qtest-driver")
568 (find-files "." "\\.test"))
569 (("/usr/bin/env") (which "env"))))))))
570 (native-inputs
571 `(("pkg-config" ,pkg-config)
572 ("perl" ,perl)))
573 (propagated-inputs
574 `(("pcre" ,pcre)))
575 (inputs
576 `(("zlib" ,zlib)))
577 (synopsis "Command-line tools and library for transforming PDF files")
578 (description
579 "QPDF is a command-line program that does structural, content-preserving
580 transformations on PDF files. It could have been called something like
581 pdf-to-pdf. It includes support for merging and splitting PDFs and to
582 manipulate the list of pages in a PDF file. It is not a PDF viewer or a
583 program capable of converting PDF into other formats.")
584 (license license:clarified-artistic)
585 (home-page "http://qpdf.sourceforge.net/")))
586
587 (define-public xournal
588 (package
589 (name "xournal")
590 (version "0.4.8")
591 (source
592 (origin
593 (method url-fetch)
594 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
595 "/xournal-" version ".tar.gz"))
596 (sha256
597 (base32
598 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
599 (build-system gnu-build-system)
600 (inputs
601 `(("gtk" ,gtk+-2)
602 ("pango" ,pango)
603 ("poppler" ,poppler)
604 ("glib" ,glib)
605 ("libgnomecanvas" ,libgnomecanvas)))
606 (native-inputs
607 `(("pkg-config" ,pkg-config)))
608 (home-page "http://xournal.sourceforge.net/")
609 (synopsis "Notetaking using a stylus")
610 (description
611 "Xournal is an application for notetaking, sketching, keeping a journal
612 using a stylus.")
613 (license license:gpl2+)))
614
615 (define-public python-reportlab
616 (package
617 (name "python-reportlab")
618 (version "3.3.0")
619 (source (origin
620 (method url-fetch)
621 (uri (pypi-uri "reportlab" version))
622 (sha256
623 (base32
624 "0rz2pg04wnzjjm2f5a8ik9v8s54mv4xrjhv5liqjijqv6awh12gl"))))
625 (build-system python-build-system)
626 (arguments
627 ;; Prevent creation of the egg. Without this flag, various artifacts
628 ;; from the build inputs end up in the final python3 output. It also
629 ;; works around https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20765 .
630 `(#:configure-flags '("--single-version-externally-managed" "--root=/")))
631 (propagated-inputs
632 `(("python-pillow" ,python-pillow)))
633 (home-page "http://www.reportlab.com")
634 (synopsis "Python library for generating PDFs and graphics")
635 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
636 of rich PDF documents, and also creation of charts in a variety of bitmap and
637 vector formats.")
638 (license license:bsd-3)
639 (properties `((python2-variant . ,(delay python2-reportlab))))))
640
641 (define-public python2-reportlab
642 (package
643 (inherit (package-with-python2
644 (strip-python2-variant python-reportlab)))
645 (native-inputs `(("python2-pip" ,python2-pip)))))
646
647 (define-public impressive
648 (package
649 (name "impressive")
650 (version "0.11.1")
651 (source (origin
652 (method url-fetch)
653 (uri (string-append
654 "mirror://sourceforge/impressive/Impressive/"
655 version "/Impressive-" version ".tar.gz"))
656 (sha256
657 (base32
658 "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr"))))
659 (build-system python-build-system)
660
661 ;; TODO: Add dependency on pdftk.
662 (inputs `(("python-pygame" ,python-pygame)
663 ("python2-pillow" ,python2-pillow)
664 ("sdl" ,sdl)
665 ("xpdf" ,xpdf)))
666
667 (arguments
668 `(#:python ,python-2
669 #:phases (modify-phases %standard-phases
670 (delete 'build)
671 (delete 'configure)
672 (delete 'check)
673 (replace 'install
674 (lambda* (#:key inputs outputs #:allow-other-keys)
675 ;; There's no 'setup.py' so install things manually.
676 (let* ((out (assoc-ref outputs "out"))
677 (bin (string-append out "/bin"))
678 (man1 (string-append out "/share/man/man1"))
679 (sdl (assoc-ref inputs "sdl"))
680 (xpdf (assoc-ref inputs "xpdf")))
681 (mkdir-p bin)
682 (copy-file "impressive.py"
683 (string-append bin "/impressive"))
684 (wrap-program (string-append bin "/impressive")
685 `("LIBRARY_PATH" ":" prefix ;for ctypes
686 (,(string-append sdl "/lib")))
687 `("PATH" ":" prefix ;for pdftoppm
688 (,(string-append xpdf "/bin"))))
689 (mkdir-p man1)
690 (install-file "impressive.1" man1)
691 #t))))))
692 (home-page "http://impressive.sourceforge.net")
693 (synopsis "PDF presentation tool with visual effects")
694 (description
695 "Impressive is a tool to display PDF files that provides visual effects
696 such as smooth alpha-blended slide transitions. It provides additional tools
697 such as zooming, highlighting an area of the screen, and a tool to navigate
698 the PDF pages.")
699 (license license:gpl2)))