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