gnu: ruby-pandoc-ruby: Use pandoc instead of ghc-pandoc.
[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>
a773f141 4;;; Copyright © 2014, 2015, 2016, 2018, 2019 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>
3c986a7d 7;;; Copyright © 2016 Nikita <nikita@n0.is>
2d8270ad 8;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
82862153 9;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com>
8b438f85 10;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org>
82862153 11;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu>
667c004c 12;;; Copyright © 2016, 2019 Arun Isaac <arunisaac@systemreboot.net>
6d161406 13;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name>
92ae98e2 14;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com>
7da4dbb3 15;;; Copyright © 2017, 2018 Rene Saavedra <pacoon@protonmail.com>
7f0bccb5 16;;; Copyright © 2017, 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
a42cb6f1 17;;; Copyright © 2019 Alex Griffin <a@ajgrf.com>
0cd4a746 18;;; Copyright © 2019 Ben Sturmfels <ben@sturm.com.au>
e34b06b7 19;;; Copyright © 2019,2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
ebbd30ff 20;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
135eb524
AE
21;;;
22;;; This file is part of GNU Guix.
23;;;
24;;; GNU Guix is free software; you can redistribute it and/or modify it
25;;; under the terms of the GNU General Public License as published by
26;;; the Free Software Foundation; either version 3 of the License, or (at
27;;; your option) any later version.
28;;;
29;;; GNU Guix is distributed in the hope that it will be useful, but
30;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32;;; GNU General Public License for more details.
33;;;
34;;; You should have received a copy of the GNU General Public License
35;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36
37(define-module (gnu packages pdf)
b5b73a82 38 #:use-module ((guix licenses) #:prefix license:)
135eb524
AE
39 #:use-module (guix packages)
40 #:use-module (guix download)
e2ec95c4 41 #:use-module (guix git-download)
ab1c2319 42 #:use-module (guix utils)
135eb524 43 #:use-module (guix build-system gnu)
0f28ee34 44 #:use-module (guix build-system cmake)
eb6a5dab 45 #:use-module (guix build-system meson)
3efb57ea 46 #:use-module (guix build-system python)
8d4169a1 47 #:use-module (guix build-system trivial)
135eb524 48 #:use-module (gnu packages)
ebbd30ff 49 #:use-module (gnu packages audio)
aae8ba47 50 #:use-module (gnu packages autotools)
31f248fa 51 #:use-module (gnu packages backup)
8d4169a1
LC
52 #:use-module (gnu packages base)
53 #:use-module (gnu packages bash)
ac847543 54 #:use-module (gnu packages check)
135eb524 55 #:use-module (gnu packages compression)
31f248fa 56 #:use-module (gnu packages curl)
bac31d1f 57 #:use-module (gnu packages djvu)
31f248fa
EF
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages game-development)
ebbd30ff 60 #:use-module (gnu packages gcc)
3e40bb82 61 #:use-module (gnu packages gettext)
31f248fa 62 #:use-module (gnu packages ghostscript)
f3e22216 63 #:use-module (gnu packages gl)
8db824ba 64 #:use-module (gnu packages glib)
31f248fa
EF
65 #:use-module (gnu packages gnome)
66 #:use-module (gnu packages gnupg)
e2ec95c4 67 #:use-module (gnu packages gstreamer)
8db824ba 68 #:use-module (gnu packages gtk)
31f248fa
EF
69 #:use-module (gnu packages image)
70 #:use-module (gnu packages imagemagick)
1650cf92 71 #:use-module (gnu packages javascript)
31f248fa 72 #:use-module (gnu packages lesstif)
77e0cebc 73 #:use-module (gnu packages libffi)
31f248fa 74 #:use-module (gnu packages linux)
0f28ee34 75 #:use-module (gnu packages lua)
765f0ac8
RW
76 #:use-module (gnu packages pcre)
77 #:use-module (gnu packages perl)
31f248fa
EF
78 #:use-module (gnu packages photo)
79 #:use-module (gnu packages pkg-config)
ebbd30ff 80 #:use-module (gnu packages pulseaudio)
3fa2dc27 81 #:use-module (gnu packages python)
77e0cebc
HG
82 #:use-module (gnu packages python-check)
83 #:use-module (gnu packages python-web)
44d10b1f 84 #:use-module (gnu packages python-xyz)
31f248fa 85 #:use-module (gnu packages qt)
8d4169a1 86 #:use-module (gnu packages sdl)
9d0c291e 87 #:use-module (gnu packages sphinx)
cd0322a3 88 #:use-module (gnu packages sqlite)
ebbd30ff 89 #:use-module (gnu packages tex)
cc2b77df 90 #:use-module (gnu packages tls)
31f248fa 91 #:use-module (gnu packages xdisorg)
ebbd30ff 92 #:use-module (gnu packages xml)
31f248fa 93 #:use-module (gnu packages xorg)
8db824ba 94 #:use-module (srfi srfi-1))
135eb524 95
e34b06b7
HG
96(define-public flyer-composer
97 (package
98 (name "flyer-composer")
99 (version "1.0rc2")
100 (source
101 (origin
102 (method url-fetch)
103 (uri (pypi-uri "flyer-composer" version))
104 (sha256
105 (base32 "17igqb5dlcgcq4nimjw6cf9qgz6a728zdx1d0rr90r2z0llcchsv"))))
106 (build-system python-build-system)
107 (arguments
108 `(#:tests? #f ;; TODO
109 #:phases
110 (modify-phases %standard-phases
111 (add-after 'install 'wrap-executable
112 (lambda* (#:key inputs outputs #:allow-other-keys)
113 (let* ((out (assoc-ref outputs "out"))
114 (qtbase (assoc-ref inputs "qtbase"))
115 (qml "/lib/qt5/qml"))
116 (wrap-program (string-append out "/bin/flyer-composer-gui")
117 `("QT_PLUGIN_PATH" ":" =
118 (,(string-append qtbase "/lib/qt5/plugins")))
119 `("QT_QPA_PLATFORM_PLUGIN_PATH" ":" =
120 (,(string-append qtbase "/lib/qt5/plugins/platforms"))))
121 #t))))))
122 (inputs
123 `(("python-pypdf2" ,python-pypdf2)
124 ("python-pyqt" ,python-pyqt)
125 ("python-poppler-qt5" ,python-poppler-qt5)
126 ("qtbase" ,qtbase)))
127 (home-page "http://crazy-compilers.com/flyer-composer")
128 (synopsis "Rearrange PDF pages to print as flyers on one sheet")
129 (description "@command{flyer-composer} can be used to prepare one- or
130two-sided flyers for printing on one sheet of paper.
131
132Imagine you have designed a flyer in A6 format and want to print it using your
133A4 printer. Of course, you want to print four flyers on each sheet. This is
134where Flyer Composer steps in, creating a PDF which holds your flyer four
135times. If you have a second page, Flyer Composer can arrange it the same way
136- even if the second page is in a separate PDF file.
137
f5dd283c 138This package contains both the command line tool and the gui too.")
e34b06b7
HG
139 (license license:agpl3+)))
140
8f83699b
HG
141(define-public flyer-composer-cli
142 (package/inherit flyer-composer
143 (name "flyer-composer-cli")
144 (arguments
145 `(#:tests? #f ;; TODO
146 #:phases
147 (modify-phases %standard-phases
148 (add-after 'unpack 'remove-gui
149 (lambda _
150 (delete-file-recursively "flyer_composer/gui")
151 (substitute* "setup.cfg"
152 (("^\\s+flyer-composer-gui\\s*=.*") ""))
153 #t)))))
154 (inputs
155 `(("python-pypdf2" ,python-pypdf2)))
156 (description "@command{flyer-composer} can be used to prepare one- or
157two-sided flyers for printing on one sheet of paper.
158
159Imagine you have designed a flyer in A6 format and want to print it using your
160A4 printer. Of course, you want to print four flyers on each sheet. This is
161where Flyer Composer steps in, creating a PDF which holds your flyer four
162times. If you have a second page, Flyer Composer can arrange it the same way
163- even if the second page is in a separate PDF file.
164
e0e873a9 165This package contains only the command line tool. If you like to use the gui,
8f83699b
HG
166please install the @code{flyer-composer-gui} package.")))
167
135eb524
AE
168(define-public poppler
169 (package
170 (name "poppler")
a7924ba9 171 (version "0.86.1")
135eb524
AE
172 (source (origin
173 (method url-fetch)
5cc3096c 174 (uri (string-append "https://poppler.freedesktop.org/poppler-"
8befb33d 175 version ".tar.xz"))
6983ba56
SB
176 (sha256
177 (base32
a7924ba9 178 "0v3z4mk1rr8i0c4cfkab7pnxdbil30j4cm4w6cqlq6cfghkhlqxg"))))
1b821701 179 (build-system cmake-build-system)
6983ba56 180 ;; FIXME:
a25fe6d6 181 ;; use libcurl: no
135eb524
AE
182 (inputs `(("fontconfig" ,fontconfig)
183 ("freetype" ,freetype)
1abe0554 184 ("libjpeg" ,libjpeg-turbo)
a25fe6d6 185 ("libpng" ,libpng)
135eb524 186 ("libtiff" ,libtiff)
927d4d9b 187 ("lcms" ,lcms)
301804d6 188 ("openjpeg" ,openjpeg)
8db824ba
LC
189 ("zlib" ,zlib)
190
191 ;; To build poppler-glib (as needed by Evince), we need Cairo and
192 ;; GLib. But of course, that Cairo must not depend on Poppler.
193 ("cairo" ,(package (inherit cairo)
194 (inputs (alist-delete "poppler"
eb637c64
MB
195 (package-inputs cairo)))))))
196 (propagated-inputs
197 ;; As per poppler-cairo and poppler-glib.pc.
198 ;; XXX: Ideally we'd propagate Cairo too, but that would require a
199 ;; different solution to the circular dependency mentioned above.
200 `(("glib" ,glib)))
c4c4cc05 201 (native-inputs
426adbe8 202 `(("pkg-config" ,pkg-config)
6983ba56
SB
203 ("glib" ,glib "bin") ; glib-mkenums, etc.
204 ("gobject-introspection" ,gobject-introspection)))
135eb524
AE
205 (arguments
206 `(#:tests? #f ; no test data provided with the tarball
a25fe6d6 207 #:configure-flags
1b821701
MB
208 (let* ((out (assoc-ref %outputs "out"))
209 (lib (string-append out "/lib")))
9df39750 210 (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files
1b821701
MB
211 "-DENABLE_ZLIB=ON"
212 (string-append "-DCMAKE_INSTALL_LIBDIR=" lib)
213 (string-append "-DCMAKE_INSTALL_RPATH=" lib)))))
35b9e423 214 (synopsis "PDF rendering library")
135eb524
AE
215 (description
216 "Poppler is a PDF rendering library based on the xpdf-3.0 code base.")
14ecc0ef 217 (license license:gpl2+)
5f8fc5e3 218 (home-page "https://poppler.freedesktop.org/")))
14ecc0ef 219
6d161406
LF
220(define-public poppler-data
221 (package
222 (name "poppler-data")
223 (version "0.4.9")
224 (source (origin
225 (method url-fetch)
226 (uri (string-append "https://poppler.freedesktop.org/poppler-data"
227 "-" version ".tar.gz"))
228 (sha256
229 (base32
230 "04i0wgdkn5lhda8cyxd1ll4a2p41pwqrwd47n9mdpl7cx5ypx70z"))))
231 (build-system gnu-build-system)
232 (arguments
233 '(#:tests? #f ; no test suite
234 #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out")))
235 #:phases
236 (modify-phases %standard-phases
237 ;; The package only provides some data files, so there is nothing to
238 ;; build.
239 (delete 'configure)
240 (delete 'build))))
241 (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text")
242 (description "This package provides optional encoding files for Poppler.
243When present, Poppler is able to correctly render CJK and Cyrillic text.")
244 (home-page (package-home-page poppler))
245 ;; See COPYING in the source distribution for more information about
246 ;; the licensing.
247 (license (list license:bsd-3
248 license:gpl2))))
249
95bbaa02 250(define-public poppler-qt4
021bf6af 251 (package/inherit poppler
8410cb62
RW
252 (name "poppler-qt4")
253 (inputs `(("qt-4" ,qt-4)
254 ,@(package-inputs poppler)))
255 (synopsis "Qt4 frontend for the Poppler PDF rendering library")))
256
f22debac 257(define-public poppler-qt5
021bf6af 258 (package/inherit poppler
f22debac 259 (name "poppler-qt5")
13297861 260 (inputs `(("qtbase" ,qtbase)
f22debac
RJ
261 ,@(package-inputs poppler)))
262 (synopsis "Qt5 frontend for the Poppler PDF rendering library")))
263
99bcae94
RW
264(define-public python-poppler-qt5
265 (package
266 (name "python-poppler-qt5")
267 (version "0.24.2")
268 (source
269 (origin
270 (method url-fetch)
271 (uri (pypi-uri "python-poppler-qt5" version))
272 (sha256
273 (base32
274 "0l69llw1fzwz8y90q0qp9q5pifbrqjjbwii7di54dwghw5fc6w1r"))))
275 (build-system python-build-system)
276 (arguments
277 `(;; There are no tests. The check phase just causes a rebuild.
278 #:tests? #f
279 #:phases
280 (modify-phases %standard-phases
281 (replace 'build
282 (lambda* (#:key inputs #:allow-other-keys)
283 (substitute* "setup.py"
284 ;; This check always fails, so disable it.
285 (("if not check_qtxml\\(\\)")
0fe041bd 286 "if True"))
99bcae94
RW
287 ;; We need to pass an extra flag here. This cannot be in
288 ;; configure-flags because it should not be passed for the
289 ;; installation phase.
290 ((@@ (guix build python-build-system) call-setuppy)
291 "build_ext" (list (string-append "--pyqt-sip-dir="
292 (assoc-ref inputs "python-pyqt")
293 "/share/sip")) #t))))))
294 (native-inputs
295 `(("pkg-config" ,pkg-config)))
296 (inputs
297 `(("python-sip" ,python-sip)
298 ("python-pyqt" ,python-pyqt)
299 ("poppler-qt5" ,poppler-qt5)
300 ("qtbase" ,qtbase)))
e85af137 301 (home-page "https://pypi.org/project/python-poppler-qt5/")
99bcae94
RW
302 (synopsis "Python bindings for Poppler-Qt5")
303 (description
304 "This package provides Python bindings for the Qt5 interface of the
305Poppler PDF rendering library.")
306 (license license:lgpl2.1+)))
307
aae8ba47
RW
308(define-public libharu
309 (package
310 (name "libharu")
311 (version "2.3.0")
312 (source (origin
2b2ab39c
RW
313 (method git-fetch)
314 (uri (git-reference
b0e7b699 315 (url "https://github.com/libharu/libharu")
2b2ab39c
RW
316 (commit (string-append
317 "RELEASE_"
318 (string-join (string-split version #\.) "_")))))
319 (file-name (git-file-name name version))
aae8ba47
RW
320 (sha256
321 (base32
2b2ab39c 322 "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q"))))
aae8ba47
RW
323 (build-system gnu-build-system)
324 (arguments
325 `(#:configure-flags
326 (list (string-append "--with-zlib="
327 (assoc-ref %build-inputs "zlib"))
328 (string-append "--with-png="
6f3dd09f 329 (assoc-ref %build-inputs "libpng")))))
aae8ba47
RW
330 (inputs
331 `(("zlib" ,zlib)
332 ("libpng" ,libpng)))
333 (native-inputs
334 `(("autoconf" ,autoconf)
335 ("automake" ,automake)
336 ("libtool" ,libtool)))
337 (home-page "http://libharu.org/")
338 (synopsis "Library for generating PDF files")
339 (description
340 "libHaru is a library for generating PDF files. libHaru does not support
341reading and editing of existing PDF files.")
342 (license license:zlib)))
343
14ecc0ef
AE
344(define-public xpdf
345 (package
346 (name "xpdf")
04761fcc
TGR
347 (version "4.02")
348 (source
349 (origin
350 (method url-fetch)
351 (uri (string-append "https://xpdfreader-dl.s3.amazonaws.com/xpdf-"
352 version "4.02.tar.gz"))
353 (sha256
354 (base32 "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i"))))
14ecc0ef
AE
355 (build-system gnu-build-system)
356 (inputs `(("freetype" ,freetype)
19cb5170 357 ("gs-fonts" ,gs-fonts)
14ecc0ef
AE
358 ("lesstif" ,lesstif)
359 ("libpaper" ,libpaper)
360 ("libx11" ,libx11)
361 ("libxext" ,libxext)
362 ("libxp" ,libxp)
363 ("libxpm" ,libxpm)
364 ("libxt" ,libxt)
f410c110 365 ("libpng" ,libpng)
01eafd38 366 ("zlib" ,zlib)))
14ecc0ef 367 (arguments
04761fcc
TGR
368 `(#:tests? #f ; there is no check target
369 #:parallel-build? #f ; build fails randomly on 8-way machines
bdbf227f
AE
370 #:configure-flags
371 (list (string-append "--with-freetype2-includes="
372 (assoc-ref %build-inputs "freetype")
373 "/include/freetype2"))
19cb5170 374 #:phases
dc1d3cde
KK
375 (modify-phases %standard-phases
376 (replace 'install
377 (lambda* (#:key outputs inputs #:allow-other-keys #:rest args)
378 (let* ((install (assoc-ref %standard-phases 'install))
379 (out (assoc-ref outputs "out"))
380 (xpdfrc (string-append out "/etc/xpdfrc"))
381 (gs-fonts (assoc-ref inputs "gs-fonts")))
382 (apply install args)
383 (substitute* xpdfrc
19cb5170
AE
384 (("/usr/local/share/ghostscript/fonts")
385 (string-append gs-fonts "/share/fonts/type1/ghostscript"))
dc1d3cde
KK
386 (("#fontFile") "fontFile")))
387 #t)))))
9e771e3b 388 (synopsis "Viewer for PDF files based on the Motif toolkit")
14ecc0ef 389 (description
e881752c 390 "Xpdf is a viewer for Portable Document Format (PDF) files.")
04761fcc 391 (license license:gpl3) ; or gpl2, but not gpl2+
9900eb1c 392 (home-page "https://www.xpdfreader.com/")))
0f28ee34 393
b3886e0c
PW
394(define-public zathura-cb
395 (package
396 (name "zathura-cb")
02fcc6f2 397 (version "0.1.8")
b3886e0c
PW
398 (source (origin
399 (method url-fetch)
400 (uri
401 (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-"
02fcc6f2 402 version ".tar.xz"))
b3886e0c
PW
403 (sha256
404 (base32
02fcc6f2 405 "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5"))))
b3886e0c 406 (native-inputs `(("pkg-config" ,pkg-config)))
b3886e0c 407 (inputs `(("libarchive" ,libarchive)
b3886e0c 408 ("zathura" ,zathura)))
02fcc6f2 409 (build-system meson-build-system)
b3886e0c 410 (arguments
02fcc6f2 411 `(#:tests? #f ; package does not contain tests
b3886e0c 412 #:phases
02fcc6f2
TGR
413 (modify-phases %standard-phases
414 (add-after 'unpack 'patch-plugin-directory
415 ;; Something of a regression in 0.1.8: the new Meson build system
416 ;; now hard-codes an incorrect plugin directory. Fix it.
417 (lambda* (#:key outputs #:allow-other-keys)
418 (substitute* "meson.build"
419 (("(install_dir:).*" _ key)
420 (string-append key
421 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
422 #t)))))
b3886e0c
PW
423 (home-page "https://pwmt.org/projects/zathura-cb/")
424 (synopsis "Comic book support for zathura (libarchive backend)")
425 (description "The zathura-cb plugin adds comic book support to zathura
426using libarchive.")
427 (license license:zlib)))
428
721a4f7d
PW
429(define-public zathura-ps
430 (package
431 (name "zathura-ps")
06dbfb5d 432 (version "0.2.6")
721a4f7d
PW
433 (source (origin
434 (method url-fetch)
435 (uri
436 (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-"
06dbfb5d 437 version ".tar.xz"))
721a4f7d
PW
438 (sha256
439 (base32
06dbfb5d 440 "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y"))))
721a4f7d 441 (native-inputs `(("pkg-config" ,pkg-config)))
721a4f7d 442 (inputs `(("libspectre" ,libspectre)
721a4f7d 443 ("zathura" ,zathura)))
06dbfb5d 444 (build-system meson-build-system)
721a4f7d 445 (arguments
06dbfb5d 446 `(#:tests? #f ; package does not contain tests
721a4f7d 447 #:phases
06dbfb5d
TGR
448 (modify-phases %standard-phases
449 (add-after 'unpack 'patch-plugin-directory
450 ;; Something of a regression in 0.2.6: the new Meson build system
451 ;; now hard-codes an incorrect plugin directory. Fix it.
452 (lambda* (#:key outputs #:allow-other-keys)
453 (substitute* "meson.build"
454 (("(install_dir:).*" _ key)
455 (string-append key
456 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
457 #t)))))
721a4f7d
PW
458 (home-page "https://pwmt.org/projects/zathura-ps/")
459 (synopsis "PS support for zathura (libspectre backend)")
460 (description "The zathura-ps plugin adds PS support to zathura
461using libspectre.")
462 (license license:zlib)))
463
bac31d1f
PW
464(define-public zathura-djvu
465 (package
466 (name "zathura-djvu")
8b5185c6 467 (version "0.2.9")
bac31d1f
PW
468 (source (origin
469 (method url-fetch)
470 (uri
471 (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-"
7d475dd4 472 version ".tar.xz"))
bac31d1f
PW
473 (sha256
474 (base32
8b5185c6 475 "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln"))))
bac31d1f 476 (native-inputs `(("pkg-config" ,pkg-config)))
bac31d1f
PW
477 (inputs
478 `(("djvulibre" ,djvulibre)
bac31d1f 479 ("zathura" ,zathura)))
7d475dd4 480 (build-system meson-build-system)
bac31d1f 481 (arguments
7d475dd4 482 `(#:tests? #f ; package does not contain tests
bac31d1f 483 #:phases
7d475dd4
TGR
484 (modify-phases %standard-phases
485 (add-after 'unpack 'patch-plugin-directory
486 ;; Something of a regression in 0.2.8: the new Meson build system
487 ;; now hard-codes an incorrect plugin directory. Fix it.
488 (lambda* (#:key outputs #:allow-other-keys)
489 (substitute* "meson.build"
490 (("(install_dir:).*" _ key)
491 (string-append key
492 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
493 #t)))))
bac31d1f
PW
494 (home-page "https://pwmt.org/projects/zathura-djvu/")
495 (synopsis "DjVu support for zathura (DjVuLibre backend)")
496 (description "The zathura-djvu plugin adds DjVu support to zathura
497using the DjVuLibre library.")
498 (license license:zlib)))
499
43dc47fa
MB
500(define-public zathura-pdf-mupdf
501 (package
502 (name "zathura-pdf-mupdf")
ecfdc95a 503 (version "0.3.5")
43dc47fa
MB
504 (source (origin
505 (method url-fetch)
506 (uri
507 (string-append "https://pwmt.org/projects/zathura-pdf-mupdf"
aac2006d 508 "/download/zathura-pdf-mupdf-" version ".tar.xz"))
43dc47fa
MB
509 (sha256
510 (base32
ecfdc95a 511 "1pjwsb7zwclxsvz229fl7y2saf1pv3ifwv3ay8viqxgrp9x3z9hq"))))
43dc47fa 512 (native-inputs `(("pkg-config" ,pkg-config)))
43dc47fa 513 (inputs
3bbd6469 514 `(("jbig2dec" ,jbig2dec)
4bd428a7 515 ("libjpeg" ,libjpeg-turbo)
b42b5afd 516 ("mujs" ,mujs)
43dc47fa
MB
517 ("mupdf" ,mupdf)
518 ("openjpeg" ,openjpeg)
519 ("openssl" ,openssl)
520 ("zathura" ,zathura)))
aac2006d 521 (build-system meson-build-system)
43dc47fa 522 (arguments
aac2006d 523 `(#:tests? #f ; package does not contain tests
a6f2afee
EF
524 #:configure-flags (list (string-append "-Dplugindir="
525 (assoc-ref %outputs "out")
7b046b1b
SB
526 "/lib/zathura")
527 "-Dlink-external=true")
528 #:phases
529 (modify-phases %standard-phases
530 (add-before 'configure 'add-mujs-to-dependencies
531 (lambda _
532 ;; Add mujs to the 'build_dependencies'.
533 (substitute* "meson.build"
534 (("^ libopenjp2 = dependency.*" x)
535 (string-append x " mujs = cc.find_library('mujs')\n"))
536 (("^ libopenjp2")
537 " libopenjp2, mujs")))))))
43dc47fa
MB
538 (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/")
539 (synopsis "PDF support for zathura (mupdf backend)")
540 (description "The zathura-pdf-mupdf plugin adds PDF support to zathura
541by using the @code{mupdf} rendering library.")
542 (license license:zlib)))
543
7708557f
PW
544(define-public zathura-pdf-poppler
545 (package
546 (name "zathura-pdf-poppler")
13d87223 547 (version "0.3.0")
7708557f
PW
548 (source (origin
549 (method url-fetch)
550 (uri
551 (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-"
0ed99053 552 version ".tar.xz"))
7708557f
PW
553 (sha256
554 (base32
13d87223 555 "1vfl4vkyy3rf39r1sqaa7y8113bgkh2bkfq3nn2inis9mrykmk6m"))))
7708557f 556 (native-inputs `(("pkg-config" ,pkg-config)))
7708557f
PW
557 (inputs
558 `(("poppler" ,poppler)
3bbd6469 559 ("zathura" ,zathura)))
0ed99053 560 (build-system meson-build-system)
7708557f 561 (arguments
0ed99053 562 `(#:tests? #f ; package does not include tests
7708557f 563 #:phases
0ed99053
TGR
564 (modify-phases %standard-phases
565 (add-after 'unpack 'patch-plugin-directory
566 ;; Something of a regression in 0.2.9: the new Meson build system
567 ;; now hard-codes an incorrect plugin directory. Fix it.
568 (lambda* (#:key outputs #:allow-other-keys)
569 (substitute* "meson.build"
570 (("(install_dir:).*" _ key)
571 (string-append key
572 "'" (assoc-ref outputs "out") "/lib/zathura'\n")))
573 #t)))))
7708557f
PW
574 (home-page "https://pwmt.org/projects/zathura-pdf-poppler/")
575 (synopsis "PDF support for zathura (poppler backend)")
576 (description "The zathura-pdf-poppler plugin adds PDF support to zathura
577by using the poppler rendering engine.")
578 (license license:zlib)))
579
3e40bb82
PW
580(define-public zathura
581 (package
582 (name "zathura")
01ebd861 583 (version "0.4.5")
3e40bb82
PW
584 (source (origin
585 (method url-fetch)
586 (uri
587 (string-append "https://pwmt.org/projects/zathura/download/zathura-"
eb6a5dab 588 version ".tar.xz"))
3e40bb82
PW
589 (sha256
590 (base32
01ebd861 591 "0b3nrcvykkpv2vm99kijnic2gpfzva520bsjlihaxandzfm9ff8c"))))
3e40bb82 592 (native-inputs `(("pkg-config" ,pkg-config)
f2984d70 593 ("gettext" ,gettext-minimal)
ac847543
MB
594 ("glib:bin" ,glib "bin")
595
eb6a5dab
TGR
596 ;; For building documentation.
597 ("python-sphinx" ,python-sphinx)
598
a42cb6f1
AG
599 ;; For building icons.
600 ("librsvg" ,librsvg)
601
ac847543
MB
602 ;; For tests.
603 ("check" ,check)
60ecc10f 604 ("xorg-server" ,xorg-server-for-tests)))
1d9032fc
MB
605 (inputs `(("sqlite" ,sqlite)))
606 ;; Listed in 'Requires.private' of 'zathura.pc'.
607 (propagated-inputs `(("cairo" ,cairo)
608 ("girara" ,girara)))
3e40bb82
PW
609 (native-search-paths
610 (list (search-path-specification
6bd8ba61 611 (variable "ZATHURA_PLUGINS_PATH")
3e40bb82 612 (files '("lib/zathura")))))
eb6a5dab 613 (build-system meson-build-system)
3e40bb82 614 (arguments
eb6a5dab 615 `(#:phases (modify-phases %standard-phases
ac847543
MB
616 (add-before 'check 'start-xserver
617 ;; Tests require a running X server.
618 (lambda* (#:key inputs #:allow-other-keys)
619 (let ((xorg-server (assoc-ref inputs "xorg-server"))
620 (display ":1"))
621 (setenv "DISPLAY" display)
f0eba502
MB
622
623 ;; On busy machines, tests may take longer than
624 ;; the default of four seconds.
625 (setenv "CK_DEFAULT_TIMEOUT" "20")
626
ac847543
MB
627 ;; Don't fail due to missing '/etc/machine-id'.
628 (setenv "DBUS_FATAL_WARNINGS" "0")
629 (zero? (system (string-append xorg-server "/bin/Xvfb "
630 display " &")))))))))
3e40bb82
PW
631 (home-page "https://pwmt.org/projects/zathura/")
632 (synopsis "Lightweight keyboard-driven PDF viewer")
633 (description "Zathura is a customizable document viewer. It provides a
634minimalistic interface and an interface that mainly focuses on keyboard
635interaction.")
636 (license license:zlib)))
637
0f28ee34
LC
638(define-public podofo
639 (package
640 (name "podofo")
22f00388 641 (version "0.9.6")
0f28ee34
LC
642 (source (origin
643 (method url-fetch)
de67e922
LF
644 (uri (string-append "mirror://sourceforge/podofo/podofo/" version
645 "/podofo-" version ".tar.gz"))
0f28ee34
LC
646 (sha256
647 (base32
37751b48
RW
648 "0wj0y4zcmj4q79wrn3vv3xq4bb0vhhxs8yifafwy9f2sjm83c5p9"))
649 (patches (search-patches "podofo-cmake-3.12.patch"))))
0f28ee34 650 (build-system cmake-build-system)
22f00388
EF
651 (native-inputs
652 `(("cppunit" ,cppunit)
653 ("pkg-config" ,pkg-config)))
654 (inputs
4bd428a7 655 `(("libjpeg" ,libjpeg-turbo)
0f28ee34 656 ("libtiff" ,libtiff)
22f00388 657 ("fontconfig" ,fontconfig)
0f28ee34 658 ("freetype" ,freetype)
22f00388
EF
659 ("libpng" ,libpng)
660 ("lua" ,lua-5.1)
661 ("openssl" ,openssl)
0f28ee34 662 ("zlib" ,zlib)))
cb6a14ba
AE
663 (arguments
664 `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON"
dde70926
AE
665 "-DPODOFO_BUILD_STATIC=ON")
666 #:phases
dc1d3cde
KK
667 (modify-phases %standard-phases
668 (add-before 'configure 'patch
669 (lambda* (#:key inputs #:allow-other-keys)
670 (let ((freetype (assoc-ref inputs "freetype")))
671 ;; Look for freetype include files in the correct place.
672 (substitute* "cmake/modules/FindFREETYPE.cmake"
673 (("/usr/local") freetype)))
674 #t)))))
0f28ee34
LC
675 (home-page "http://podofo.sourceforge.net")
676 (synopsis "Tools to work with the PDF file format")
677 (description
678 "PoDoFo is a C++ library and set of command-line tools to work with the
679PDF file format. It can parse PDF files and load them into memory, and makes
680it easy to modify them and write the changes to disk. It is primarily useful
681for applications that wish to do lower level manipulation of PDF, such as
682extracting content or merging files.")
683 (license license:lgpl2.0+)))
c0b390ed
MB
684
685(define-public mupdf
686 (package
687 (name "mupdf")
d08dc99f 688 (version "1.16.1")
c0b390ed
MB
689 (source
690 (origin
691 (method url-fetch)
76379dca 692 (uri (string-append "https://mupdf.com/downloads/archive/"
51a11b82 693 "mupdf-" version "-source.tar.xz"))
c0b390ed 694 (sha256
c41d97be 695 (base32
d08dc99f 696 "1npmy92lkj41nnc14b4fpq7z62pminy94zsdbrczj22jpn283rvg"))
c0b390ed 697 (modules '((guix build utils)))
b1435fe7
EF
698 (snippet
699 ;; We keep lcms2 since it is different than our lcms.
700 '(begin
701 (for-each
702 (lambda (dir)
703 (delete-file-recursively (string-append "thirdparty/" dir)))
3e4afe02 704 '("freeglut" "freetype" "harfbuzz" "jbig2dec"
b1435fe7
EF
705 "libjpeg" "mujs" "openjpeg" "zlib"))
706 #t))))
c0b390ed
MB
707 (build-system gnu-build-system)
708 (inputs
709 `(("curl" ,curl)
dab2542f 710 ("freeglut" ,freeglut)
c0b390ed 711 ("freetype" ,freetype)
c41d97be 712 ("harfbuzz" ,harfbuzz)
c0b390ed 713 ("jbig2dec" ,jbig2dec)
4bd428a7 714 ("libjpeg" ,libjpeg-turbo)
c0b390ed
MB
715 ("libx11" ,libx11)
716 ("libxext" ,libxext)
1650cf92 717 ("mujs" ,mujs)
c41d97be 718 ("openjpeg" ,openjpeg)
c0b390ed
MB
719 ("openssl" ,openssl)
720 ("zlib" ,zlib)))
721 (native-inputs
722 `(("pkg-config" ,pkg-config)))
723 (arguments
8e755b1b
AE
724 '(#:tests? #f ; no check target
725 #:make-flags (list "CC=gcc"
726 "XCFLAGS=-fpic"
b1435fe7
EF
727 "USE_SYSTEM_LIBS=yes"
728 "USE_SYSTEM_MUJS=yes"
8e755b1b
AE
729 (string-append "prefix=" (assoc-ref %outputs "out")))
730 #:phases (modify-phases %standard-phases
731 (delete 'configure))))
76379dca 732 (home-page "https://mupdf.com")
2274b816 733 (synopsis "Lightweight PDF viewer and toolkit")
c0b390ed
MB
734 (description
735 "MuPDF is a C library that implements a PDF and XPS parsing and
736rendering engine. It is used primarily to render pages into bitmaps,
737but also provides support for other operations such as searching and
738listing the table of contents and hyperlinks.
739
740The library ships with a rudimentary X11 viewer, and a set of command
7e0d513f
EF
741line tools for batch rendering @command{pdfdraw}, rewriting files
742@command{pdfclean}, and examining the file structure @command{pdfshow}.")
e726f093
EF
743 (license (list license:agpl3+
744 license:bsd-3 ; resources/cmaps
745 license:x11 ; thirdparty/lcms2
746 license:silofl1.1 ; resources/fonts/{han,noto,sil,urw}
747 license:asl2.0)))) ; resources/fonts/droid
765f0ac8
RW
748
749(define-public qpdf
750 (package
751 (name "qpdf")
44c95fa6 752 (version "10.0.1")
765f0ac8
RW
753 (source (origin
754 (method url-fetch)
de67e922
LF
755 (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version
756 "/qpdf-" version ".tar.gz"))
8337cb21
EF
757 (sha256
758 (base32
44c95fa6 759 "0yw2cpw7ygfd6jlgpwbi8vsnvv9p55zxp9h17x77z2qq733pf8jx"))))
765f0ac8
RW
760 (build-system gnu-build-system)
761 (arguments
503409b5 762 `(#:disallowed-references (,perl)
0adfe0cc
EF
763 #:phases
764 (modify-phases %standard-phases
765 (add-before 'configure 'patch-paths
766 (lambda _
767 (substitute* "make/libtool.mk"
768 (("SHELL=/bin/bash")
769 (string-append "SHELL=" (which "bash"))))
770 (substitute* (append
771 '("qtest/bin/qtest-driver")
772 (find-files "." "\\.test"))
b5e53019
MW
773 (("/usr/bin/env") (which "env")))
774 #t)))))
765f0ac8 775 (native-inputs
503409b5
LC
776 `(("pkg-config" ,pkg-config)
777 ("perl" ,perl)))
765f0ac8 778 (propagated-inputs
e9a9298b
MB
779 ;; In Requires.private of libqpdf.pc.
780 `(("libjpeg-turbo" ,libjpeg-turbo)
781 ("zlib" ,zlib)))
765f0ac8
RW
782 (synopsis "Command-line tools and library for transforming PDF files")
783 (description
784 "QPDF is a command-line program that does structural, content-preserving
785transformations on PDF files. It could have been called something like
786pdf-to-pdf. It includes support for merging and splitting PDFs and to
787manipulate the list of pages in a PDF file. It is not a PDF viewer or a
788program capable of converting PDF into other formats.")
e9a9298b
MB
789 ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0.
790 ;; Users can still choose to use the old license at their option.
791 (license (list license:asl2.0 license:clarified-artistic))
765f0ac8 792 (home-page "http://qpdf.sourceforge.net/")))
7ad608e4
RW
793
794(define-public xournal
795 (package
796 (name "xournal")
d0e888c3 797 (version "0.4.8.2016")
7ad608e4
RW
798 (source
799 (origin
800 (method url-fetch)
de67e922
LF
801 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
802 "/xournal-" version ".tar.gz"))
7ad608e4
RW
803 (sha256
804 (base32
d0e888c3 805 "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j"))))
7ad608e4
RW
806 (build-system gnu-build-system)
807 (inputs
808 `(("gtk" ,gtk+-2)
809 ("pango" ,pango)
810 ("poppler" ,poppler)
811 ("glib" ,glib)
812 ("libgnomecanvas" ,libgnomecanvas)))
813 (native-inputs
814 `(("pkg-config" ,pkg-config)))
815 (home-page "http://xournal.sourceforge.net/")
816 (synopsis "Notetaking using a stylus")
817 (description
818 "Xournal is an application for notetaking, sketching, keeping a journal
819using a stylus.")
820 (license license:gpl2+)))
3fa2dc27 821
ebbd30ff
NG
822(define-public xournalpp
823 (package
824 (name "xournalpp")
9cb2f28c 825 (version "1.0.18")
ebbd30ff
NG
826 (source
827 (origin
828 (method git-fetch)
829 (uri (git-reference
b0e7b699 830 (url "https://github.com/xournalpp/xournalpp")
ebbd30ff
NG
831 (commit version)))
832 (file-name (git-file-name name version))
833 (sha256
9cb2f28c 834 (base32 "0a9ygbmd4dwgck3k8wsrm2grynqa0adb12wwspzmzvpisbadffjy"))))
ebbd30ff
NG
835 (build-system cmake-build-system)
836 (arguments
837 `(#:configure-flags (list "-DENABLE_CPPUNIT=ON") ;enable tests
838 #:imported-modules ((guix build glib-or-gtk-build-system)
839 ,@%cmake-build-system-modules)
840 #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
841 (guix build cmake-build-system)
842 (guix build utils))
843 #:phases
844 (modify-phases %standard-phases
845 (add-after 'unpack 'fix-permissions-on-po-files
846 (lambda _
ebbd30ff
NG
847 ;; Make sure 'msgmerge' can modify the PO files.
848 (for-each (lambda (po) (chmod po #o666))
849 (find-files "." "\\.po$"))
850 #t))
226bb934
LDB
851 ;; Fix path to addr2line utility, which the crash reporter uses.
852 (add-after 'unpack 'fix-paths
853 (lambda* (#:key inputs #:allow-other-keys)
854 (substitute* "src/util/Stacktrace.cpp"
855 ;; Match only the commandline.
856 (("\"addr2line ")
857 (string-append "\"" (which "addr2line") " ")))
858 #t))
ebbd30ff
NG
859 (add-after 'install 'glib-or-gtk-wrap
860 (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap)))))
861 (native-inputs
862 `(("cppunit" ,cppunit)
ebbd30ff
NG
863 ("gettext" ,gettext-minimal)
864 ("pkg-config" ,pkg-config)))
865 (inputs
866 `(("alsa-lib" ,alsa-lib)
867 ("glib" ,glib)
868 ("gtk+" ,gtk+)
869 ("libsndfile" ,libsndfile)
870 ("libxml2" ,libxml2)
871 ("libzip" ,libzip)
872 ("lua" ,lua) ;FIXME: It cannot find the Lua library.
873 ("poppler" ,poppler)
874 ("portaudio" ,portaudio)
875 ("texlive-bin" ,texlive-bin)))
876 (home-page "https://github.com/xournalpp/xournalpp")
877 (synopsis "Handwriting notetaking software with PDF annotation support")
878 (description "Xournal++ is a hand note taking software written in
879C++ with the target of flexibility, functionality and speed. Stroke
880recognizer and other parts are based on Xournal code.
881
882Xournal++ features:
883
884@itemize
885@item Support for Pen pressure, e.g., Wacom Tablet
886@item Support for annotating PDFs
887@item Fill shape functionality
888@item PDF Export (with and without paper style)
889@item PNG Export (with and without transparent background)
971b57d2 890@item Map different tools / colors etc. to stylus buttons /
ebbd30ff
NG
891mouse buttons
892@item Sidebar with Page Previews with advanced page sorting, PDF
893Bookmarks and Layers (can be individually hidden, editing layer can be
894selected)
895@item enhanced support for image insertion
896@item Eraser with multiple configurations
897@item LaTeX support
898@item bug reporting, autosave, and auto backup tools
899@item Customizeable toolbar, with multiple configurations, e.g., to
900optimize toolbar for portrait / landscape
901@item Page Template definitions
902@item Shape drawing (line, arrow, circle, rectangle)
903@item Shape resizing and rotation
904@item Rotation snapping every 45 degrees
905@item Rect snapping to grid
906@item Audio recording and playback alongside with handwritten notes
907@item Multi Language Support, Like English, German, Italian...
908@item Plugins using LUA Scripting
909@end itemize")
910 (license license:gpl2+)))
911
3fa2dc27
MB
912(define-public python-reportlab
913 (package
914 (name "python-reportlab")
e56ab46b 915 (version "3.5.42")
3fa2dc27
MB
916 (source (origin
917 (method url-fetch)
918 (uri (pypi-uri "reportlab" version))
919 (sha256
920 (base32
e56ab46b 921 "0i17qgm7gzy7pzp240mkpsx9rn8rr67jh5npp5bylv3sd41g48cw"))))
3fa2dc27 922 (build-system python-build-system)
9e378e6a 923 (arguments
2d8270ad
EF
924 '(;; FIXME: There is one test failure, building the pdf manual from source,
925 ;; but it does not cause the build to fail.
926 #:test-target "tests"
927 #:configure-flags (list "--use-system-libart")
928 #:phases
929 (modify-phases %standard-phases
930 (add-after 'unpack 'find-libraries
931 (lambda* (#:key inputs #:allow-other-keys)
932 (let ((libart (assoc-ref inputs "libart-lgpl"))
933 (freetype (assoc-ref inputs "freetype"))
934 (dlt1 (assoc-ref inputs "font-curve-files")))
935 (substitute* "setup.py"
936 (("/usr/include/libart-\\*")
937 (string-append libart "/include/libart-2.0"))
938 (("/usr/include/freetype2")
939 (string-append freetype "/include"))
940 (("http://www.reportlab.com/ftp/pfbfer-20180109.zip")
941 (string-append "file://" dlt1)))
942 #t))))))
ab61ce37 943 (inputs
2d8270ad
EF
944 `(("freetype" ,freetype)
945 ("libart-lgpl" ,libart-lgpl)
946 ("font-curve-files"
947 ,(origin
948 (method url-fetch)
949 (uri "http://www.reportlab.com/ftp/pfbfer-20180109.zip")
950 (sha256
951 (base32
952 "1v0gy4mbx02ys96ssx89420y0njknlrxs2bx64bv4rp8a0al66w5"))))))
3fa2dc27
MB
953 (propagated-inputs
954 `(("python-pillow" ,python-pillow)))
16c76cc4 955 (home-page "https://www.reportlab.com")
3fa2dc27
MB
956 (synopsis "Python library for generating PDFs and graphics")
957 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
958of rich PDF documents, and also creation of charts in a variety of bitmap and
959vector formats.")
d8013ee2 960 (license license:bsd-3)))
3fa2dc27
MB
961
962(define-public python2-reportlab
d8013ee2 963 (package-with-python2 python-reportlab))
8d4169a1
LC
964
965(define-public impressive
966 (package
967 (name "impressive")
7f0bccb5 968 (version "0.12.1")
8d4169a1
LC
969 (source (origin
970 (method url-fetch)
971 (uri (string-append
972 "mirror://sourceforge/impressive/Impressive/"
973 version "/Impressive-" version ".tar.gz"))
974 (sha256
975 (base32
7f0bccb5 976 "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl"))))
8d4169a1
LC
977 (build-system python-build-system)
978
979 ;; TODO: Add dependency on pdftk.
ed9b09e4 980 (inputs `(("python2-pygame" ,python2-pygame)
8d4169a1
LC
981 ("python2-pillow" ,python2-pillow)
982 ("sdl" ,sdl)
983 ("xpdf" ,xpdf)))
984
985 (arguments
986 `(#:python ,python-2
987 #:phases (modify-phases %standard-phases
988 (delete 'build)
989 (delete 'configure)
990 (delete 'check)
991 (replace 'install
992 (lambda* (#:key inputs outputs #:allow-other-keys)
993 ;; There's no 'setup.py' so install things manually.
994 (let* ((out (assoc-ref outputs "out"))
995 (bin (string-append out "/bin"))
996 (man1 (string-append out "/share/man/man1"))
997 (sdl (assoc-ref inputs "sdl"))
998 (xpdf (assoc-ref inputs "xpdf")))
999 (mkdir-p bin)
1000 (copy-file "impressive.py"
1001 (string-append bin "/impressive"))
1002 (wrap-program (string-append bin "/impressive")
1003 `("LIBRARY_PATH" ":" prefix ;for ctypes
1004 (,(string-append sdl "/lib")))
1005 `("PATH" ":" prefix ;for pdftoppm
1006 (,(string-append xpdf "/bin"))))
8d4169a1
LC
1007 (install-file "impressive.1" man1)
1008 #t))))))
1009 (home-page "http://impressive.sourceforge.net")
1010 (synopsis "PDF presentation tool with visual effects")
1011 (description
1012 "Impressive is a tool to display PDF files that provides visual effects
1013such as smooth alpha-blended slide transitions. It provides additional tools
1014such as zooming, highlighting an area of the screen, and a tool to navigate
1015the PDF pages.")
1016 (license license:gpl2)))
f3e22216
JL
1017
1018(define-public fbida
1019 (package
1020 (name "fbida")
b3e5cb4c 1021 (version "2.14")
f3e22216
JL
1022 (home-page "https://www.kraxel.org/blog/linux/fbida/")
1023 (source (origin
1024 (method url-fetch)
1025 (uri (string-append "https://www.kraxel.org/releases/fbida/"
91d42be7 1026 "fbida-" version ".tar.gz"))
f3e22216
JL
1027 (sha256
1028 (base32
b3e5cb4c 1029 "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm"))))
f3e22216
JL
1030 (build-system gnu-build-system)
1031 (arguments
dc1d3cde
KK
1032 '(#:phases
1033 (modify-phases %standard-phases
b3e5cb4c 1034 (add-after 'unpack 'patch-FHS-file-names
dc1d3cde
KK
1035 (lambda _
1036 (substitute* "mk/Autoconf.mk"
b3e5cb4c 1037 (("/bin/echo") "echo")
dc1d3cde
KK
1038 (("/sbin/ldconfig -p") "echo lib")) #t))
1039 (delete 'configure))
f3e22216
JL
1040 #:tests? #f
1041 #:make-flags (list "CC=gcc"
1042 (string-append "prefix=" (assoc-ref %outputs "out")))))
4bd428a7 1043 (inputs `(("libjpeg" ,libjpeg-turbo)
f3e22216
JL
1044 ("curl" ,curl)
1045 ("libtiff" ,libtiff)
1046 ("libudev" ,eudev)
1047 ("libwebp" ,libwebp)
1048 ("libdrm" ,libdrm)
1049 ("imagemagick" ,imagemagick)
1050 ("giflib" ,giflib)
1051 ("glib" ,glib)
1052 ("cairo-xcb" ,cairo-xcb)
1053 ("freetype" ,freetype)
1054 ("fontconfig" ,fontconfig)
1055 ("libexif" ,libexif)
1056 ("mesa" ,mesa)
1057 ("libepoxy" ,libepoxy)
1058 ("libpng" ,libpng)
1059 ("poppler" ,poppler)))
1060 (native-inputs `(("pkg-config" ,pkg-config)))
1061 (synopsis "Framebuffer and drm-based image viewer")
1062 (description
1063 "fbida contains a few applications for viewing and editing images on
1064the framebuffer.")
1065
1066 (license license:gpl2+)))
5d68e9d6
AI
1067
1068(define-public pdf2svg
1069 (package
1070 (name "pdf2svg")
1071 (version "0.2.3")
1072 (source (origin
1300dc4b
RW
1073 (method git-fetch)
1074 (uri (git-reference
b0e7b699 1075 (url "https://github.com/dawbarton/pdf2svg")
1300dc4b
RW
1076 (commit (string-append "v" version))))
1077 (file-name (git-file-name name version))
5d68e9d6
AI
1078 (sha256
1079 (base32
1300dc4b 1080 "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k"))))
5d68e9d6
AI
1081 (build-system gnu-build-system)
1082 (inputs
1083 `(("cairo" ,cairo)
1084 ("poppler" ,poppler)))
1085 (native-inputs
1086 `(("pkg-config" ,pkg-config)))
1087 (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/")
1088 (synopsis "PDF to SVG converter")
1089 (description "@command{pdf2svg} is a simple command-line PDF to SVG
1090converter using the Poppler and Cairo libraries.")
1091 (license license:gpl2+)))
ad5a7d49
HG
1092
1093(define-public python-pypdf2
1094 (package
1095 (name "python-pypdf2")
1096 (version "1.26.0")
1097 (source (origin
1098 (method url-fetch)
1099 (uri (pypi-uri "PyPDF2" version))
1100 (sha256
1101 (base32
1102 "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2"))))
1103 (build-system python-build-system)
1104 (arguments
1105 `(#:phases
1106 (modify-phases %standard-phases
1107 (add-after
1108 'unpack 'patch-test-suite
1109 (lambda _
1110 ;; The text-file needs to be opened in binary mode for Python 3,
1111 ;; so patch in the "b"
1112 (substitute* "Tests/tests.py"
1113 (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line)
1114 (string-append line "b")))
1115 #t))
1116 (replace 'check
1117 (lambda _
60b88466 1118 (invoke "python" "-m" "unittest" "Tests.tests"))))))
ad5a7d49
HG
1119 (home-page "http://mstamy2.github.com/PyPDF2")
1120 (synopsis "Pure Python PDF toolkit")
1121 (description "PyPDF2 is a pure Python PDF library capable of:
1122
1123@enumerate
1124@item extracting document information (title, author, …)
1125@item splitting documents page by page
1126@item merging documents page by page
1127@item cropping pages
1128@item merging multiple pages into a single page
1129@item encrypting and decrypting PDF files
1130@end enumerate
1131
1132By being pure Python, it should run on any Python platform without any
1133dependencies on external libraries. It can also work entirely on
1134@code{StringIO} objects rather than file streams, allowing for PDF
1135manipulation in memory. It is therefore a useful tool for websites that
1136manage or manipulate PDFs.")
1137 (license license:bsd-3)))
1138
1139(define-public python2-pypdf2
1140 (package-with-python2 python-pypdf2))
c68e8591
HG
1141
1142(define-public python2-pypdf
1143 (package
1144 (name "python2-pypdf")
1145 (version "1.13")
1146 (source (origin
1147 (method url-fetch)
1148 (uri (pypi-uri "pyPdf" version))
1149 (sha256
1150 (base32
1151 "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s"))))
1152 (build-system python-build-system)
1153 (arguments
1154 `(#:tests? #f ; no tests
1155 #:python ,python-2))
1156 (home-page "http://pybrary.net/pyPdf/")
1157 (synopsis "Pure Python PDF toolkit")
1158 (description "PyPDF2 is a pure Python PDF toolkit.
1159
1160Note: This module isn't maintained anymore. For new projects please use
1161python-pypdf2 instead.")
1162 (license license:bsd-3)))
99abcdbd 1163
0cd4a746
BS
1164(define-public pdfarranger
1165 (package
1166 (name "pdfarranger")
1167 (version "1.3.1")
1168 (source
1169 (origin
1170 (method git-fetch)
1171 (uri (git-reference
b0e7b699 1172 (url "https://github.com/jeromerobert/pdfarranger")
0cd4a746
BS
1173 (commit version)))
1174 (file-name (git-file-name name version))
1175 (sha256
1176 (base32 "1f8m8r81322i97wkqpmf7a4kiwnq244n6cnbldh03jc49vwq2kxx"))))
1177 (build-system python-build-system)
1178 (arguments
8b438f85
LC
1179 '(#:tests? #f ;no tests
1180 #:phases (modify-phases %standard-phases
1181 (add-after 'install 'wrap-for-typelib
1182 (lambda* (#:key inputs outputs #:allow-other-keys)
1183 (let* ((out (assoc-ref outputs "out"))
1184 (program (string-append out "/bin/pdfarranger")))
1185 (wrap-program program
1186 `("GI_TYPELIB_PATH" ":" prefix
1187 (,(getenv "GI_TYPELIB_PATH"))))
1188 #t))))))
0cd4a746
BS
1189 (native-inputs
1190 `(("intltool" ,intltool)
1191 ("python-distutils-extra" ,python-distutils-extra)))
1192 (propagated-inputs
1193 `(("gtk+" ,gtk+)
1194 ("poppler" ,poppler)
1195 ("python-pycairo" ,python-pycairo)
1196 ("python-pygobject" ,python-pygobject)
1197 ("python-pypdf2" ,python-pypdf2)))
1198 (home-page "https://github.com/jeromerobert/pdfarranger")
1199 (synopsis "Merge, split and re-arrange pages from PDF documents")
1200 (description
1201 "PDF Arranger is a small application which allows one to merge or split
1202PDF documents and rotate, crop and rearrange their pages using an interactive
1203and intuitive graphical interface.
1204
1205PDF Arranger was formerly known as PDF-Shuffler.")
1206 (license license:gpl3+)))
1207
99abcdbd
HG
1208(define-public pdfposter
1209 (package
1210 (name "pdfposter")
60ba9d8c 1211 (version "0.7.post1")
99abcdbd
HG
1212 (source (origin
1213 (method url-fetch)
60ba9d8c 1214 (uri (pypi-uri "pdftools.pdfposter" version))
99abcdbd
HG
1215 (sha256
1216 (base32
60ba9d8c 1217 "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j"))))
99abcdbd
HG
1218 (build-system python-build-system)
1219 (arguments
60ba9d8c 1220 `(#:tests? #f)) ; test-suite not included in source archive
99abcdbd 1221 (inputs
60ba9d8c 1222 `(("python-pypdf2" ,python-pypdf2)))
99abcdbd
HG
1223 (home-page "https://pythonhosted.org/pdftools.pdfposter/")
1224 (synopsis "Scale and tile PDF images/pages to print on multiple pages")
1225 (description "@command{pdfposter} can be used to create a large poster by
d6901d93 1226building it from multiple pages and/or printing it on large media. It expects
99abcdbd
HG
1227as input a PDF file, normally printing on a single page. The output is again
1228a PDF file, maybe containing multiple pages together building the poster. The
1229input page will be scaled to obtain the desired size.
1230
1231This is much like @command{poster} does for Postscript files, but working with
1232PDF. Since sometimes @command{poster} does not like your files converted from
1233PDF. Indeed @command{pdfposter} was inspired by @command{poster}.")
1234 (license license:gpl3+)))
e05fc441
RS
1235
1236(define-public pdfgrep
1237 (package
1238 (name "pdfgrep")
7da4dbb3 1239 (version "2.1.2")
e05fc441
RS
1240 (source
1241 (origin
1242 (method url-fetch)
1243 (uri (string-append "https://pdfgrep.org/download/"
1244 name "-" version ".tar.gz"))
1245 (sha256
1246 (base32
7da4dbb3 1247 "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf"))))
e05fc441
RS
1248 (build-system gnu-build-system)
1249 (native-inputs
1250 `(("pkg-config" ,pkg-config)))
1251 (inputs
1252 `(("libgcrypt" ,libgcrypt)
1253 ("pcre" ,pcre)
1254 ("poppler" ,poppler)))
1255 (home-page "https://pdfgrep.org")
1256 (synopsis "Command-line utility to search text in PDF files")
1257 (description
1258 "Pdfgrep searches in pdf files for strings matching a regular expression.
1259Support some GNU grep options as file name output, page number output,
1260optional case insensitivity, count occurrences, color highlights and search in
1261multiple files.")
1262 (license license:gpl2+)))
e2ec95c4
RW
1263
1264(define-public pdfpc
1265 (package
1266 (name "pdfpc")
45320ad8 1267 (version "4.4.0")
e2ec95c4
RW
1268 (source
1269 (origin
1270 (method git-fetch)
1271 (uri (git-reference
b0e7b699 1272 (url "https://github.com/pdfpc/pdfpc")
e2ec95c4
RW
1273 (commit (string-append "v" version))))
1274 (file-name (git-file-name name version))
1275 (sha256
45320ad8 1276 (base32 "0vh2r32akvasdrghkaq7ard24r2qncp34jfiyshi3zxabm9bhfaa"))))
e2ec95c4
RW
1277 (build-system cmake-build-system)
1278 (arguments '(#:tests? #f)) ; no test target
1279 (inputs
1280 `(("cairo" ,cairo)
1281 ("gtk+" ,gtk+)
1282 ("gstreamer" ,gstreamer)
1283 ("gst-plugins-base" ,gst-plugins-base)
1284 ("libgee" ,libgee)
1285 ("poppler" ,poppler)
1286 ("pango" ,pango)
1287 ("vala" ,vala)))
1288 (native-inputs
1289 `(("pkg-config" ,pkg-config)))
1290 (home-page "https://pdfpc.github.io/")
1291 (synopsis "Presenter console with multi-monitor support for PDF files")
1292 (description
1293 "pdfpc is a presentation viewer application which uses multi-monitor
1294output to provide meta information to the speaker during the presentation. It
1295is able to show a normal presentation window on one screen, while showing a
1296more sophisticated overview on the other one providing information like a
1297picture of the next slide, as well as the left over time till the end of the
1298presentation. The input files processed by pdfpc are PDF documents.")
1299 (license license:gpl2+)))
a773f141
RW
1300
1301(define-public paps
a26b73b6
TGR
1302 (package
1303 (name "paps")
1304 (version "0.7.1")
1305 (source
1306 (origin
1307 (method url-fetch)
1308 (uri (string-append "https://github.com/dov/paps/releases/download/v"
1309 version "/paps-" version ".tar.gz"))
1310 (sha256
1311 (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s"))))
1312 (build-system gnu-build-system)
1313 (inputs
1314 `(("pango" ,pango)))
1315 (native-inputs
1316 `(("intltool" ,intltool)
1317 ("pkg-config" ,pkg-config)))
1318 (home-page "https://github.com/dov/paps")
1319 (synopsis "Pango to PostScript converter")
1320 (description
1321 "Paps reads a UTF-8 encoded file and generates a PostScript language
6fdd40b3 1322rendering of the file through the Pango Cairo back end.")
a26b73b6 1323 (license license:lgpl2.0+)))
667c004c
AI
1324
1325(define-public stapler
1326 (package
1327 (name "stapler")
09dfb0c4 1328 (version "1.0.0")
667c004c
AI
1329 (source
1330 (origin
09dfb0c4
KK
1331 (method url-fetch)
1332 (uri (pypi-uri "stapler" version))
667c004c
AI
1333 (sha256
1334 (base32
09dfb0c4 1335 "0b2lbm3f79cdxcsagwhzihbzwahjabxqmbws0c8ki25gpdnygdd7"))))
667c004c 1336 (build-system python-build-system)
667c004c 1337 (arguments
09dfb0c4 1338 '(#:phases
667c004c 1339 (modify-phases %standard-phases
09dfb0c4 1340 (add-after 'unpack 'fix-more-itertools-version-requirement
667c004c 1341 (lambda _
09dfb0c4
KK
1342 ;; Tests require an version of the more-itertools module older
1343 ;; than the one we have packaged.
667c004c 1344 (substitute* "setup.py"
09dfb0c4 1345 (("more-itertools>=2\\.2,<6\\.0\\.0") "more-itertools>=2.2"))
667c004c 1346 #t)))))
09dfb0c4
KK
1347 (propagated-inputs
1348 `(("python-more-itertools" ,python-more-itertools)
1349 ("python-pypdf2" ,python-pypdf2)))
667c004c
AI
1350 (home-page "https://github.com/hellerbarde/stapler")
1351 (synopsis "PDF manipulation tool")
1352 (description "Stapler is a pure Python alternative to PDFtk, a tool for
1353manipulating PDF documents from the command line. It supports
1354
1355@itemize
1356@item cherry-picking pages and concatenating them into a new file
1357@item splitting a PDF document into single pages each in its own file
1358@item merging PDF documents with their pages interleaved
1359@item displaying metadata in a PDF document
1360@item displaying the mapping between logical and physical page numbers
1361@end itemize")
1362 (license license:bsd-3)))
77e0cebc
HG
1363
1364(define-public weasyprint
1365 (package
1366 (name "weasyprint")
c0ba0237 1367 (version "51")
77e0cebc
HG
1368 (source
1369 (origin
1370 (method url-fetch)
1371 (uri (pypi-uri "WeasyPrint" version))
1372 (sha256
c0ba0237 1373 (base32 "0skdzwq7cd715dnnds6abx0k0xmmnmsqp0vb1r1w20sg7abp3sdk"))
77e0cebc
HG
1374 (patches (search-patches "weasyprint-library-paths.patch"))))
1375 (build-system python-build-system)
1376 (arguments
1377 `(#:phases
1378 (modify-phases %standard-phases
1379 (add-after 'unpack 'patch-library-paths
1380 (lambda* (#:key inputs #:allow-other-keys)
1381 (let ((fontconfig (assoc-ref inputs "fontconfig"))
1382 (glib (assoc-ref inputs "glib"))
1383 (pango (assoc-ref inputs "pango"))
1384 (pangoft2 (assoc-ref inputs "pangoft2")))
1385 (substitute* "weasyprint/fonts.py"
1386 (("@fontconfig@")
1387 (string-append fontconfig "/lib/libfontconfig.so"))
1388 (("@pangoft2@")
1389 (string-append pango "/lib/libpangoft2-1.0.so")))
1390 (substitute* "weasyprint/text.py"
1391 (("@gobject@")
1392 (string-append glib "/lib/libgobject-2.0.so"))
1393 (("@pango@")
1394 (string-append pango "/lib/libpango-1.0.so"))
1395 (("@pangocairo@")
1396 (string-append pango "/lib/libpangocairo-1.0.so"))))))
1397 (add-after 'unpack 'remove-pytest-options
1398 (lambda _
1399 (substitute* "setup.cfg"
1400 ;; flake8 and isort syntax checks fail, which is not our
c0ba0237 1401 ;; business.
77e0cebc
HG
1402 (("addopts = --flake8 --isort") ""))))
1403 (replace 'check
1404 (lambda _
c0ba0237 1405 ;; Run pytest, excluding one failing test.
77e0cebc
HG
1406 (invoke "pytest" "-k" "not test_flex_column_wrap_reverse"))))))
1407 (inputs
1408 `(("fontconfig" ,fontconfig)
1409 ("glib" ,glib)
1410 ("pango" ,pango)))
1411 (propagated-inputs
1412 `(("gdk-pixbuf" ,gdk-pixbuf)
1413 ("python-cairocffi" ,python-cairocffi)
1414 ("python-cairosvg" ,python-cairosvg)
1415 ("python-cffi" ,python-cffi)
1416 ("python-cssselect2" ,python-cssselect2)
1417 ("python-html5lib" ,python-html5lib)
1418 ("python-pyphen" ,python-pyphen)
1419 ("python-tinycss2" ,python-tinycss2)))
1420 (native-inputs
1421 `(("python-pytest-cov" ,python-pytest-cov)
1422 ("python-pytest-runner" ,python-pytest-runner)))
1423 (home-page "https://weasyprint.org/")
1424 (synopsis "Document factory for creating PDF files from HTML")
1425 (description "WeasyPrint helps web developers to create PDF documents. It
1426turns simple HTML pages into gorgeous statistical reports, invoices, tickets,
1427etc.
1428
1429From a technical point of view, WeasyPrint is a visual rendering engine for
1430HTML and CSS that can export to PDF and PNG. It aims to support web standards
1431for printing.
1432
1433It is based on various libraries but not on a full rendering engine like
1434WebKit or Gecko. The CSS layout engine is written in Python, designed for
1435pagination, and meant to be easy to hack on. Weasyprint can also be used as a
1436python library.
1437
1438Keywords: html2pdf, htmltopdf")
1439 (license license:bsd-3)))