tests: hackage: Fix mock urls.
[jackhill/guix/guix.git] / gnu / packages / pdf.scm
CommitLineData
135eb524 1;;; GNU Guix --- Functional package management for GNU
8e755b1b 2;;; Copyright © 2013, 2015, 2016 Andreas Enge <andreas@enge.fr>
8befb33d 3;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
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>
3fa2dc27 8;;; Coypright © 2016 Marius Bakke <mbakke@fastmail.com>
135eb524
AE
9;;;
10;;; This file is part of GNU Guix.
11;;;
12;;; GNU Guix is free software; you can redistribute it and/or modify it
13;;; under the terms of the GNU General Public License as published by
14;;; the Free Software Foundation; either version 3 of the License, or (at
15;;; your option) any later version.
16;;;
17;;; GNU Guix is distributed in the hope that it will be useful, but
18;;; WITHOUT ANY WARRANTY; without even the implied warranty of
19;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;;; GNU General Public License for more details.
21;;;
22;;; You should have received a copy of the GNU General Public License
23;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24
25(define-module (gnu packages pdf)
b5b73a82 26 #:use-module ((guix licenses) #:prefix license:)
135eb524
AE
27 #:use-module (guix packages)
28 #:use-module (guix download)
ab1c2319 29 #:use-module (guix utils)
135eb524 30 #:use-module (guix build-system gnu)
0f28ee34 31 #:use-module (guix build-system cmake)
3efb57ea 32 #:use-module (guix build-system python)
135eb524 33 #:use-module (gnu packages)
aae8ba47 34 #:use-module (gnu packages autotools)
135eb524 35 #:use-module (gnu packages compression)
a86177d6 36 #:use-module (gnu packages fontutils)
14ecc0ef 37 #:use-module (gnu packages ghostscript)
3e40bb82 38 #:use-module (gnu packages databases)
bac31d1f 39 #:use-module (gnu packages djvu)
3e40bb82
PW
40 #:use-module (gnu packages gettext)
41 #:use-module (gnu packages backup)
14ecc0ef 42 #:use-module (gnu packages lesstif)
e55354b8 43 #:use-module (gnu packages image)
14ecc0ef 44 #:use-module (gnu packages pkg-config)
8410cb62 45 #:use-module (gnu packages qt)
8db824ba 46 #:use-module (gnu packages xorg)
7ad608e4 47 #:use-module (gnu packages gnome)
8db824ba
LC
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages gtk)
0f28ee34 50 #:use-module (gnu packages lua)
c0b390ed 51 #:use-module (gnu packages curl)
765f0ac8
RW
52 #:use-module (gnu packages pcre)
53 #:use-module (gnu packages perl)
3fa2dc27 54 #:use-module (gnu packages python)
cc2b77df 55 #:use-module (gnu packages tls)
8db824ba 56 #:use-module (srfi srfi-1))
135eb524
AE
57
58(define-public poppler
59 (package
60 (name "poppler")
041d0ff8 61 (version "0.43.0")
135eb524
AE
62 (source (origin
63 (method url-fetch)
5cc3096c 64 (uri (string-append "https://poppler.freedesktop.org/poppler-"
8befb33d 65 version ".tar.xz"))
6983ba56
SB
66 (sha256
67 (base32
041d0ff8 68 "0mi4zf0pz3x3fx3ir7szz1n57nywgbpd4mp2r7mvf47f4rmf4867"))))
135eb524 69 (build-system gnu-build-system)
6983ba56 70 ;; FIXME:
a25fe6d6 71 ;; use libcurl: no
135eb524
AE
72 (inputs `(("fontconfig" ,fontconfig)
73 ("freetype" ,freetype)
7363cda4 74 ("libjpeg" ,libjpeg)
a25fe6d6 75 ("libpng" ,libpng)
135eb524 76 ("libtiff" ,libtiff)
927d4d9b
RW
77 ("lcms" ,lcms)
78 ("openjpeg-1" ,openjpeg-1)
8db824ba
LC
79 ("zlib" ,zlib)
80
81 ;; To build poppler-glib (as needed by Evince), we need Cairo and
82 ;; GLib. But of course, that Cairo must not depend on Poppler.
83 ("cairo" ,(package (inherit cairo)
84 (inputs (alist-delete "poppler"
85 (package-inputs cairo)))))
86 ("glib" ,glib)))
c4c4cc05 87 (native-inputs
426adbe8 88 `(("pkg-config" ,pkg-config)
6983ba56
SB
89 ("glib" ,glib "bin") ; glib-mkenums, etc.
90 ("gobject-introspection" ,gobject-introspection)))
135eb524
AE
91 (arguments
92 `(#:tests? #f ; no test data provided with the tarball
a25fe6d6 93 #:configure-flags
7363cda4 94 '("--enable-xpdf-headers" ; to install header files
a8938c88
LC
95 "--enable-zlib"
96
97 ;; Saves 8 MiB of .a files.
98 "--disable-static")
927d4d9b
RW
99 #:phases
100 (alist-cons-before
101 'configure 'setenv
102 (lambda _
103 (setenv "CPATH"
104 (string-append (assoc-ref %build-inputs "openjpeg-1")
105 "/include/openjpeg-1.5"
106 ":" (or (getenv "CPATH") ""))))
107 %standard-phases)))
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+)
135eb524 112 (home-page "http://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
166Poppler 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
205reading 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
285using 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
316using 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
348using 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
381by 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
PW
398 (native-inputs `(("pkg-config" ,pkg-config)
399 ("gettext" ,gnu-gettext)))
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
419minimalistic interface and an interface that mainly focuses on keyboard
420interaction.")
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
460PDF file format. It can parse PDF files and load them into memory, and makes
461it easy to modify them and write the changes to disk. It is primarily useful
462for applications that wish to do lower level manipulation of PDF, such as
463extracting 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
507rendering engine. It is used primarily to render pages into bitmaps,
508but also provides support for other operations such as searching and
509listing the table of contents and hyperlinks.
510
511The library ships with a rudimentary X11 viewer, and a set of command
7c125ce0
AK
512line tools for batch rendering (pdfdraw), rewriting files (pdfclean),
513and examining the file structure (pdfshow).")
c0b390ed 514 (license license:agpl3+)))
765f0ac8
RW
515
516(define-public qpdf
517 (package
518 (name "qpdf")
47959dd4 519 (version "5.1.3")
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"))
765f0ac8 524 (sha256 (base32
503409b5
LC
525 "1lq1v7xghvl6p4hgrwbps3a13ad6lh4ib3myimb83hxgsgd4n5nm"))
526 (modules '((guix build utils)))
527 (snippet
528 ;; Replace shebang with the bi-lingual shell/Perl trick to remove
529 ;; dependency on Perl.
530 '(substitute* "qpdf/fix-qdf"
531 (("#!/usr/bin/env perl")
532 "\
533eval '(exit $?0)' && eval 'exec perl -wS \"$0\" ${1+\"$@\"}'
534 & eval 'exec perl -wS \"$0\" $argv:q'
535 if 0;\n")))))
765f0ac8
RW
536 (build-system gnu-build-system)
537 (arguments
503409b5
LC
538 `(#:disallowed-references (,perl)
539 #:phases (alist-cons-before
540 'configure 'patch-paths
541 (lambda _
542 (substitute* "make/libtool.mk"
543 (("SHELL=/bin/bash")
544 (string-append "SHELL=" (which "bash"))))
545 (substitute* (append
546 '("qtest/bin/qtest-driver")
547 (find-files "." "\\.test"))
548 (("/usr/bin/env") (which "env"))))
549 %standard-phases)))
765f0ac8 550 (native-inputs
503409b5
LC
551 `(("pkg-config" ,pkg-config)
552 ("perl" ,perl)))
765f0ac8
RW
553 (propagated-inputs
554 `(("pcre" ,pcre)))
555 (inputs
503409b5 556 `(("zlib" ,zlib)))
765f0ac8
RW
557 (synopsis "Command-line tools and library for transforming PDF files")
558 (description
559 "QPDF is a command-line program that does structural, content-preserving
560transformations on PDF files. It could have been called something like
561pdf-to-pdf. It includes support for merging and splitting PDFs and to
562manipulate the list of pages in a PDF file. It is not a PDF viewer or a
563program capable of converting PDF into other formats.")
564 (license license:clarified-artistic)
565 (home-page "http://qpdf.sourceforge.net/")))
7ad608e4
RW
566
567(define-public xournal
568 (package
569 (name "xournal")
570 (version "0.4.8")
571 (source
572 (origin
573 (method url-fetch)
de67e922
LF
574 (uri (string-append "mirror://sourceforge/xournal/xournal/" version
575 "/xournal-" version ".tar.gz"))
7ad608e4
RW
576 (sha256
577 (base32
578 "0c7gjcqhygiyp0ypaipdaxgkbivg6q45vhsj8v5jsi9nh6iqff13"))))
579 (build-system gnu-build-system)
580 (inputs
581 `(("gtk" ,gtk+-2)
582 ("pango" ,pango)
583 ("poppler" ,poppler)
584 ("glib" ,glib)
585 ("libgnomecanvas" ,libgnomecanvas)))
586 (native-inputs
587 `(("pkg-config" ,pkg-config)))
588 (home-page "http://xournal.sourceforge.net/")
589 (synopsis "Notetaking using a stylus")
590 (description
591 "Xournal is an application for notetaking, sketching, keeping a journal
592using a stylus.")
593 (license license:gpl2+)))
3fa2dc27
MB
594
595(define-public python-reportlab
596 (package
597 (name "python-reportlab")
598 (version "3.3.0")
599 (source (origin
600 (method url-fetch)
601 (uri (pypi-uri "reportlab" version))
602 (sha256
603 (base32
604 "0rz2pg04wnzjjm2f5a8ik9v8s54mv4xrjhv5liqjijqv6awh12gl"))))
605 (build-system python-build-system)
606 (arguments
607 ;; Prevent creation of the egg. Without this flag, various artifacts
608 ;; from the build inputs end up in the final python3 output. It also
609 ;; works around https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20765 .
610 `(#:configure-flags '("--single-version-externally-managed" "--root=/")))
611 (propagated-inputs
612 `(("python-pillow" ,python-pillow)))
613 (home-page "http://www.reportlab.com")
614 (synopsis "Python library for generating PDFs and graphics")
615 (description "This is the ReportLab PDF Toolkit. It allows rapid creation
616of rich PDF documents, and also creation of charts in a variety of bitmap and
617vector formats.")
618 (license license:bsd-3)
619 (properties `((python2-variant . ,(delay python2-reportlab))))))
620
621(define-public python2-reportlab
622 (package
623 (inherit (package-with-python2
624 (strip-python2-variant python-reportlab)))
625 (native-inputs `(("python2-pip" ,python2-pip)))))