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