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