Commit | Line | Data |
---|---|---|
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> |
aae8ba47 | 4 | ;;; Copyright © 2014, 2015, 2016 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> |
86008652 | 7 | ;;; Coypright © 2016 ng0 <ng0@we.make.ritual.n0.is> |
5f8fc5e3 | 8 | ;;; Coypright © 2016 Efraim Flashner <efraim@flashner.co.il> |
3fa2dc27 | 9 | ;;; Coypright © 2016 Marius Bakke <mbakke@fastmail.com> |
8d4169a1 | 10 | ;;; Coypright © 2016 Ludovic Courtès <ludo@gnu.org> |
f3e22216 | 11 | ;;; Coypright © 2016 Julien Lepiller <julien@lepiller.eu> |
135eb524 AE |
12 | ;;; |
13 | ;;; This file is part of GNU Guix. | |
14 | ;;; | |
15 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
16 | ;;; under the terms of the GNU General Public License as published by | |
17 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
18 | ;;; your option) any later version. | |
19 | ;;; | |
20 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
21 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
22 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
23 | ;;; GNU General Public License for more details. | |
24 | ;;; | |
25 | ;;; You should have received a copy of the GNU General Public License | |
26 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
27 | ||
28 | (define-module (gnu packages pdf) | |
b5b73a82 | 29 | #:use-module ((guix licenses) #:prefix license:) |
135eb524 AE |
30 | #:use-module (guix packages) |
31 | #:use-module (guix download) | |
ab1c2319 | 32 | #:use-module (guix utils) |
135eb524 | 33 | #:use-module (guix build-system gnu) |
0f28ee34 | 34 | #:use-module (guix build-system cmake) |
3efb57ea | 35 | #:use-module (guix build-system python) |
8d4169a1 | 36 | #:use-module (guix build-system trivial) |
135eb524 | 37 | #:use-module (gnu packages) |
aae8ba47 | 38 | #:use-module (gnu packages autotools) |
8d4169a1 LC |
39 | #:use-module (gnu packages base) |
40 | #:use-module (gnu packages bash) | |
135eb524 | 41 | #:use-module (gnu packages compression) |
a86177d6 | 42 | #:use-module (gnu packages fontutils) |
8d4169a1 | 43 | #:use-module (gnu packages game-development) |
14ecc0ef | 44 | #:use-module (gnu packages ghostscript) |
3e40bb82 | 45 | #:use-module (gnu packages databases) |
bac31d1f | 46 | #:use-module (gnu packages djvu) |
3e40bb82 PW |
47 | #:use-module (gnu packages gettext) |
48 | #:use-module (gnu packages backup) | |
14ecc0ef | 49 | #:use-module (gnu packages lesstif) |
f3e22216 JL |
50 | #:use-module (gnu packages linux) |
51 | #:use-module (gnu packages xdisorg) | |
52 | #:use-module (gnu packages imagemagick) | |
53 | #:use-module (gnu packages gl) | |
54 | #:use-module (gnu packages photo) | |
e55354b8 | 55 | #:use-module (gnu packages image) |
14ecc0ef | 56 | #:use-module (gnu packages pkg-config) |
8410cb62 | 57 | #:use-module (gnu packages qt) |
8db824ba | 58 | #:use-module (gnu packages xorg) |
7ad608e4 | 59 | #:use-module (gnu packages gnome) |
8db824ba LC |
60 | #:use-module (gnu packages glib) |
61 | #:use-module (gnu packages gtk) | |
0f28ee34 | 62 | #:use-module (gnu packages lua) |
c0b390ed | 63 | #:use-module (gnu packages curl) |
765f0ac8 RW |
64 | #:use-module (gnu packages pcre) |
65 | #:use-module (gnu packages perl) | |
3fa2dc27 | 66 | #:use-module (gnu packages python) |
8d4169a1 | 67 | #:use-module (gnu packages sdl) |
cc2b77df | 68 | #:use-module (gnu packages tls) |
8db824ba | 69 | #:use-module (srfi srfi-1)) |
135eb524 AE |
70 | |
71 | (define-public poppler | |
72 | (package | |
73 | (name "poppler") | |
1d3d7fbd | 74 | (version "0.47.0") |
135eb524 AE |
75 | (source (origin |
76 | (method url-fetch) | |
5cc3096c | 77 | (uri (string-append "https://poppler.freedesktop.org/poppler-" |
8befb33d | 78 | version ".tar.xz")) |
6983ba56 SB |
79 | (sha256 |
80 | (base32 | |
1d3d7fbd | 81 | "0hnjkcqqk87dw3hlda4gh4l7brkslniax9a79g772jn3iwiffwmq")))) |
135eb524 | 82 | (build-system gnu-build-system) |
6983ba56 | 83 | ;; FIXME: |
a25fe6d6 | 84 | ;; use libcurl: no |
135eb524 AE |
85 | (inputs `(("fontconfig" ,fontconfig) |
86 | ("freetype" ,freetype) | |
7363cda4 | 87 | ("libjpeg" ,libjpeg) |
a25fe6d6 | 88 | ("libpng" ,libpng) |
135eb524 | 89 | ("libtiff" ,libtiff) |
927d4d9b RW |
90 | ("lcms" ,lcms) |
91 | ("openjpeg-1" ,openjpeg-1) | |
8db824ba LC |
92 | ("zlib" ,zlib) |
93 | ||
94 | ;; To build poppler-glib (as needed by Evince), we need Cairo and | |
95 | ;; GLib. But of course, that Cairo must not depend on Poppler. | |
96 | ("cairo" ,(package (inherit cairo) | |
97 | (inputs (alist-delete "poppler" | |
98 | (package-inputs cairo))))) | |
99 | ("glib" ,glib))) | |
c4c4cc05 | 100 | (native-inputs |
426adbe8 | 101 | `(("pkg-config" ,pkg-config) |
6983ba56 SB |
102 | ("glib" ,glib "bin") ; glib-mkenums, etc. |
103 | ("gobject-introspection" ,gobject-introspection))) | |
135eb524 AE |
104 | (arguments |
105 | `(#:tests? #f ; no test data provided with the tarball | |
a25fe6d6 | 106 | #:configure-flags |
7363cda4 | 107 | '("--enable-xpdf-headers" ; to install header files |
a8938c88 LC |
108 | "--enable-zlib" |
109 | ||
110 | ;; Saves 8 MiB of .a files. | |
111 | "--disable-static") | |
927d4d9b | 112 | #:phases |
fb0c4d1a EF |
113 | (modify-phases %standard-phases |
114 | (add-before 'configure 'setenv | |
115 | (lambda _ | |
116 | (setenv "CPATH" | |
117 | (string-append (assoc-ref %build-inputs "openjpeg-1") | |
118 | "/include/openjpeg-1.5" | |
119 | ":" (or (getenv "CPATH") "")))))))) | |
35b9e423 | 120 | (synopsis "PDF rendering library") |
135eb524 AE |
121 | (description |
122 | "Poppler is a PDF rendering library based on the xpdf-3.0 code base.") | |
14ecc0ef | 123 | (license license:gpl2+) |
5f8fc5e3 | 124 | (home-page "https://poppler.freedesktop.org/"))) |
14ecc0ef | 125 | |
8410cb62 RW |
126 | (define-public poppler-qt4 |
127 | (package (inherit poppler) | |
128 | (name "poppler-qt4") | |
129 | (inputs `(("qt-4" ,qt-4) | |
130 | ,@(package-inputs poppler))) | |
131 | (synopsis "Qt4 frontend for the Poppler PDF rendering library"))) | |
132 | ||
f22debac RJ |
133 | (define-public poppler-qt5 |
134 | (package (inherit poppler) | |
135 | (name "poppler-qt5") | |
13297861 | 136 | (inputs `(("qtbase" ,qtbase) |
f22debac | 137 | ,@(package-inputs poppler))) |
ab1c2319 DC |
138 | (arguments |
139 | (substitute-keyword-arguments (package-arguments poppler) | |
140 | ((#:configure-flags flags) | |
141 | `(cons "CXXFLAGS=-std=gnu++11" ,flags)))) | |
f22debac RJ |
142 | (synopsis "Qt5 frontend for the Poppler PDF rendering library"))) |
143 | ||
3efb57ea RW |
144 | (define-public python-poppler-qt4 |
145 | (package | |
146 | (name "python-poppler-qt4") | |
147 | (version "0.24.0") | |
148 | (source | |
149 | (origin | |
150 | (method url-fetch) | |
151 | (uri (string-append "https://pypi.python.org/packages/source/p" | |
152 | "/python-poppler-qt4/python-poppler-qt4-" | |
153 | version ".tar.gz")) | |
154 | (sha256 | |
155 | (base32 | |
156 | "0x63niylkk4q3h3ay8zrk3m1xiik0x3hlr4gvj7kswx48qi1vb99")))) | |
157 | (build-system python-build-system) | |
158 | (arguments | |
159 | `(#:phases | |
160 | (modify-phases %standard-phases | |
161 | (add-after | |
162 | 'unpack 'patch-poppler-include-paths | |
163 | (lambda _ | |
164 | (substitute* (find-files "." "poppler-.*\\.sip") | |
165 | (("qt4/poppler-.*\\.h" header) | |
166 | (string-append "poppler/" header))) | |
167 | #t))))) | |
168 | (native-inputs | |
169 | `(("pkg-config" ,pkg-config))) | |
170 | (inputs | |
171 | `(("python-sip" ,python-sip) | |
172 | ("python-pyqt-4" ,python-pyqt-4) | |
173 | ("poppler-qt4" ,poppler-qt4))) | |
174 | (home-page "https://pypi.python.org/pypi/python-poppler-qt4") | |
175 | (synopsis "Python bindings for Poppler-Qt4") | |
176 | (description | |
177 | "This package provides Python bindings for the Qt4 interface of the | |
178 | Poppler PDF rendering library.") | |
179 | (license license:lgpl2.1+))) | |
180 | ||
aae8ba47 RW |
181 | (define-public libharu |
182 | (package | |
183 | (name "libharu") | |
184 | (version "2.3.0") | |
185 | (source (origin | |
186 | (method url-fetch) | |
187 | (uri (string-append "https://github.com/libharu/libharu/archive/" | |
188 | "RELEASE_" | |
189 | (string-join (string-split version #\.) "_") | |
190 | ".tar.gz")) | |
191 | (file-name (string-append name "-" version ".tar.gz")) | |
192 | (sha256 | |
193 | (base32 | |
194 | "1lm4v539y9cb1lvbq387j57sy7yxda3yv8b1pk8m6zazbp66i7lg")))) | |
195 | (build-system gnu-build-system) | |
196 | (arguments | |
197 | `(#:configure-flags | |
198 | (list (string-append "--with-zlib=" | |
199 | (assoc-ref %build-inputs "zlib")) | |
200 | (string-append "--with-png=" | |
201 | (assoc-ref %build-inputs "libpng"))) | |
202 | #:phases | |
203 | (modify-phases %standard-phases | |
204 | (add-before 'configure 'autogen | |
205 | (lambda _ (zero? (system* "autoreconf" "-vif"))))))) | |
206 | (inputs | |
207 | `(("zlib" ,zlib) | |
208 | ("libpng" ,libpng))) | |
209 | (native-inputs | |
210 | `(("autoconf" ,autoconf) | |
211 | ("automake" ,automake) | |
212 | ("libtool" ,libtool))) | |
213 | (home-page "http://libharu.org/") | |
214 | (synopsis "Library for generating PDF files") | |
215 | (description | |
216 | "libHaru is a library for generating PDF files. libHaru does not support | |
217 | reading and editing of existing PDF files.") | |
218 | (license license:zlib))) | |
219 | ||
14ecc0ef AE |
220 | (define-public xpdf |
221 | (package | |
222 | (name "xpdf") | |
f410c110 | 223 | (version "3.04") |
14ecc0ef AE |
224 | (source (origin |
225 | (method url-fetch) | |
226 | (uri (string-append "ftp://ftp.foolabs.com/pub/xpdf/xpdf-" | |
227 | version ".tar.gz")) | |
228 | (sha256 (base32 | |
f410c110 | 229 | "1rbp54mr3z2x3a3a1qmz8byzygzi223vckfam9ib5g1sfds0qf8i")))) |
14ecc0ef AE |
230 | (build-system gnu-build-system) |
231 | (inputs `(("freetype" ,freetype) | |
19cb5170 | 232 | ("gs-fonts" ,gs-fonts) |
14ecc0ef AE |
233 | ("lesstif" ,lesstif) |
234 | ("libpaper" ,libpaper) | |
235 | ("libx11" ,libx11) | |
236 | ("libxext" ,libxext) | |
237 | ("libxp" ,libxp) | |
238 | ("libxpm" ,libxpm) | |
239 | ("libxt" ,libxt) | |
f410c110 | 240 | ("libpng" ,libpng) |
01eafd38 | 241 | ("zlib" ,zlib))) |
14ecc0ef AE |
242 | (arguments |
243 | `(#:tests? #f ; there is no check target | |
bdbf227f AE |
244 | #:parallel-build? #f ; build fails randomly on 8-way machines |
245 | #:configure-flags | |
246 | (list (string-append "--with-freetype2-includes=" | |
247 | (assoc-ref %build-inputs "freetype") | |
248 | "/include/freetype2")) | |
19cb5170 AE |
249 | #:phases |
250 | (alist-replace | |
251 | 'install | |
252 | (lambda* (#:key outputs inputs #:allow-other-keys #:rest args) | |
253 | (let* ((install (assoc-ref %standard-phases 'install)) | |
254 | (out (assoc-ref outputs "out")) | |
255 | (xpdfrc (string-append out "/etc/xpdfrc")) | |
256 | (gs-fonts (assoc-ref inputs "gs-fonts"))) | |
257 | (apply install args) | |
258 | (substitute* xpdfrc | |
259 | (("/usr/local/share/ghostscript/fonts") | |
260 | (string-append gs-fonts "/share/fonts/type1/ghostscript")) | |
261 | (("#fontFile") "fontFile")))) | |
262 | %standard-phases))) | |
9e771e3b | 263 | (synopsis "Viewer for PDF files based on the Motif toolkit") |
14ecc0ef | 264 | (description |
e881752c | 265 | "Xpdf is a viewer for Portable Document Format (PDF) files.") |
14ecc0ef AE |
266 | (license license:gpl3) ; or gpl2, but not gpl2+ |
267 | (home-page "http://www.foolabs.com/xpdf/"))) | |
0f28ee34 | 268 | |
b3886e0c PW |
269 | (define-public zathura-cb |
270 | (package | |
271 | (name "zathura-cb") | |
8dd739e1 | 272 | (version "0.1.5") |
b3886e0c PW |
273 | (source (origin |
274 | (method url-fetch) | |
275 | (uri | |
276 | (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-" | |
277 | version ".tar.gz")) | |
278 | (sha256 | |
279 | (base32 | |
8dd739e1 | 280 | "1zbazysdjwwnzw01qlnzyixwmsi8rqskc76mp81qcr3rpl96jprp")))) |
b3886e0c PW |
281 | (native-inputs `(("pkg-config" ,pkg-config))) |
282 | (propagated-inputs `(("girara" ,girara))) | |
283 | (inputs `(("libarchive" ,libarchive) | |
284 | ("gtk+" ,gtk+) | |
285 | ("zathura" ,zathura))) | |
286 | (build-system gnu-build-system) | |
287 | (arguments | |
b1982b80 MW |
288 | `(#:make-flags (list (string-append "PREFIX=" %output) |
289 | (string-append "PLUGINDIR=" %output "/lib/zathura") | |
290 | "CC=gcc") | |
b3886e0c PW |
291 | #:tests? #f ; Package does not contain tests. |
292 | #:phases | |
293 | (alist-delete 'configure %standard-phases))) | |
294 | (home-page "https://pwmt.org/projects/zathura-cb/") | |
295 | (synopsis "Comic book support for zathura (libarchive backend)") | |
296 | (description "The zathura-cb plugin adds comic book support to zathura | |
297 | using libarchive.") | |
298 | (license license:zlib))) | |
299 | ||
721a4f7d PW |
300 | (define-public zathura-ps |
301 | (package | |
302 | (name "zathura-ps") | |
402a7547 | 303 | (version "0.2.3") |
721a4f7d PW |
304 | (source (origin |
305 | (method url-fetch) | |
306 | (uri | |
307 | (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-" | |
308 | version ".tar.gz")) | |
309 | (sha256 | |
310 | (base32 | |
402a7547 | 311 | "18wsfy8pqficdgj8wy2aws7j4fy8z78157rhqk17mj5f295zgvm9")))) |
721a4f7d PW |
312 | (native-inputs `(("pkg-config" ,pkg-config))) |
313 | (propagated-inputs `(("girara" ,girara))) | |
314 | (inputs `(("libspectre" ,libspectre) | |
315 | ("gtk+" ,gtk+) | |
316 | ("zathura" ,zathura))) | |
317 | (build-system gnu-build-system) | |
318 | (arguments | |
b1982b80 MW |
319 | `(#:make-flags (list (string-append "PREFIX=" %output) |
320 | (string-append "PLUGINDIR=" %output "/lib/zathura") | |
321 | "CC=gcc") | |
721a4f7d PW |
322 | #:tests? #f ; Package does not contain tests. |
323 | #:phases | |
324 | (alist-delete 'configure %standard-phases))) | |
325 | (home-page "https://pwmt.org/projects/zathura-ps/") | |
326 | (synopsis "PS support for zathura (libspectre backend)") | |
327 | (description "The zathura-ps plugin adds PS support to zathura | |
328 | using libspectre.") | |
329 | (license license:zlib))) | |
330 | ||
bac31d1f PW |
331 | (define-public zathura-djvu |
332 | (package | |
333 | (name "zathura-djvu") | |
b7f3e363 | 334 | (version "0.2.5") |
bac31d1f PW |
335 | (source (origin |
336 | (method url-fetch) | |
337 | (uri | |
338 | (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-" | |
339 | version ".tar.gz")) | |
340 | (sha256 | |
341 | (base32 | |
b7f3e363 | 342 | "03cw54d2fipvbrnbqy0xccqkx6s77dyhyymx479aj5ryy4513dq8")))) |
bac31d1f PW |
343 | (native-inputs `(("pkg-config" ,pkg-config))) |
344 | (propagated-inputs `(("girara" ,girara))) | |
345 | (inputs | |
346 | `(("djvulibre" ,djvulibre) | |
347 | ("gtk+" ,gtk+) | |
348 | ("zathura" ,zathura))) | |
349 | (build-system gnu-build-system) | |
350 | (arguments | |
b1982b80 MW |
351 | `(#:make-flags (list (string-append "PREFIX=" %output) |
352 | (string-append "PLUGINDIR=" %output "/lib/zathura") | |
353 | "CC=gcc") | |
bac31d1f PW |
354 | #:tests? #f ; Package does not contain tests. |
355 | #:phases | |
356 | (alist-delete 'configure %standard-phases))) | |
357 | (home-page "https://pwmt.org/projects/zathura-djvu/") | |
358 | (synopsis "DjVu support for zathura (DjVuLibre backend)") | |
359 | (description "The zathura-djvu plugin adds DjVu support to zathura | |
360 | using the DjVuLibre library.") | |
361 | (license license:zlib))) | |
362 | ||
7708557f PW |
363 | (define-public zathura-pdf-poppler |
364 | (package | |
365 | (name "zathura-pdf-poppler") | |
8a48353a | 366 | (version "0.2.6") |
7708557f PW |
367 | (source (origin |
368 | (method url-fetch) | |
369 | (uri | |
370 | (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-" | |
371 | version ".tar.gz")) | |
372 | (sha256 | |
373 | (base32 | |
8a48353a | 374 | "1maqiv7yv8d8hymlffa688c5z71v85kbzmx2j88i8z349xx0rsyi")))) |
7708557f PW |
375 | (native-inputs `(("pkg-config" ,pkg-config))) |
376 | (propagated-inputs `(("girara" ,girara))) | |
377 | (inputs | |
378 | `(("poppler" ,poppler) | |
379 | ("gtk+" ,gtk+) | |
380 | ("zathura" ,zathura) | |
381 | ("cairo" ,cairo))) | |
382 | (build-system gnu-build-system) | |
383 | (arguments | |
b1982b80 MW |
384 | `(#:make-flags (list (string-append "PREFIX=" %output) |
385 | (string-append "PLUGINDIR=" %output "/lib/zathura") | |
386 | "CC=gcc") | |
7708557f PW |
387 | #:tests? #f ; Package does not include tests. |
388 | #:phases | |
389 | (alist-delete 'configure %standard-phases))) | |
390 | (home-page "https://pwmt.org/projects/zathura-pdf-poppler/") | |
391 | (synopsis "PDF support for zathura (poppler backend)") | |
392 | (description "The zathura-pdf-poppler plugin adds PDF support to zathura | |
393 | by using the poppler rendering engine.") | |
394 | (license license:zlib))) | |
395 | ||
3e40bb82 PW |
396 | (define-public zathura |
397 | (package | |
398 | (name "zathura") | |
86008652 | 399 | (version "0.3.6") |
3e40bb82 PW |
400 | (source (origin |
401 | (method url-fetch) | |
402 | (uri | |
403 | (string-append "https://pwmt.org/projects/zathura/download/zathura-" | |
404 | version ".tar.gz")) | |
405 | (sha256 | |
406 | (base32 | |
86008652 | 407 | "0fyb5hak0knqvg90rmdavwcmilhnrwgg1s5ykx9wd3skbpi8nsh8")) |
fc1adab1 AK |
408 | (patches (search-patches |
409 | "zathura-plugindir-environment-variable.patch")))) | |
3e40bb82 | 410 | (native-inputs `(("pkg-config" ,pkg-config) |
b94a6ca0 | 411 | ("gettext" ,gettext-minimal))) |
3e40bb82 PW |
412 | (inputs `(("girara" ,girara) |
413 | ("sqlite" ,sqlite) | |
414 | ("gtk+" ,gtk+))) | |
415 | (native-search-paths | |
416 | (list (search-path-specification | |
417 | (variable "ZATHURA_PLUGIN_PATH") | |
418 | (files '("lib/zathura"))))) | |
419 | (build-system gnu-build-system) | |
420 | (arguments | |
421 | `(#:make-flags | |
422 | `(,(string-append "PREFIX=" (assoc-ref %outputs "out")) | |
423 | "CC=gcc" "COLOR=0") | |
424 | #:tests? #f ; Tests fail: "Gtk cannot open display". | |
425 | #:test-target "test" | |
426 | #:phases | |
427 | (alist-delete 'configure %standard-phases))) | |
428 | (home-page "https://pwmt.org/projects/zathura/") | |
429 | (synopsis "Lightweight keyboard-driven PDF viewer") | |
430 | (description "Zathura is a customizable document viewer. It provides a | |
431 | minimalistic interface and an interface that mainly focuses on keyboard | |
432 | interaction.") | |
433 | (license license:zlib))) | |
434 | ||
0f28ee34 LC |
435 | (define-public podofo |
436 | (package | |
437 | (name "podofo") | |
d4322e61 | 438 | (version "0.9.3") |
0f28ee34 LC |
439 | (source (origin |
440 | (method url-fetch) | |
de67e922 LF |
441 | (uri (string-append "mirror://sourceforge/podofo/podofo/" version |
442 | "/podofo-" version ".tar.gz")) | |
0f28ee34 LC |
443 | (sha256 |
444 | (base32 | |
d4322e61 | 445 | "1n12lbq9x15vqn7dc0hsccp56l5jdff1xrhvlfqlbklxx0qiw9pc")))) |
0f28ee34 LC |
446 | (build-system cmake-build-system) |
447 | (inputs ; TODO: Add cppunit for tests | |
5cc0e486 | 448 | `(("lua" ,lua-5.1) |
0f28ee34 LC |
449 | ("libpng" ,libpng) |
450 | ("openssl" ,openssl) | |
451 | ("fontconfig" ,fontconfig) | |
452 | ("libtiff" ,libtiff) | |
453 | ("libjpeg" ,libjpeg-8) | |
454 | ("freetype" ,freetype) | |
455 | ("zlib" ,zlib))) | |
cb6a14ba AE |
456 | (arguments |
457 | `(#:configure-flags '("-DPODOFO_BUILD_SHARED=ON" | |
dde70926 AE |
458 | "-DPODOFO_BUILD_STATIC=ON") |
459 | #:phases | |
460 | (alist-cons-before | |
461 | 'configure 'patch | |
462 | (lambda* (#:key inputs #:allow-other-keys) | |
463 | (let ((freetype (assoc-ref inputs "freetype"))) | |
464 | ;; Look for freetype include files in the correct place. | |
465 | (substitute* "cmake/modules/FindFREETYPE.cmake" | |
466 | (("/usr/local") freetype)))) | |
467 | %standard-phases))) | |
0f28ee34 LC |
468 | (home-page "http://podofo.sourceforge.net") |
469 | (synopsis "Tools to work with the PDF file format") | |
470 | (description | |
471 | "PoDoFo is a C++ library and set of command-line tools to work with the | |
472 | PDF file format. It can parse PDF files and load them into memory, and makes | |
473 | it easy to modify them and write the changes to disk. It is primarily useful | |
474 | for applications that wish to do lower level manipulation of PDF, such as | |
475 | extracting content or merging files.") | |
476 | (license license:lgpl2.0+))) | |
c0b390ed MB |
477 | |
478 | (define-public mupdf | |
479 | (package | |
480 | (name "mupdf") | |
c41d97be | 481 | (version "1.9a") |
c0b390ed MB |
482 | (source |
483 | (origin | |
484 | (method url-fetch) | |
235c4ec3 MW |
485 | (uri (string-append "http://mupdf.com/downloads/archive/" |
486 | name "-" version "-source.tar.gz")) | |
c0b390ed | 487 | (sha256 |
c41d97be LF |
488 | (base32 |
489 | "1k64pdapyj8a336jw3j61fhn0rp4q6az7d0dqp9r5n3d9rgwa5c0")) | |
490 | (patches (search-patches "mupdf-build-with-openjpeg-2.1.patch" | |
491 | "mupdf-CVE-2016-6265.patch" | |
47a04fca KK |
492 | "mupdf-CVE-2016-6525.patch" |
493 | "mupdf-CVE-2016-8674.patch")) | |
c0b390ed MB |
494 | (modules '((guix build utils))) |
495 | (snippet | |
c41d97be LF |
496 | ;; Delete all the bundled libraries except for mujs, which is |
497 | ;; developed by the same team as mupdf and has no releases. | |
498 | ;; TODO Package mujs and don't use the bundled copy. | |
499 | '(for-each delete-file-recursively | |
500 | '("thirdparty/curl" | |
501 | "thirdparty/freetype" | |
502 | "thirdparty/glfw" | |
503 | "thirdparty/harfbuzz" | |
504 | "thirdparty/jbig2dec" | |
505 | "thirdparty/jpeg" | |
506 | "thirdparty/openjpeg" | |
507 | "thirdparty/zlib"))))) | |
c0b390ed MB |
508 | (build-system gnu-build-system) |
509 | (inputs | |
510 | `(("curl" ,curl) | |
511 | ("freetype" ,freetype) | |
c41d97be | 512 | ("harfbuzz" ,harfbuzz) |
c0b390ed MB |
513 | ("jbig2dec" ,jbig2dec) |
514 | ("libjpeg" ,libjpeg) | |
515 | ("libx11" ,libx11) | |
516 | ("libxext" ,libxext) | |
c41d97be | 517 | ("openjpeg" ,openjpeg) |
c0b390ed MB |
518 | ("openssl" ,openssl) |
519 | ("zlib" ,zlib))) | |
520 | (native-inputs | |
521 | `(("pkg-config" ,pkg-config))) | |
522 | (arguments | |
8e755b1b AE |
523 | '(#:tests? #f ; no check target |
524 | #:make-flags (list "CC=gcc" | |
525 | "XCFLAGS=-fpic" | |
526 | (string-append "prefix=" (assoc-ref %outputs "out"))) | |
527 | #:phases (modify-phases %standard-phases | |
528 | (delete 'configure)))) | |
c0b390ed | 529 | (home-page "http://mupdf.com") |
2274b816 | 530 | (synopsis "Lightweight PDF viewer and toolkit") |
c0b390ed MB |
531 | (description |
532 | "MuPDF is a C library that implements a PDF and XPS parsing and | |
533 | rendering engine. It is used primarily to render pages into bitmaps, | |
534 | but also provides support for other operations such as searching and | |
535 | listing the table of contents and hyperlinks. | |
536 | ||
537 | The library ships with a rudimentary X11 viewer, and a set of command | |
7c125ce0 AK |
538 | line tools for batch rendering (pdfdraw), rewriting files (pdfclean), |
539 | and examining the file structure (pdfshow).") | |
c0b390ed | 540 | (license license:agpl3+))) |
765f0ac8 RW |
541 | |
542 | (define-public qpdf | |
543 | (package | |
544 | (name "qpdf") | |
8337cb21 | 545 | (version "6.0.0") |
765f0ac8 RW |
546 | (source (origin |
547 | (method url-fetch) | |
de67e922 LF |
548 | (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version |
549 | "/qpdf-" version ".tar.gz")) | |
8337cb21 EF |
550 | (sha256 |
551 | (base32 | |
552 | "0csj2p2gkxrc0rk8ykymlsdgfas96vzf1dip3y1x7z1q9plwgzd9")) | |
503409b5 LC |
553 | (modules '((guix build utils))) |
554 | (snippet | |
555 | ;; Replace shebang with the bi-lingual shell/Perl trick to remove | |
556 | ;; dependency on Perl. | |
557 | '(substitute* "qpdf/fix-qdf" | |
558 | (("#!/usr/bin/env perl") | |
559 | "\ | |
560 | eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}' | |
561 | & eval 'exec perl -wS \"$0\" $argv:q' | |
562 | if 0;\n"))))) | |
765f0ac8 RW |
563 | (build-system gnu-build-system) |
564 | (arguments | |
503409b5 | 565 | `(#:disallowed-references (,perl) |
0adfe0cc EF |
566 | #:phases |
567 | (modify-phases %standard-phases | |
568 | (add-before 'configure 'patch-paths | |
569 | (lambda _ | |
570 | (substitute* "make/libtool.mk" | |
571 | (("SHELL=/bin/bash") | |
572 | (string-append "SHELL=" (which "bash")))) | |
573 | (substitute* (append | |
574 | '("qtest/bin/qtest-driver") | |
575 | (find-files "." "\\.test")) | |
576 | (("/usr/bin/env") (which "env")))))))) | |
765f0ac8 | 577 | (native-inputs |
503409b5 LC |
578 | `(("pkg-config" ,pkg-config) |
579 | ("perl" ,perl))) | |
765f0ac8 RW |
580 | (propagated-inputs |
581 | `(("pcre" ,pcre))) | |
582 | (inputs | |
503409b5 | 583 | `(("zlib" ,zlib))) |
765f0ac8 RW |
584 | (synopsis "Command-line tools and library for transforming PDF files") |
585 | (description | |
586 | "QPDF is a command-line program that does structural, content-preserving | |
587 | transformations on PDF files. It could have been called something like | |
588 | pdf-to-pdf. It includes support for merging and splitting PDFs and to | |
589 | manipulate the list of pages in a PDF file. It is not a PDF viewer or a | |
590 | program capable of converting PDF into other formats.") | |
591 | (license license:clarified-artistic) | |
592 | (home-page "http://qpdf.sourceforge.net/"))) | |
7ad608e4 RW |
593 | |
594 | (define-public xournal | |
595 | (package | |
596 | (name "xournal") | |
597 | (version "0.4.8") | |
598 | (source | |
599 | (origin | |
600 | (method url-fetch) | |
de67e922 LF |
601 | (uri (string-append "mirror://sourceforge/xournal/xournal/" version |
602 | "/xournal-" version ".tar.gz")) | |
7ad608e4 RW |
603 | (sha256 |
604 | (base32 | |
605 | "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13")))) | |
606 | (build-system gnu-build-system) | |
607 | (inputs | |
608 | `(("gtk" ,gtk+-2) | |
609 | ("pango" ,pango) | |
610 | ("poppler" ,poppler) | |
611 | ("glib" ,glib) | |
612 | ("libgnomecanvas" ,libgnomecanvas))) | |
613 | (native-inputs | |
614 | `(("pkg-config" ,pkg-config))) | |
615 | (home-page "http://xournal.sourceforge.net/") | |
616 | (synopsis "Notetaking using a stylus") | |
617 | (description | |
618 | "Xournal is an application for notetaking, sketching, keeping a journal | |
619 | using a stylus.") | |
620 | (license license:gpl2+))) | |
3fa2dc27 MB |
621 | |
622 | (define-public python-reportlab | |
623 | (package | |
624 | (name "python-reportlab") | |
625 | (version "3.3.0") | |
626 | (source (origin | |
627 | (method url-fetch) | |
628 | (uri (pypi-uri "reportlab" version)) | |
629 | (sha256 | |
630 | (base32 | |
631 | "0rz2pg04wnzjjm2f5a8ik9v8s54mv4xrjhv5liqjijqv6awh12gl")))) | |
632 | (build-system python-build-system) | |
633 | (arguments | |
634 | ;; Prevent creation of the egg. Without this flag, various artifacts | |
635 | ;; from the build inputs end up in the final python3 output. It also | |
636 | ;; works around https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20765 . | |
637 | `(#:configure-flags '("--single-version-externally-managed" "--root=/"))) | |
638 | (propagated-inputs | |
639 | `(("python-pillow" ,python-pillow))) | |
640 | (home-page "http://www.reportlab.com") | |
641 | (synopsis "Python library for generating PDFs and graphics") | |
642 | (description "This is the ReportLab PDF Toolkit. It allows rapid creation | |
643 | of rich PDF documents, and also creation of charts in a variety of bitmap and | |
644 | vector formats.") | |
645 | (license license:bsd-3) | |
646 | (properties `((python2-variant . ,(delay python2-reportlab)))))) | |
647 | ||
648 | (define-public python2-reportlab | |
649 | (package | |
650 | (inherit (package-with-python2 | |
651 | (strip-python2-variant python-reportlab))) | |
652 | (native-inputs `(("python2-pip" ,python2-pip))))) | |
8d4169a1 LC |
653 | |
654 | (define-public impressive | |
655 | (package | |
656 | (name "impressive") | |
657 | (version "0.11.1") | |
658 | (source (origin | |
659 | (method url-fetch) | |
660 | (uri (string-append | |
661 | "mirror://sourceforge/impressive/Impressive/" | |
662 | version "/Impressive-" version ".tar.gz")) | |
663 | (sha256 | |
664 | (base32 | |
665 | "0b3rmy6acp2vmf5nill3aknxvr9a5aawk1vnphkah61anxp62gsr")))) | |
666 | (build-system python-build-system) | |
667 | ||
668 | ;; TODO: Add dependency on pdftk. | |
669 | (inputs `(("python-pygame" ,python-pygame) | |
670 | ("python2-pillow" ,python2-pillow) | |
671 | ("sdl" ,sdl) | |
672 | ("xpdf" ,xpdf))) | |
673 | ||
674 | (arguments | |
675 | `(#:python ,python-2 | |
676 | #:phases (modify-phases %standard-phases | |
677 | (delete 'build) | |
678 | (delete 'configure) | |
679 | (delete 'check) | |
680 | (replace 'install | |
681 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
682 | ;; There's no 'setup.py' so install things manually. | |
683 | (let* ((out (assoc-ref outputs "out")) | |
684 | (bin (string-append out "/bin")) | |
685 | (man1 (string-append out "/share/man/man1")) | |
686 | (sdl (assoc-ref inputs "sdl")) | |
687 | (xpdf (assoc-ref inputs "xpdf"))) | |
688 | (mkdir-p bin) | |
689 | (copy-file "impressive.py" | |
690 | (string-append bin "/impressive")) | |
691 | (wrap-program (string-append bin "/impressive") | |
692 | `("LIBRARY_PATH" ":" prefix ;for ctypes | |
693 | (,(string-append sdl "/lib"))) | |
694 | `("PATH" ":" prefix ;for pdftoppm | |
695 | (,(string-append xpdf "/bin")))) | |
696 | (mkdir-p man1) | |
697 | (install-file "impressive.1" man1) | |
698 | #t)))))) | |
699 | (home-page "http://impressive.sourceforge.net") | |
700 | (synopsis "PDF presentation tool with visual effects") | |
701 | (description | |
702 | "Impressive is a tool to display PDF files that provides visual effects | |
703 | such as smooth alpha-blended slide transitions. It provides additional tools | |
704 | such as zooming, highlighting an area of the screen, and a tool to navigate | |
705 | the PDF pages.") | |
706 | (license license:gpl2))) | |
f3e22216 JL |
707 | |
708 | (define-public fbida | |
709 | (package | |
710 | (name "fbida") | |
711 | (version "2.12") | |
712 | (home-page "https://www.kraxel.org/blog/linux/fbida/") | |
713 | (source (origin | |
714 | (method url-fetch) | |
715 | (uri (string-append "https://www.kraxel.org/releases/fbida/" | |
716 | name "-" version ".tar.gz")) | |
717 | (sha256 | |
718 | (base32 | |
719 | "0bw224vb7jh0lrqaf4jgxk48xglvxs674qcpj5y0axyfbh896cfk")))) | |
720 | (build-system gnu-build-system) | |
721 | (arguments | |
722 | '(#:phases (alist-cons-after | |
723 | 'unpack 'patch-ldconfig | |
724 | (lambda _ | |
725 | (substitute* "mk/Autoconf.mk" | |
726 | (("/sbin/ldconfig -p") "echo lib")) #t) | |
727 | (alist-delete 'configure %standard-phases)) | |
728 | #:tests? #f | |
729 | #:make-flags (list "CC=gcc" | |
730 | (string-append "prefix=" (assoc-ref %outputs "out"))))) | |
731 | (inputs `(("libjpeg" ,libjpeg) | |
732 | ("curl" ,curl) | |
733 | ("libtiff" ,libtiff) | |
734 | ("libudev" ,eudev) | |
735 | ("libwebp" ,libwebp) | |
736 | ("libdrm" ,libdrm) | |
737 | ("imagemagick" ,imagemagick) | |
738 | ("giflib" ,giflib) | |
739 | ("glib" ,glib) | |
740 | ("cairo-xcb" ,cairo-xcb) | |
741 | ("freetype" ,freetype) | |
742 | ("fontconfig" ,fontconfig) | |
743 | ("libexif" ,libexif) | |
744 | ("mesa" ,mesa) | |
745 | ("libepoxy" ,libepoxy) | |
746 | ("libpng" ,libpng) | |
747 | ("poppler" ,poppler))) | |
748 | (native-inputs `(("pkg-config" ,pkg-config))) | |
749 | (synopsis "Framebuffer and drm-based image viewer") | |
750 | (description | |
751 | "fbida contains a few applications for viewing and editing images on | |
752 | the framebuffer.") | |
753 | ||
754 | (license license:gpl2+))) |