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