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