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