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> |
000b3408 | 4 | ;;; Copyright © 2014, 2015, 2016, 2018, 2019, 2021 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> |
3c986a7d | 7 | ;;; Copyright © 2016 Nikita <nikita@n0.is> |
2d8270ad | 8 | ;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il> |
82862153 | 9 | ;;; Copyright © 2016, 2017 Marius Bakke <mbakke@fastmail.com> |
8b438f85 | 10 | ;;; Copyright © 2016, 2017, 2019 Ludovic Courtès <ludo@gnu.org> |
82862153 | 11 | ;;; Copyright © 2016 Julien Lepiller <julien@lepiller.eu> |
667c004c | 12 | ;;; Copyright © 2016, 2019 Arun Isaac <arunisaac@systemreboot.net> |
6d161406 | 13 | ;;; Copyright © 2017, 2018 Leo Famulari <leo@famulari.name> |
92ae98e2 | 14 | ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com> |
7da4dbb3 | 15 | ;;; Copyright © 2017, 2018 Rene Saavedra <pacoon@protonmail.com> |
df50d2a0 | 16 | ;;; Copyright © 2017–2021 Tobias Geerinckx-Rice <me@tobias.gr> |
a42cb6f1 | 17 | ;;; Copyright © 2019 Alex Griffin <a@ajgrf.com> |
0cd4a746 | 18 | ;;; Copyright © 2019 Ben Sturmfels <ben@sturm.com.au> |
e34b06b7 | 19 | ;;; Copyright © 2019,2020 Hartmut Goebel <h.goebel@crazy-compilers.com> |
1a4f1ea1 | 20 | ;;; Copyright © 2020, 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
2266f162 | 21 | ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de> |
cbcd520e | 22 | ;;; Copyright © 2020 Timotej Lazar <timotej.lazar@araneo.si> |
c601e2bf | 23 | ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
c3db377d | 24 | ;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be> |
135eb524 AE |
25 | ;;; |
26 | ;;; This file is part of GNU Guix. | |
27 | ;;; | |
28 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
29 | ;;; under the terms of the GNU General Public License as published by | |
30 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
31 | ;;; your option) any later version. | |
32 | ;;; | |
33 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
34 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
35 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
36 | ;;; GNU General Public License for more details. | |
37 | ;;; | |
38 | ;;; You should have received a copy of the GNU General Public License | |
39 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
40 | ||
41 | (define-module (gnu packages pdf) | |
b5b73a82 | 42 | #:use-module ((guix licenses) #:prefix license:) |
135eb524 AE |
43 | #:use-module (guix packages) |
44 | #:use-module (guix download) | |
e2ec95c4 | 45 | #:use-module (guix git-download) |
ab1c2319 | 46 | #:use-module (guix utils) |
135eb524 | 47 | #:use-module (guix build-system gnu) |
0f28ee34 | 48 | #:use-module (guix build-system cmake) |
eb6a5dab | 49 | #:use-module (guix build-system meson) |
3efb57ea | 50 | #:use-module (guix build-system python) |
cbcd520e | 51 | #:use-module (guix build-system qt) |
8d4169a1 | 52 | #:use-module (guix build-system trivial) |
135eb524 | 53 | #:use-module (gnu packages) |
ebbd30ff | 54 | #:use-module (gnu packages audio) |
aae8ba47 | 55 | #:use-module (gnu packages autotools) |
31f248fa | 56 | #:use-module (gnu packages backup) |
8d4169a1 LC |
57 | #:use-module (gnu packages base) |
58 | #:use-module (gnu packages bash) | |
c9208beb | 59 | #:use-module (gnu packages build-tools) |
ac847543 | 60 | #:use-module (gnu packages check) |
135eb524 | 61 | #:use-module (gnu packages compression) |
cbcd520e | 62 | #:use-module (gnu packages cups) |
31f248fa | 63 | #:use-module (gnu packages curl) |
bac31d1f | 64 | #:use-module (gnu packages djvu) |
c601e2bf | 65 | #:use-module (gnu packages fonts) |
31f248fa EF |
66 | #:use-module (gnu packages fontutils) |
67 | #:use-module (gnu packages game-development) | |
3e40bb82 | 68 | #:use-module (gnu packages gettext) |
31f248fa | 69 | #:use-module (gnu packages ghostscript) |
f3e22216 | 70 | #:use-module (gnu packages gl) |
8db824ba | 71 | #:use-module (gnu packages glib) |
31f248fa EF |
72 | #:use-module (gnu packages gnome) |
73 | #:use-module (gnu packages gnupg) | |
e2ec95c4 | 74 | #:use-module (gnu packages gstreamer) |
8db824ba | 75 | #:use-module (gnu packages gtk) |
31f248fa | 76 | #:use-module (gnu packages image) |
1650cf92 | 77 | #:use-module (gnu packages javascript) |
31f248fa | 78 | #:use-module (gnu packages lesstif) |
77e0cebc | 79 | #:use-module (gnu packages libffi) |
31f248fa | 80 | #:use-module (gnu packages linux) |
0f28ee34 | 81 | #:use-module (gnu packages lua) |
69ce8f3c | 82 | #:use-module (gnu packages man) |
000b3408 | 83 | #:use-module (gnu packages markup) |
765f0ac8 RW |
84 | #:use-module (gnu packages pcre) |
85 | #:use-module (gnu packages perl) | |
31f248fa EF |
86 | #:use-module (gnu packages photo) |
87 | #:use-module (gnu packages pkg-config) | |
ebbd30ff | 88 | #:use-module (gnu packages pulseaudio) |
3fa2dc27 | 89 | #:use-module (gnu packages python) |
77e0cebc HG |
90 | #:use-module (gnu packages python-check) |
91 | #:use-module (gnu packages python-web) | |
44d10b1f | 92 | #:use-module (gnu packages python-xyz) |
31f248fa | 93 | #:use-module (gnu packages qt) |
8d4169a1 | 94 | #:use-module (gnu packages sdl) |
9d0c291e | 95 | #:use-module (gnu packages sphinx) |
cd0322a3 | 96 | #:use-module (gnu packages sqlite) |
ebbd30ff | 97 | #:use-module (gnu packages tex) |
1a4f1ea1 | 98 | #:use-module (gnu packages time) |
6d80e264 | 99 | #:use-module (gnu packages tcl) |
cc2b77df | 100 | #:use-module (gnu packages tls) |
c5427f01 | 101 | #:use-module (gnu packages web) |
000b3408 | 102 | #:use-module (gnu packages webkit) |
31f248fa | 103 | #:use-module (gnu packages xdisorg) |
ebbd30ff | 104 | #:use-module (gnu packages xml) |
31f248fa | 105 | #:use-module (gnu packages xorg) |
8db824ba | 106 | #:use-module (srfi srfi-1)) |
135eb524 | 107 | |
b9650f7f NG |
108 | (define-public extractpdfmark |
109 | (package | |
110 | (name "extractpdfmark") | |
111 | (version "1.1.0") | |
112 | (source | |
113 | (origin | |
114 | (method git-fetch) | |
115 | (uri (git-reference | |
116 | (url "https://github.com/trueroad/extractpdfmark") | |
117 | (commit (string-append "v" version)))) | |
118 | (file-name (git-file-name name version)) | |
119 | (sha256 | |
120 | (base32 "14aa6zly53j8gx5d32caiabk2j4b102xha0v9149yahz6kbn5b80")))) | |
121 | (build-system gnu-build-system) | |
122 | (arguments | |
123 | `(#:phases | |
124 | (modify-phases %standard-phases | |
125 | (add-before 'check 'start-xorg-server | |
126 | ;; The test suite wants to write to /homeless-shelter | |
127 | (lambda _ (setenv "HOME" (getcwd))))))) | |
128 | (native-inputs | |
129 | `(("autoconf" ,autoconf) | |
130 | ("automake" ,automake) | |
131 | ("gettext" ,gettext-minimal) | |
132 | ("ghostscript" ,ghostscript) | |
133 | ("pkg-config" ,pkg-config) | |
134 | ("texlive" ,texlive-tiny))) | |
135 | (inputs | |
8394619b | 136 | (list poppler)) |
b9650f7f NG |
137 | (home-page "https://github.com/trueroad/extractpdfmark") |
138 | (synopsis "Extract page mode and named destinations as PDFmark from PDF") | |
139 | (description | |
140 | "PDFmarks is a technique that accompanies PDF, and that is used to store | |
141 | metadata such as author or title, but also structural information such as | |
142 | bookmarks or hyperlinks. | |
143 | ||
144 | When Ghostscript reads the main PDF generated by the TeX system with embedded | |
145 | PDF files and outputs the final PDF, the PDF page mode and name targets | |
146 | etc. are not preserved. Therefore, when you open the final PDF, it is not | |
147 | displayed correctly. Also, remote PDF links do not work correctly. | |
148 | ||
149 | This program is able to extract the page mode and named targets as PDFmark | |
150 | from PDF. In this way, you can obtain embedded PDF files that have kept this | |
151 | information.") | |
152 | (license license:gpl3))) | |
153 | ||
e34b06b7 HG |
154 | (define-public flyer-composer |
155 | (package | |
156 | (name "flyer-composer") | |
157 | (version "1.0rc2") | |
158 | (source | |
159 | (origin | |
160 | (method url-fetch) | |
161 | (uri (pypi-uri "flyer-composer" version)) | |
162 | (sha256 | |
163 | (base32 "17igqb5dlcgcq4nimjw6cf9qgz6a728zdx1d0rr90r2z0llcchsv")))) | |
164 | (build-system python-build-system) | |
165 | (arguments | |
166 | `(#:tests? #f ;; TODO | |
167 | #:phases | |
168 | (modify-phases %standard-phases | |
169 | (add-after 'install 'wrap-executable | |
170 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
171 | (let* ((out (assoc-ref outputs "out")) | |
172 | (qtbase (assoc-ref inputs "qtbase")) | |
173 | (qml "/lib/qt5/qml")) | |
174 | (wrap-program (string-append out "/bin/flyer-composer-gui") | |
175 | `("QT_PLUGIN_PATH" ":" = | |
176 | (,(string-append qtbase "/lib/qt5/plugins"))) | |
177 | `("QT_QPA_PLATFORM_PLUGIN_PATH" ":" = | |
178 | (,(string-append qtbase "/lib/qt5/plugins/platforms")))) | |
179 | #t)))))) | |
180 | (inputs | |
8394619b | 181 | (list python-pypdf2 python-pyqt python-poppler-qt5 qtbase-5)) |
e34b06b7 HG |
182 | (home-page "http://crazy-compilers.com/flyer-composer") |
183 | (synopsis "Rearrange PDF pages to print as flyers on one sheet") | |
184 | (description "@command{flyer-composer} can be used to prepare one- or | |
185 | two-sided flyers for printing on one sheet of paper. | |
186 | ||
187 | Imagine you have designed a flyer in A6 format and want to print it using your | |
188 | A4 printer. Of course, you want to print four flyers on each sheet. This is | |
189 | where Flyer Composer steps in, creating a PDF which holds your flyer four | |
190 | times. If you have a second page, Flyer Composer can arrange it the same way | |
191 | - even if the second page is in a separate PDF file. | |
192 | ||
f5dd283c | 193 | This package contains both the command line tool and the gui too.") |
e34b06b7 HG |
194 | (license license:agpl3+))) |
195 | ||
8f83699b HG |
196 | (define-public flyer-composer-cli |
197 | (package/inherit flyer-composer | |
198 | (name "flyer-composer-cli") | |
199 | (arguments | |
200 | `(#:tests? #f ;; TODO | |
201 | #:phases | |
202 | (modify-phases %standard-phases | |
203 | (add-after 'unpack 'remove-gui | |
204 | (lambda _ | |
205 | (delete-file-recursively "flyer_composer/gui") | |
206 | (substitute* "setup.cfg" | |
207 | (("^\\s+flyer-composer-gui\\s*=.*") "")) | |
208 | #t))))) | |
209 | (inputs | |
210 | `(("python-pypdf2" ,python-pypdf2))) | |
211 | (description "@command{flyer-composer} can be used to prepare one- or | |
212 | two-sided flyers for printing on one sheet of paper. | |
213 | ||
214 | Imagine you have designed a flyer in A6 format and want to print it using your | |
215 | A4 printer. Of course, you want to print four flyers on each sheet. This is | |
216 | where Flyer Composer steps in, creating a PDF which holds your flyer four | |
217 | times. If you have a second page, Flyer Composer can arrange it the same way | |
218 | - even if the second page is in a separate PDF file. | |
219 | ||
e0e873a9 | 220 | This package contains only the command line tool. If you like to use the gui, |
8f83699b HG |
221 | please install the @code{flyer-composer-gui} package."))) |
222 | ||
135eb524 AE |
223 | (define-public poppler |
224 | (package | |
225 | (name "poppler") | |
8ae4ea06 | 226 | (version "21.07.0") |
135eb524 AE |
227 | (source (origin |
228 | (method url-fetch) | |
5cc3096c | 229 | (uri (string-append "https://poppler.freedesktop.org/poppler-" |
8befb33d | 230 | version ".tar.xz")) |
6983ba56 SB |
231 | (sha256 |
232 | (base32 | |
8ae4ea06 | 233 | "1m54hsi8z6c13jdbjwz55flkra1mahmkw2igavbf8p86d2gv4sp2")))) |
1b821701 | 234 | (build-system cmake-build-system) |
6983ba56 | 235 | ;; FIXME: |
a25fe6d6 | 236 | ;; use libcurl: no |
135eb524 AE |
237 | (inputs `(("fontconfig" ,fontconfig) |
238 | ("freetype" ,freetype) | |
1abe0554 | 239 | ("libjpeg" ,libjpeg-turbo) |
a25fe6d6 | 240 | ("libpng" ,libpng) |
135eb524 | 241 | ("libtiff" ,libtiff) |
927d4d9b | 242 | ("lcms" ,lcms) |
301804d6 | 243 | ("openjpeg" ,openjpeg) |
8db824ba LC |
244 | ("zlib" ,zlib) |
245 | ||
246 | ;; To build poppler-glib (as needed by Evince), we need Cairo and | |
247 | ;; GLib. But of course, that Cairo must not depend on Poppler. | |
e21e0aff | 248 | ("cairo" ,cairo-sans-poppler))) |
eb637c64 MB |
249 | (propagated-inputs |
250 | ;; As per poppler-cairo and poppler-glib.pc. | |
251 | ;; XXX: Ideally we'd propagate Cairo too, but that would require a | |
252 | ;; different solution to the circular dependency mentioned above. | |
8394619b | 253 | (list glib)) |
c4c4cc05 | 254 | (native-inputs |
8394619b LC |
255 | (list pkg-config |
256 | `(,glib "bin") ; glib-mkenums, etc. | |
257 | gobject-introspection)) | |
135eb524 | 258 | (arguments |
be78dea4 | 259 | `(#:tests? #f ;no test data provided with the tarball |
a25fe6d6 | 260 | #:configure-flags |
1b821701 MB |
261 | (let* ((out (assoc-ref %outputs "out")) |
262 | (lib (string-append out "/lib"))) | |
9df39750 | 263 | (list "-DENABLE_UNSTABLE_API_ABI_HEADERS=ON" ;to install header files |
1b821701 | 264 | "-DENABLE_ZLIB=ON" |
be78dea4 | 265 | "-DENABLE_BOOST=OFF" ;disable Boost to save size |
1b821701 | 266 | (string-append "-DCMAKE_INSTALL_LIBDIR=" lib) |
c3db377d MD |
267 | (string-append "-DCMAKE_INSTALL_RPATH=" lib))) |
268 | ,@(if (%current-target-system) | |
269 | `(#:phases | |
270 | (modify-phases %standard-phases | |
271 | (add-after 'unpack 'set-PKG_CONFIG | |
272 | (lambda _ | |
273 | (setenv "PKG_CONFIG" ,(pkg-config-for-target)))))) | |
274 | '()))) | |
35b9e423 | 275 | (synopsis "PDF rendering library") |
135eb524 AE |
276 | (description |
277 | "Poppler is a PDF rendering library based on the xpdf-3.0 code base.") | |
14ecc0ef | 278 | (license license:gpl2+) |
5f8fc5e3 | 279 | (home-page "https://poppler.freedesktop.org/"))) |
14ecc0ef | 280 | |
6d161406 LF |
281 | (define-public poppler-data |
282 | (package | |
283 | (name "poppler-data") | |
f1310257 | 284 | (version "0.4.11") |
6d161406 LF |
285 | (source (origin |
286 | (method url-fetch) | |
287 | (uri (string-append "https://poppler.freedesktop.org/poppler-data" | |
288 | "-" version ".tar.gz")) | |
289 | (sha256 | |
290 | (base32 | |
f1310257 | 291 | "137h4m48gc4v0srnr0gkwaqna6kfdqpy5886if5gjfmh3g6hbv1c")))) |
6d161406 LF |
292 | (build-system gnu-build-system) |
293 | (arguments | |
2c1023b3 | 294 | '(#:tests? #f ; no test suite |
6d161406 LF |
295 | #:make-flags (list (string-append "prefix=" (assoc-ref %outputs "out"))) |
296 | #:phases | |
297 | (modify-phases %standard-phases | |
298 | ;; The package only provides some data files, so there is nothing to | |
299 | ;; build. | |
300 | (delete 'configure) | |
301 | (delete 'build)))) | |
302 | (synopsis "Poppler encoding files for rendering of CJK and Cyrillic text") | |
303 | (description "This package provides optional encoding files for Poppler. | |
304 | When present, Poppler is able to correctly render CJK and Cyrillic text.") | |
305 | (home-page (package-home-page poppler)) | |
306 | ;; See COPYING in the source distribution for more information about | |
307 | ;; the licensing. | |
308 | (license (list license:bsd-3 | |
309 | license:gpl2)))) | |
310 | ||
f22debac | 311 | (define-public poppler-qt5 |
021bf6af | 312 | (package/inherit poppler |
f22debac | 313 | (name "poppler-qt5") |
ea0a5107 | 314 | (inputs `(("qtbase" ,qtbase-5) |
f22debac RJ |
315 | ,@(package-inputs poppler))) |
316 | (synopsis "Qt5 frontend for the Poppler PDF rendering library"))) | |
317 | ||
99bcae94 RW |
318 | (define-public python-poppler-qt5 |
319 | (package | |
320 | (name "python-poppler-qt5") | |
02f664a0 | 321 | (version "21.1.0") |
99bcae94 RW |
322 | (source |
323 | (origin | |
324 | (method url-fetch) | |
325 | (uri (pypi-uri "python-poppler-qt5" version)) | |
326 | (sha256 | |
327 | (base32 | |
dd87bbb2 EF |
328 | "0b82gm4i75q5v19kfbq0h4y0b2vcwr2213zkhxh6l0h45kdndmxd")) |
329 | (patches (search-patches "python-poppler-qt5-fix-build.patch")))) | |
99bcae94 RW |
330 | (build-system python-build-system) |
331 | (arguments | |
332 | `(;; There are no tests. The check phase just causes a rebuild. | |
333 | #:tests? #f | |
334 | #:phases | |
335 | (modify-phases %standard-phases | |
336 | (replace 'build | |
337 | (lambda* (#:key inputs #:allow-other-keys) | |
338 | (substitute* "setup.py" | |
339 | ;; This check always fails, so disable it. | |
340 | (("if not check_qtxml\\(\\)") | |
0fe041bd | 341 | "if True")) |
99bcae94 RW |
342 | ;; We need to pass an extra flag here. This cannot be in |
343 | ;; configure-flags because it should not be passed for the | |
344 | ;; installation phase. | |
345 | ((@@ (guix build python-build-system) call-setuppy) | |
346 | "build_ext" (list (string-append "--pyqt-sip-dir=" | |
347 | (assoc-ref inputs "python-pyqt") | |
348 | "/share/sip")) #t)))))) | |
349 | (native-inputs | |
8394619b | 350 | (list pkg-config)) |
99bcae94 | 351 | (inputs |
8394619b | 352 | (list python-sip-4 python-pyqt poppler-qt5 qtbase-5)) |
e85af137 | 353 | (home-page "https://pypi.org/project/python-poppler-qt5/") |
99bcae94 RW |
354 | (synopsis "Python bindings for Poppler-Qt5") |
355 | (description | |
356 | "This package provides Python bindings for the Qt5 interface of the | |
357 | Poppler PDF rendering library.") | |
358 | (license license:lgpl2.1+))) | |
359 | ||
aae8ba47 RW |
360 | (define-public libharu |
361 | (package | |
362 | (name "libharu") | |
363 | (version "2.3.0") | |
364 | (source (origin | |
2b2ab39c RW |
365 | (method git-fetch) |
366 | (uri (git-reference | |
b0e7b699 | 367 | (url "https://github.com/libharu/libharu") |
2b2ab39c RW |
368 | (commit (string-append |
369 | "RELEASE_" | |
370 | (string-join (string-split version #\.) "_"))))) | |
371 | (file-name (git-file-name name version)) | |
aae8ba47 RW |
372 | (sha256 |
373 | (base32 | |
2b2ab39c | 374 | "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q")))) |
aae8ba47 RW |
375 | (build-system gnu-build-system) |
376 | (arguments | |
377 | `(#:configure-flags | |
378 | (list (string-append "--with-zlib=" | |
379 | (assoc-ref %build-inputs "zlib")) | |
380 | (string-append "--with-png=" | |
6f3dd09f | 381 | (assoc-ref %build-inputs "libpng"))))) |
aae8ba47 | 382 | (inputs |
8394619b | 383 | (list zlib libpng)) |
aae8ba47 | 384 | (native-inputs |
8394619b | 385 | (list autoconf automake libtool)) |
aae8ba47 RW |
386 | (home-page "http://libharu.org/") |
387 | (synopsis "Library for generating PDF files") | |
388 | (description | |
389 | "libHaru is a library for generating PDF files. libHaru does not support | |
390 | reading and editing of existing PDF files.") | |
391 | (license license:zlib))) | |
392 | ||
14ecc0ef AE |
393 | (define-public xpdf |
394 | (package | |
395 | (name "xpdf") | |
35089dca | 396 | (version "4.03") |
04761fcc TGR |
397 | (source |
398 | (origin | |
399 | (method url-fetch) | |
35089dca | 400 | (uri (string-append "https://dl.xpdfreader.com/xpdf-" version ".tar.gz")) |
04761fcc | 401 | (sha256 |
35089dca VL |
402 | (base32 "0ip81c9vy0igjnasl9iv2lz214fb01vvvdzbvjmgwc63fi1jgr0g")))) |
403 | (build-system cmake-build-system) | |
8394619b | 404 | (inputs (list cups freetype libpng qtbase-5 zlib)) |
14ecc0ef | 405 | (arguments |
35089dca | 406 | `(#:tests? #f)) ; there is no check target |
9e771e3b | 407 | (synopsis "Viewer for PDF files based on the Motif toolkit") |
14ecc0ef | 408 | (description |
e881752c | 409 | "Xpdf is a viewer for Portable Document Format (PDF) files.") |
04761fcc | 410 | (license license:gpl3) ; or gpl2, but not gpl2+ |
9900eb1c | 411 | (home-page "https://www.xpdfreader.com/"))) |
0f28ee34 | 412 | |
b3886e0c PW |
413 | (define-public zathura-cb |
414 | (package | |
415 | (name "zathura-cb") | |
02fcc6f2 | 416 | (version "0.1.8") |
b3886e0c PW |
417 | (source (origin |
418 | (method url-fetch) | |
419 | (uri | |
420 | (string-append "https://pwmt.org/projects/zathura-cb/download/zathura-cb-" | |
02fcc6f2 | 421 | version ".tar.xz")) |
b3886e0c PW |
422 | (sha256 |
423 | (base32 | |
02fcc6f2 | 424 | "1i6cf0vks501cggwvfsl6qb7mdaf3sszdymphimfvnspw810faj5")))) |
8394619b LC |
425 | (native-inputs (list pkg-config)) |
426 | (inputs (list libarchive zathura)) | |
02fcc6f2 | 427 | (build-system meson-build-system) |
b3886e0c | 428 | (arguments |
02fcc6f2 | 429 | `(#:tests? #f ; package does not contain tests |
b3886e0c | 430 | #:phases |
02fcc6f2 TGR |
431 | (modify-phases %standard-phases |
432 | (add-after 'unpack 'patch-plugin-directory | |
433 | ;; Something of a regression in 0.1.8: the new Meson build system | |
434 | ;; now hard-codes an incorrect plugin directory. Fix it. | |
435 | (lambda* (#:key outputs #:allow-other-keys) | |
436 | (substitute* "meson.build" | |
437 | (("(install_dir:).*" _ key) | |
438 | (string-append key | |
439 | "'" (assoc-ref outputs "out") "/lib/zathura'\n"))) | |
440 | #t))))) | |
b3886e0c PW |
441 | (home-page "https://pwmt.org/projects/zathura-cb/") |
442 | (synopsis "Comic book support for zathura (libarchive backend)") | |
443 | (description "The zathura-cb plugin adds comic book support to zathura | |
444 | using libarchive.") | |
445 | (license license:zlib))) | |
446 | ||
721a4f7d PW |
447 | (define-public zathura-ps |
448 | (package | |
449 | (name "zathura-ps") | |
06dbfb5d | 450 | (version "0.2.6") |
721a4f7d PW |
451 | (source (origin |
452 | (method url-fetch) | |
453 | (uri | |
454 | (string-append "https://pwmt.org/projects/zathura-ps/download/zathura-ps-" | |
06dbfb5d | 455 | version ".tar.xz")) |
721a4f7d PW |
456 | (sha256 |
457 | (base32 | |
06dbfb5d | 458 | "0wygq89nyjrjnsq7vbpidqdsirjm6iq4w2rijzwpk2f83ys8bc3y")))) |
8394619b LC |
459 | (native-inputs (list pkg-config)) |
460 | (inputs (list libspectre zathura)) | |
06dbfb5d | 461 | (build-system meson-build-system) |
721a4f7d | 462 | (arguments |
06dbfb5d | 463 | `(#:tests? #f ; package does not contain tests |
721a4f7d | 464 | #:phases |
06dbfb5d TGR |
465 | (modify-phases %standard-phases |
466 | (add-after 'unpack 'patch-plugin-directory | |
467 | ;; Something of a regression in 0.2.6: the new Meson build system | |
468 | ;; now hard-codes an incorrect plugin directory. Fix it. | |
469 | (lambda* (#:key outputs #:allow-other-keys) | |
470 | (substitute* "meson.build" | |
471 | (("(install_dir:).*" _ key) | |
472 | (string-append key | |
473 | "'" (assoc-ref outputs "out") "/lib/zathura'\n"))) | |
474 | #t))))) | |
721a4f7d PW |
475 | (home-page "https://pwmt.org/projects/zathura-ps/") |
476 | (synopsis "PS support for zathura (libspectre backend)") | |
477 | (description "The zathura-ps plugin adds PS support to zathura | |
478 | using libspectre.") | |
479 | (license license:zlib))) | |
480 | ||
bac31d1f PW |
481 | (define-public zathura-djvu |
482 | (package | |
483 | (name "zathura-djvu") | |
8b5185c6 | 484 | (version "0.2.9") |
bac31d1f PW |
485 | (source (origin |
486 | (method url-fetch) | |
487 | (uri | |
488 | (string-append "https://pwmt.org/projects/zathura-djvu/download/zathura-djvu-" | |
7d475dd4 | 489 | version ".tar.xz")) |
bac31d1f PW |
490 | (sha256 |
491 | (base32 | |
8b5185c6 | 492 | "0062n236414db7q7pnn3ccg5111ghxj3407pn9ri08skxskgirln")))) |
8394619b | 493 | (native-inputs (list pkg-config)) |
bac31d1f | 494 | (inputs |
8394619b | 495 | (list djvulibre zathura)) |
7d475dd4 | 496 | (build-system meson-build-system) |
bac31d1f | 497 | (arguments |
7d475dd4 | 498 | `(#:tests? #f ; package does not contain tests |
bac31d1f | 499 | #:phases |
7d475dd4 TGR |
500 | (modify-phases %standard-phases |
501 | (add-after 'unpack 'patch-plugin-directory | |
502 | ;; Something of a regression in 0.2.8: the new Meson build system | |
503 | ;; now hard-codes an incorrect plugin directory. Fix it. | |
504 | (lambda* (#:key outputs #:allow-other-keys) | |
505 | (substitute* "meson.build" | |
506 | (("(install_dir:).*" _ key) | |
507 | (string-append key | |
508 | "'" (assoc-ref outputs "out") "/lib/zathura'\n"))) | |
509 | #t))))) | |
bac31d1f PW |
510 | (home-page "https://pwmt.org/projects/zathura-djvu/") |
511 | (synopsis "DjVu support for zathura (DjVuLibre backend)") | |
512 | (description "The zathura-djvu plugin adds DjVu support to zathura | |
513 | using the DjVuLibre library.") | |
514 | (license license:zlib))) | |
515 | ||
43dc47fa MB |
516 | (define-public zathura-pdf-mupdf |
517 | (package | |
518 | (name "zathura-pdf-mupdf") | |
17210f51 | 519 | (version "0.3.6") |
43dc47fa MB |
520 | (source (origin |
521 | (method url-fetch) | |
522 | (uri | |
523 | (string-append "https://pwmt.org/projects/zathura-pdf-mupdf" | |
aac2006d | 524 | "/download/zathura-pdf-mupdf-" version ".tar.xz")) |
43dc47fa MB |
525 | (sha256 |
526 | (base32 | |
17210f51 | 527 | "1r3v37k9fl2rxipvacgxr36llywvy7n20a25h3ajlyk70697sa66")))) |
8394619b | 528 | (native-inputs (list pkg-config)) |
43dc47fa | 529 | (inputs |
3bbd6469 | 530 | `(("jbig2dec" ,jbig2dec) |
4bd428a7 | 531 | ("libjpeg" ,libjpeg-turbo) |
b42b5afd | 532 | ("mujs" ,mujs) |
43dc47fa MB |
533 | ("mupdf" ,mupdf) |
534 | ("openjpeg" ,openjpeg) | |
535 | ("openssl" ,openssl) | |
536 | ("zathura" ,zathura))) | |
aac2006d | 537 | (build-system meson-build-system) |
43dc47fa | 538 | (arguments |
aac2006d | 539 | `(#:tests? #f ; package does not contain tests |
a6f2afee EF |
540 | #:configure-flags (list (string-append "-Dplugindir=" |
541 | (assoc-ref %outputs "out") | |
7b046b1b SB |
542 | "/lib/zathura") |
543 | "-Dlink-external=true") | |
544 | #:phases | |
545 | (modify-phases %standard-phases | |
8b6ce47c TGR |
546 | (add-after 'unpack 'remove-libmupdfthird.a-requirement |
547 | (lambda _ | |
548 | ;; Ignore a missing (apparently superfluous) static library. | |
549 | (substitute* "meson.build" | |
550 | ((".*mupdfthird.*") "")) | |
551 | #t)) | |
7b046b1b SB |
552 | (add-before 'configure 'add-mujs-to-dependencies |
553 | (lambda _ | |
554 | ;; Add mujs to the 'build_dependencies'. | |
555 | (substitute* "meson.build" | |
556 | (("^ libopenjp2 = dependency.*" x) | |
557 | (string-append x " mujs = cc.find_library('mujs')\n")) | |
558 | (("^ libopenjp2") | |
559 | " libopenjp2, mujs"))))))) | |
43dc47fa MB |
560 | (home-page "https://pwmt.org/projects/zathura-pdf-mupdf/") |
561 | (synopsis "PDF support for zathura (mupdf backend)") | |
562 | (description "The zathura-pdf-mupdf plugin adds PDF support to zathura | |
563 | by using the @code{mupdf} rendering library.") | |
564 | (license license:zlib))) | |
565 | ||
7708557f PW |
566 | (define-public zathura-pdf-poppler |
567 | (package | |
568 | (name "zathura-pdf-poppler") | |
13d87223 | 569 | (version "0.3.0") |
7708557f PW |
570 | (source (origin |
571 | (method url-fetch) | |
572 | (uri | |
573 | (string-append "https://pwmt.org/projects/zathura-pdf-poppler/download/zathura-pdf-poppler-" | |
0ed99053 | 574 | version ".tar.xz")) |
7708557f PW |
575 | (sha256 |
576 | (base32 | |
13d87223 | 577 | "1vfl4vkyy3rf39r1sqaa7y8113bgkh2bkfq3nn2inis9mrykmk6m")))) |
8394619b | 578 | (native-inputs (list pkg-config)) |
7708557f | 579 | (inputs |
8394619b | 580 | (list poppler zathura)) |
0ed99053 | 581 | (build-system meson-build-system) |
7708557f | 582 | (arguments |
0ed99053 | 583 | `(#:tests? #f ; package does not include tests |
7708557f | 584 | #:phases |
0ed99053 TGR |
585 | (modify-phases %standard-phases |
586 | (add-after 'unpack 'patch-plugin-directory | |
587 | ;; Something of a regression in 0.2.9: the new Meson build system | |
588 | ;; now hard-codes an incorrect plugin directory. Fix it. | |
589 | (lambda* (#:key outputs #:allow-other-keys) | |
590 | (substitute* "meson.build" | |
591 | (("(install_dir:).*" _ key) | |
592 | (string-append key | |
593 | "'" (assoc-ref outputs "out") "/lib/zathura'\n"))) | |
594 | #t))))) | |
7708557f PW |
595 | (home-page "https://pwmt.org/projects/zathura-pdf-poppler/") |
596 | (synopsis "PDF support for zathura (poppler backend)") | |
597 | (description "The zathura-pdf-poppler plugin adds PDF support to zathura | |
598 | by using the poppler rendering engine.") | |
599 | (license license:zlib))) | |
600 | ||
3e40bb82 PW |
601 | (define-public zathura |
602 | (package | |
603 | (name "zathura") | |
536bec1c | 604 | (version "0.4.8") |
3e40bb82 PW |
605 | (source (origin |
606 | (method url-fetch) | |
607 | (uri | |
608 | (string-append "https://pwmt.org/projects/zathura/download/zathura-" | |
eb6a5dab | 609 | version ".tar.xz")) |
3e40bb82 PW |
610 | (sha256 |
611 | (base32 | |
536bec1c | 612 | "1nr0ym1mi2afk4ycdf1ppmkcv7i7hyzwn4p3r4m0j2qm3nvaiami")))) |
3e40bb82 | 613 | (native-inputs `(("pkg-config" ,pkg-config) |
f2984d70 | 614 | ("gettext" ,gettext-minimal) |
ac847543 MB |
615 | ("glib:bin" ,glib "bin") |
616 | ||
eb6a5dab TGR |
617 | ;; For building documentation. |
618 | ("python-sphinx" ,python-sphinx) | |
619 | ||
a42cb6f1 AG |
620 | ;; For building icons. |
621 | ("librsvg" ,librsvg) | |
622 | ||
ac847543 MB |
623 | ;; For tests. |
624 | ("check" ,check) | |
60ecc10f | 625 | ("xorg-server" ,xorg-server-for-tests))) |
8394619b | 626 | (inputs (list sqlite)) |
1d9032fc | 627 | ;; Listed in 'Requires.private' of 'zathura.pc'. |
8394619b | 628 | (propagated-inputs (list cairo girara)) |
3e40bb82 PW |
629 | (native-search-paths |
630 | (list (search-path-specification | |
6bd8ba61 | 631 | (variable "ZATHURA_PLUGINS_PATH") |
3e40bb82 | 632 | (files '("lib/zathura"))))) |
eb6a5dab | 633 | (build-system meson-build-system) |
3e40bb82 | 634 | (arguments |
41ec0573 | 635 | `(#:phases (modify-phases %standard-phases |
ac847543 MB |
636 | (add-before 'check 'start-xserver |
637 | ;; Tests require a running X server. | |
638 | (lambda* (#:key inputs #:allow-other-keys) | |
639 | (let ((xorg-server (assoc-ref inputs "xorg-server")) | |
640 | (display ":1")) | |
641 | (setenv "DISPLAY" display) | |
f0eba502 MB |
642 | |
643 | ;; On busy machines, tests may take longer than | |
644 | ;; the default of four seconds. | |
645 | (setenv "CK_DEFAULT_TIMEOUT" "20") | |
646 | ||
ac847543 MB |
647 | ;; Don't fail due to missing '/etc/machine-id'. |
648 | (setenv "DBUS_FATAL_WARNINGS" "0") | |
649 | (zero? (system (string-append xorg-server "/bin/Xvfb " | |
650 | display " &"))))))))) | |
3e40bb82 PW |
651 | (home-page "https://pwmt.org/projects/zathura/") |
652 | (synopsis "Lightweight keyboard-driven PDF viewer") | |
653 | (description "Zathura is a customizable document viewer. It provides a | |
654 | minimalistic interface and an interface that mainly focuses on keyboard | |
655 | interaction.") | |
656 | (license license:zlib))) | |
657 | ||
0f28ee34 LC |
658 | (define-public podofo |
659 | (package | |
660 | (name "podofo") | |
df50d2a0 | 661 | (version "0.9.7") |
0f28ee34 LC |
662 | (source (origin |
663 | (method url-fetch) | |
de67e922 LF |
664 | (uri (string-append "mirror://sourceforge/podofo/podofo/" version |
665 | "/podofo-" version ".tar.gz")) | |
0f28ee34 LC |
666 | (sha256 |
667 | (base32 | |
df50d2a0 | 668 | "1f0yvkx6nf99fp741w2y706d8bs9824x1z2gqm3rdy5fv8bfgwkw")))) |
0f28ee34 | 669 | (build-system cmake-build-system) |
22f00388 | 670 | (native-inputs |
8394619b | 671 | (list cppunit pkg-config)) |
22f00388 | 672 | (inputs |
4bd428a7 | 673 | `(("libjpeg" ,libjpeg-turbo) |
0f28ee34 | 674 | ("libtiff" ,libtiff) |
22f00388 | 675 | ("fontconfig" ,fontconfig) |
0f28ee34 | 676 | ("freetype" ,freetype) |
22f00388 EF |
677 | ("libpng" ,libpng) |
678 | ("lua" ,lua-5.1) | |
679 | ("openssl" ,openssl) | |
0f28ee34 | 680 | ("zlib" ,zlib))) |
cb6a14ba | 681 | (arguments |
81537055 TGR |
682 | `(#:configure-flags |
683 | (list "-DPODOFO_BUILD_SHARED=ON") | |
dde70926 | 684 | #:phases |
dc1d3cde KK |
685 | (modify-phases %standard-phases |
686 | (add-before 'configure 'patch | |
687 | (lambda* (#:key inputs #:allow-other-keys) | |
688 | (let ((freetype (assoc-ref inputs "freetype"))) | |
689 | ;; Look for freetype include files in the correct place. | |
690 | (substitute* "cmake/modules/FindFREETYPE.cmake" | |
691 | (("/usr/local") freetype))) | |
692 | #t))))) | |
0f28ee34 LC |
693 | (home-page "http://podofo.sourceforge.net") |
694 | (synopsis "Tools to work with the PDF file format") | |
695 | (description | |
696 | "PoDoFo is a C++ library and set of command-line tools to work with the | |
697 | PDF file format. It can parse PDF files and load them into memory, and makes | |
698 | it easy to modify them and write the changes to disk. It is primarily useful | |
699 | for applications that wish to do lower level manipulation of PDF, such as | |
700 | extracting content or merging files.") | |
701 | (license license:lgpl2.0+))) | |
c0b390ed MB |
702 | |
703 | (define-public mupdf | |
704 | (package | |
705 | (name "mupdf") | |
c1ca8532 | 706 | (version "1.19.0") |
c0b390ed | 707 | (source |
089f9be4 TGR |
708 | (origin |
709 | (method url-fetch) | |
710 | (uri (string-append "https://mupdf.com/downloads/archive/" | |
711 | "mupdf-" version "-source.tar.xz")) | |
712 | (sha256 | |
c1ca8532 | 713 | (base32 "1i98xqgnzp168hnnhradl8658qsif06wlbvcglz0mmh8wi1rkwrq")) |
089f9be4 TGR |
714 | (modules '((guix build utils))) |
715 | (snippet | |
716 | '(begin | |
717 | ;; Remove bundled software. | |
c1ca8532 EF |
718 | (let* ((keep (list "extract" |
719 | "lcms2")) ; different from our lcms2 package | |
089f9be4 TGR |
720 | (from "thirdparty") |
721 | (kept (string-append from "~temp"))) | |
722 | (mkdir-p kept) | |
723 | (for-each (lambda (file) (rename-file (string-append from "/" file) | |
724 | (string-append kept "/" file))) | |
725 | keep) | |
726 | (delete-file-recursively from) | |
727 | (rename-file kept from)) | |
728 | #t)))) | |
c0b390ed MB |
729 | (build-system gnu-build-system) |
730 | (inputs | |
731 | `(("curl" ,curl) | |
dab2542f | 732 | ("freeglut" ,freeglut) |
c0b390ed | 733 | ("freetype" ,freetype) |
c5427f01 | 734 | ("gumbo-parser" ,gumbo-parser) |
c41d97be | 735 | ("harfbuzz" ,harfbuzz) |
c0b390ed | 736 | ("jbig2dec" ,jbig2dec) |
4bd428a7 | 737 | ("libjpeg" ,libjpeg-turbo) |
c0b390ed MB |
738 | ("libx11" ,libx11) |
739 | ("libxext" ,libxext) | |
1650cf92 | 740 | ("mujs" ,mujs) |
c41d97be | 741 | ("openjpeg" ,openjpeg) |
c0b390ed MB |
742 | ("openssl" ,openssl) |
743 | ("zlib" ,zlib))) | |
744 | (native-inputs | |
8394619b | 745 | (list pkg-config)) |
c0b390ed | 746 | (arguments |
6c1c5fec | 747 | `(#:tests? #f ; no check target |
43ac6f59 TGR |
748 | #:make-flags (list "verbose=yes" |
749 | (string-append "CC=" ,(cc-for-target)) | |
8e755b1b | 750 | "XCFLAGS=-fpic" |
b1435fe7 EF |
751 | "USE_SYSTEM_LIBS=yes" |
752 | "USE_SYSTEM_MUJS=yes" | |
8b6ce47c TGR |
753 | "shared=yes" |
754 | ;; Even with the linkage patch we must fix RUNPATH. | |
755 | (string-append "LDFLAGS=-Wl,-rpath=" | |
756 | (assoc-ref %outputs "out") "/lib") | |
8e755b1b AE |
757 | (string-append "prefix=" (assoc-ref %outputs "out"))) |
758 | #:phases (modify-phases %standard-phases | |
c5427f01 | 759 | (delete 'configure)))) ; no configure script |
76379dca | 760 | (home-page "https://mupdf.com") |
2274b816 | 761 | (synopsis "Lightweight PDF viewer and toolkit") |
c0b390ed MB |
762 | (description |
763 | "MuPDF is a C library that implements a PDF and XPS parsing and | |
764 | rendering engine. It is used primarily to render pages into bitmaps, | |
765 | but also provides support for other operations such as searching and | |
766 | listing the table of contents and hyperlinks. | |
767 | ||
768 | The library ships with a rudimentary X11 viewer, and a set of command | |
7e0d513f EF |
769 | line tools for batch rendering @command{pdfdraw}, rewriting files |
770 | @command{pdfclean}, and examining the file structure @command{pdfshow}.") | |
e726f093 EF |
771 | (license (list license:agpl3+ |
772 | license:bsd-3 ; resources/cmaps | |
773 | license:x11 ; thirdparty/lcms2 | |
774 | license:silofl1.1 ; resources/fonts/{han,noto,sil,urw} | |
775 | license:asl2.0)))) ; resources/fonts/droid | |
765f0ac8 RW |
776 | |
777 | (define-public qpdf | |
778 | (package | |
779 | (name "qpdf") | |
44c95fa6 | 780 | (version "10.0.1") |
765f0ac8 RW |
781 | (source (origin |
782 | (method url-fetch) | |
de67e922 LF |
783 | (uri (string-append "mirror://sourceforge/qpdf/qpdf/" version |
784 | "/qpdf-" version ".tar.gz")) | |
8337cb21 EF |
785 | (sha256 |
786 | (base32 | |
44c95fa6 | 787 | "0yw2cpw7ygfd6jlgpwbi8vsnvv9p55zxp9h17x77z2qq733pf8jx")))) |
765f0ac8 RW |
788 | (build-system gnu-build-system) |
789 | (arguments | |
503409b5 | 790 | `(#:disallowed-references (,perl) |
0adfe0cc EF |
791 | #:phases |
792 | (modify-phases %standard-phases | |
793 | (add-before 'configure 'patch-paths | |
794 | (lambda _ | |
795 | (substitute* "make/libtool.mk" | |
796 | (("SHELL=/bin/bash") | |
797 | (string-append "SHELL=" (which "bash")))) | |
798 | (substitute* (append | |
799 | '("qtest/bin/qtest-driver") | |
800 | (find-files "." "\\.test")) | |
b5e53019 MW |
801 | (("/usr/bin/env") (which "env"))) |
802 | #t))))) | |
765f0ac8 | 803 | (native-inputs |
8394619b | 804 | (list pkg-config perl)) |
765f0ac8 | 805 | (propagated-inputs |
e9a9298b | 806 | ;; In Requires.private of libqpdf.pc. |
8394619b | 807 | (list libjpeg-turbo zlib)) |
765f0ac8 RW |
808 | (synopsis "Command-line tools and library for transforming PDF files") |
809 | (description | |
810 | "QPDF is a command-line program that does structural, content-preserving | |
811 | transformations on PDF files. It could have been called something like | |
812 | pdf-to-pdf. It includes support for merging and splitting PDFs and to | |
813 | manipulate the list of pages in a PDF file. It is not a PDF viewer or a | |
814 | program capable of converting PDF into other formats.") | |
e9a9298b MB |
815 | ;; Prior to the 7.0 release, QPDF was licensed under Artistic 2.0. |
816 | ;; Users can still choose to use the old license at their option. | |
817 | (license (list license:asl2.0 license:clarified-artistic)) | |
765f0ac8 | 818 | (home-page "http://qpdf.sourceforge.net/"))) |
7ad608e4 | 819 | |
cbcd520e TL |
820 | (define-public qpdfview |
821 | (package | |
822 | (name "qpdfview") | |
823 | (version "0.4.18") | |
824 | (source | |
825 | (origin | |
826 | (method url-fetch) | |
827 | (uri (string-append "https://launchpad.net/qpdfview/" | |
828 | "trunk/" version "/+download/" | |
829 | "qpdfview-" version ".tar.gz")) | |
830 | (sha256 | |
1e9f6677 TL |
831 | (base32 "0v1rl126hvblajnph2hkansgi0s8vjdc5yxrm4y3faa0lxzjwr6c")) |
832 | (patches (search-patches "qpdfview-qt515-compat.patch")))) | |
5c45ed05 | 833 | (build-system qt-build-system) |
cbcd520e | 834 | (native-inputs |
8394619b | 835 | (list pkg-config)) |
cbcd520e | 836 | (inputs |
8394619b LC |
837 | (list cups |
838 | djvulibre | |
839 | libspectre | |
840 | poppler-qt5 | |
841 | qtbase-5 | |
842 | qtsvg)) | |
cbcd520e | 843 | (arguments |
5c45ed05 | 844 | `(#:tests? #f ; no tests |
cbcd520e TL |
845 | #:phases |
846 | (modify-phases %standard-phases | |
847 | (replace 'configure | |
e5f21c7e | 848 | (lambda* (#:key outputs #:allow-other-keys) |
cbcd520e | 849 | (substitute* "qpdfview.pri" |
e5f21c7e | 850 | (("/usr") (assoc-ref outputs "out"))) |
5c45ed05 | 851 | (invoke "qmake" "qpdfview.pro")))))) |
cbcd520e TL |
852 | (home-page "https://launchpad.net/qpdfview") |
853 | (synopsis "Tabbed document viewer") | |
854 | (description "@command{qpdfview} is a document viewer for PDF, PS and DJVU | |
855 | files. It uses the Qt toolkit and features persistent per-file settings, | |
856 | configurable toolbars and shortcuts, continuous and multi‐page layouts, | |
857 | SyncTeX support, and rudimentary support for annotations and forms.") | |
858 | (license license:gpl2+))) | |
859 | ||
7ad608e4 RW |
860 | (define-public xournal |
861 | (package | |
862 | (name "xournal") | |
d0e888c3 | 863 | (version "0.4.8.2016") |
7ad608e4 RW |
864 | (source |
865 | (origin | |
866 | (method url-fetch) | |
de67e922 LF |
867 | (uri (string-append "mirror://sourceforge/xournal/xournal/" version |
868 | "/xournal-" version ".tar.gz")) | |
7ad608e4 RW |
869 | (sha256 |
870 | (base32 | |
d0e888c3 | 871 | "09i88v3wacmx7f96dmq0l3afpyv95lh6jrx16xzm0jd1szdrhn5j")))) |
7ad608e4 RW |
872 | (build-system gnu-build-system) |
873 | (inputs | |
e3196755 | 874 | (list gtk+-2 pango poppler glib libgnomecanvas)) |
7ad608e4 | 875 | (native-inputs |
8394619b | 876 | (list pkg-config)) |
7ad608e4 RW |
877 | (home-page "http://xournal.sourceforge.net/") |
878 | (synopsis "Notetaking using a stylus") | |
879 | (description | |
880 | "Xournal is an application for notetaking, sketching, keeping a journal | |
881 | using a stylus.") | |
882 | (license license:gpl2+))) | |
3fa2dc27 | 883 | |
ebbd30ff NG |
884 | (define-public xournalpp |
885 | (package | |
886 | (name "xournalpp") | |
69ce8f3c | 887 | (version "1.1.0") |
ebbd30ff NG |
888 | (source |
889 | (origin | |
890 | (method git-fetch) | |
891 | (uri (git-reference | |
b0e7b699 | 892 | (url "https://github.com/xournalpp/xournalpp") |
ebbd30ff NG |
893 | (commit version))) |
894 | (file-name (git-file-name name version)) | |
895 | (sha256 | |
69ce8f3c | 896 | (base32 "0ldf58l5sqy52x5dqfpdjdh7ldjilj9mw42jzsl5paxg0md2k0hl")))) |
ebbd30ff NG |
897 | (build-system cmake-build-system) |
898 | (arguments | |
899 | `(#:configure-flags (list "-DENABLE_CPPUNIT=ON") ;enable tests | |
900 | #:imported-modules ((guix build glib-or-gtk-build-system) | |
901 | ,@%cmake-build-system-modules) | |
902 | #:modules (((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:) | |
903 | (guix build cmake-build-system) | |
904 | (guix build utils)) | |
905 | #:phases | |
906 | (modify-phases %standard-phases | |
907 | (add-after 'unpack 'fix-permissions-on-po-files | |
908 | (lambda _ | |
ebbd30ff | 909 | ;; Make sure 'msgmerge' can modify the PO files. |
69ce8f3c NG |
910 | (for-each make-file-writable |
911 | (find-files "." "\\.po$")))) | |
226bb934 LDB |
912 | ;; Fix path to addr2line utility, which the crash reporter uses. |
913 | (add-after 'unpack 'fix-paths | |
914 | (lambda* (#:key inputs #:allow-other-keys) | |
915 | (substitute* "src/util/Stacktrace.cpp" | |
916 | ;; Match only the commandline. | |
917 | (("\"addr2line ") | |
69ce8f3c | 918 | (string-append "\"" (which "addr2line") " "))))) |
ebbd30ff NG |
919 | (add-after 'install 'glib-or-gtk-wrap |
920 | (assoc-ref glib-or-gtk:%standard-phases 'glib-or-gtk-wrap))))) | |
921 | (native-inputs | |
922 | `(("cppunit" ,cppunit) | |
ebbd30ff | 923 | ("gettext" ,gettext-minimal) |
69ce8f3c | 924 | ("help2man" ,help2man) |
ebbd30ff NG |
925 | ("pkg-config" ,pkg-config))) |
926 | (inputs | |
8394619b LC |
927 | (list alsa-lib |
928 | gtk+ | |
929 | librsvg | |
930 | libsndfile | |
931 | libxml2 | |
932 | libzip | |
933 | lua | |
934 | poppler | |
935 | portaudio | |
936 | texlive-bin)) | |
ebbd30ff NG |
937 | (home-page "https://github.com/xournalpp/xournalpp") |
938 | (synopsis "Handwriting notetaking software with PDF annotation support") | |
939 | (description "Xournal++ is a hand note taking software written in | |
940 | C++ with the target of flexibility, functionality and speed. Stroke | |
941 | recognizer and other parts are based on Xournal code. | |
942 | ||
943 | Xournal++ features: | |
944 | ||
945 | @itemize | |
946 | @item Support for Pen pressure, e.g., Wacom Tablet | |
947 | @item Support for annotating PDFs | |
948 | @item Fill shape functionality | |
949 | @item PDF Export (with and without paper style) | |
950 | @item PNG Export (with and without transparent background) | |
971b57d2 | 951 | @item Map different tools / colors etc. to stylus buttons / |
ebbd30ff NG |
952 | mouse buttons |
953 | @item Sidebar with Page Previews with advanced page sorting, PDF | |
954 | Bookmarks and Layers (can be individually hidden, editing layer can be | |
955 | selected) | |
956 | @item enhanced support for image insertion | |
957 | @item Eraser with multiple configurations | |
958 | @item LaTeX support | |
959 | @item bug reporting, autosave, and auto backup tools | |
960 | @item Customizeable toolbar, with multiple configurations, e.g., to | |
961 | optimize toolbar for portrait / landscape | |
962 | @item Page Template definitions | |
963 | @item Shape drawing (line, arrow, circle, rectangle) | |
964 | @item Shape resizing and rotation | |
965 | @item Rotation snapping every 45 degrees | |
966 | @item Rect snapping to grid | |
967 | @item Audio recording and playback alongside with handwritten notes | |
968 | @item Multi Language Support, Like English, German, Italian... | |
969 | @item Plugins using LUA Scripting | |
970 | @end itemize") | |
971 | (license license:gpl2+))) | |
972 | ||
3fa2dc27 MB |
973 | (define-public python-reportlab |
974 | (package | |
975 | (name "python-reportlab") | |
e56ab46b | 976 | (version "3.5.42") |
3fa2dc27 MB |
977 | (source (origin |
978 | (method url-fetch) | |
979 | (uri (pypi-uri "reportlab" version)) | |
980 | (sha256 | |
981 | (base32 | |
e56ab46b | 982 | "0i17qgm7gzy7pzp240mkpsx9rn8rr67jh5npp5bylv3sd41g48cw")))) |
3fa2dc27 | 983 | (build-system python-build-system) |
9e378e6a | 984 | (arguments |
2d8270ad EF |
985 | '(;; FIXME: There is one test failure, building the pdf manual from source, |
986 | ;; but it does not cause the build to fail. | |
987 | #:test-target "tests" | |
988 | #:configure-flags (list "--use-system-libart") | |
989 | #:phases | |
990 | (modify-phases %standard-phases | |
991 | (add-after 'unpack 'find-libraries | |
992 | (lambda* (#:key inputs #:allow-other-keys) | |
993 | (let ((libart (assoc-ref inputs "libart-lgpl")) | |
994 | (freetype (assoc-ref inputs "freetype")) | |
995 | (dlt1 (assoc-ref inputs "font-curve-files"))) | |
996 | (substitute* "setup.py" | |
997 | (("/usr/include/libart-\\*") | |
998 | (string-append libart "/include/libart-2.0")) | |
999 | (("/usr/include/freetype2") | |
1000 | (string-append freetype "/include")) | |
1001 | (("http://www.reportlab.com/ftp/pfbfer-20180109.zip") | |
1002 | (string-append "file://" dlt1))) | |
1003 | #t)))))) | |
ab61ce37 | 1004 | (inputs |
2d8270ad EF |
1005 | `(("freetype" ,freetype) |
1006 | ("libart-lgpl" ,libart-lgpl) | |
1007 | ("font-curve-files" | |
1008 | ,(origin | |
1009 | (method url-fetch) | |
1010 | (uri "http://www.reportlab.com/ftp/pfbfer-20180109.zip") | |
1011 | (sha256 | |
1012 | (base32 | |
1013 | "1v0gy4mbx02ys96ssx89420y0njknlrxs2bx64bv4rp8a0al66w5")))))) | |
3fa2dc27 | 1014 | (propagated-inputs |
8394619b | 1015 | (list python-pillow)) |
16c76cc4 | 1016 | (home-page "https://www.reportlab.com") |
3fa2dc27 MB |
1017 | (synopsis "Python library for generating PDFs and graphics") |
1018 | (description "This is the ReportLab PDF Toolkit. It allows rapid creation | |
1019 | of rich PDF documents, and also creation of charts in a variety of bitmap and | |
1020 | vector formats.") | |
d8013ee2 | 1021 | (license license:bsd-3))) |
3fa2dc27 MB |
1022 | |
1023 | (define-public python2-reportlab | |
d8013ee2 | 1024 | (package-with-python2 python-reportlab)) |
8d4169a1 LC |
1025 | |
1026 | (define-public impressive | |
1027 | (package | |
1028 | (name "impressive") | |
7f0bccb5 | 1029 | (version "0.12.1") |
8d4169a1 LC |
1030 | (source (origin |
1031 | (method url-fetch) | |
1032 | (uri (string-append | |
1033 | "mirror://sourceforge/impressive/Impressive/" | |
1034 | version "/Impressive-" version ".tar.gz")) | |
1035 | (sha256 | |
1036 | (base32 | |
7f0bccb5 | 1037 | "1r7ihv41awnlnlry1kymb8fka053wdhzibfwcarn78rr3vs338vl")))) |
8d4169a1 LC |
1038 | (build-system python-build-system) |
1039 | ||
1040 | ;; TODO: Add dependency on pdftk. | |
8394619b | 1041 | (inputs (list python2-pygame python2-pillow sdl xpdf)) |
8d4169a1 LC |
1042 | |
1043 | (arguments | |
1044 | `(#:python ,python-2 | |
1045 | #:phases (modify-phases %standard-phases | |
1046 | (delete 'build) | |
1047 | (delete 'configure) | |
1048 | (delete 'check) | |
1049 | (replace 'install | |
1050 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1051 | ;; There's no 'setup.py' so install things manually. | |
1052 | (let* ((out (assoc-ref outputs "out")) | |
1053 | (bin (string-append out "/bin")) | |
1054 | (man1 (string-append out "/share/man/man1")) | |
1055 | (sdl (assoc-ref inputs "sdl")) | |
1056 | (xpdf (assoc-ref inputs "xpdf"))) | |
1057 | (mkdir-p bin) | |
1058 | (copy-file "impressive.py" | |
1059 | (string-append bin "/impressive")) | |
1060 | (wrap-program (string-append bin "/impressive") | |
1061 | `("LIBRARY_PATH" ":" prefix ;for ctypes | |
1062 | (,(string-append sdl "/lib"))) | |
1063 | `("PATH" ":" prefix ;for pdftoppm | |
1064 | (,(string-append xpdf "/bin")))) | |
8d4169a1 LC |
1065 | (install-file "impressive.1" man1) |
1066 | #t)))))) | |
1067 | (home-page "http://impressive.sourceforge.net") | |
1068 | (synopsis "PDF presentation tool with visual effects") | |
1069 | (description | |
1070 | "Impressive is a tool to display PDF files that provides visual effects | |
1071 | such as smooth alpha-blended slide transitions. It provides additional tools | |
1072 | such as zooming, highlighting an area of the screen, and a tool to navigate | |
1073 | the PDF pages.") | |
1074 | (license license:gpl2))) | |
f3e22216 | 1075 | |
6d80e264 NG |
1076 | (define-public img2pdf |
1077 | (package | |
1078 | (name "img2pdf") | |
58f63b2e | 1079 | (version "0.4.3") |
6d80e264 NG |
1080 | (source |
1081 | (origin | |
1082 | (method url-fetch) | |
1083 | (uri (pypi-uri "img2pdf" version)) | |
1084 | (sha256 | |
58f63b2e | 1085 | (base32 "17z0bn8kihiyqjd1m5jr80m7ry06l1qn0l8v918xg5gs7q2calcf")))) |
6d80e264 NG |
1086 | (build-system python-build-system) |
1087 | (propagated-inputs | |
e3196755 LC |
1088 | (list python-pikepdf python-pillow |
1089 | `(,python "tk"))) | |
6d80e264 NG |
1090 | (home-page "https://gitlab.mister-muffin.de/josch/img2pdf") |
1091 | (synopsis "Convert images to PDF via direct JPEG inclusion") | |
1092 | (description | |
1093 | "img2pdf converts images to PDF via direct JPEG inclusion. That | |
1094 | conversion is lossless: the image embedded in the PDF has the exact same color | |
1095 | information for every pixel as the input.") | |
1096 | (license license:lgpl3))) | |
1097 | ||
f3e22216 JL |
1098 | (define-public fbida |
1099 | (package | |
1100 | (name "fbida") | |
b3e5cb4c | 1101 | (version "2.14") |
f3e22216 JL |
1102 | (home-page "https://www.kraxel.org/blog/linux/fbida/") |
1103 | (source (origin | |
1104 | (method url-fetch) | |
1105 | (uri (string-append "https://www.kraxel.org/releases/fbida/" | |
91d42be7 | 1106 | "fbida-" version ".tar.gz")) |
f3e22216 JL |
1107 | (sha256 |
1108 | (base32 | |
b3e5cb4c | 1109 | "0f242mix20rgsqz1llibhsz4r2pbvx6k32rmky0zjvnbaqaw1dwm")))) |
f3e22216 JL |
1110 | (build-system gnu-build-system) |
1111 | (arguments | |
9c44af6b | 1112 | `(#:phases |
dc1d3cde | 1113 | (modify-phases %standard-phases |
b3e5cb4c | 1114 | (add-after 'unpack 'patch-FHS-file-names |
dc1d3cde KK |
1115 | (lambda _ |
1116 | (substitute* "mk/Autoconf.mk" | |
b3e5cb4c | 1117 | (("/bin/echo") "echo") |
dc1d3cde | 1118 | (("/sbin/ldconfig -p") "echo lib")) #t)) |
57c57f85 MO |
1119 | (add-before 'build 'set-fcommon |
1120 | (lambda _ | |
1121 | (setenv "CFLAGS" "-fcommon"))) | |
dc1d3cde | 1122 | (delete 'configure)) |
f3e22216 | 1123 | #:tests? #f |
57c57f85 MO |
1124 | #:make-flags |
1125 | (list (string-append "CC=" ,(cc-for-target)) | |
1126 | (string-append "prefix=" (assoc-ref %outputs "out"))))) | |
4bd428a7 | 1127 | (inputs `(("libjpeg" ,libjpeg-turbo) |
f3e22216 JL |
1128 | ("curl" ,curl) |
1129 | ("libtiff" ,libtiff) | |
1130 | ("libudev" ,eudev) | |
1131 | ("libwebp" ,libwebp) | |
1132 | ("libdrm" ,libdrm) | |
f3e22216 JL |
1133 | ("giflib" ,giflib) |
1134 | ("glib" ,glib) | |
1135 | ("cairo-xcb" ,cairo-xcb) | |
1136 | ("freetype" ,freetype) | |
1137 | ("fontconfig" ,fontconfig) | |
1138 | ("libexif" ,libexif) | |
1139 | ("mesa" ,mesa) | |
1140 | ("libepoxy" ,libepoxy) | |
1141 | ("libpng" ,libpng) | |
1142 | ("poppler" ,poppler))) | |
8394619b | 1143 | (native-inputs (list pkg-config)) |
f3e22216 JL |
1144 | (synopsis "Framebuffer and drm-based image viewer") |
1145 | (description | |
1146 | "fbida contains a few applications for viewing and editing images on | |
1147 | the framebuffer.") | |
f3e22216 | 1148 | (license license:gpl2+))) |
5d68e9d6 AI |
1149 | |
1150 | (define-public pdf2svg | |
1151 | (package | |
1152 | (name "pdf2svg") | |
1153 | (version "0.2.3") | |
1154 | (source (origin | |
1300dc4b RW |
1155 | (method git-fetch) |
1156 | (uri (git-reference | |
b0e7b699 | 1157 | (url "https://github.com/dawbarton/pdf2svg") |
1300dc4b RW |
1158 | (commit (string-append "v" version)))) |
1159 | (file-name (git-file-name name version)) | |
5d68e9d6 AI |
1160 | (sha256 |
1161 | (base32 | |
1300dc4b | 1162 | "14ffdm4y26imq99wjhkrhy9lp33165xci1l5ndwfia8hz53bl02k")))) |
5d68e9d6 AI |
1163 | (build-system gnu-build-system) |
1164 | (inputs | |
8394619b | 1165 | (list cairo poppler)) |
5d68e9d6 | 1166 | (native-inputs |
8394619b | 1167 | (list pkg-config)) |
5d68e9d6 AI |
1168 | (home-page "http://www.cityinthesky.co.uk/opensource/pdf2svg/") |
1169 | (synopsis "PDF to SVG converter") | |
1170 | (description "@command{pdf2svg} is a simple command-line PDF to SVG | |
1171 | converter using the Poppler and Cairo libraries.") | |
1172 | (license license:gpl2+))) | |
ad5a7d49 HG |
1173 | |
1174 | (define-public python-pypdf2 | |
1175 | (package | |
1176 | (name "python-pypdf2") | |
1177 | (version "1.26.0") | |
1178 | (source (origin | |
1179 | (method url-fetch) | |
1180 | (uri (pypi-uri "PyPDF2" version)) | |
1181 | (sha256 | |
1182 | (base32 | |
1183 | "11a3aqljg4sawjijkvzhs3irpw0y67zivqpbjpm065ha5wpr13z2")))) | |
1184 | (build-system python-build-system) | |
1185 | (arguments | |
1186 | `(#:phases | |
1187 | (modify-phases %standard-phases | |
1188 | (add-after | |
1189 | 'unpack 'patch-test-suite | |
1190 | (lambda _ | |
1191 | ;; The text-file needs to be opened in binary mode for Python 3, | |
1192 | ;; so patch in the "b" | |
1193 | (substitute* "Tests/tests.py" | |
1194 | (("pdftext_file = open\\(.* 'crazyones.txt'\\), 'r" line) | |
1195 | (string-append line "b"))) | |
1196 | #t)) | |
1197 | (replace 'check | |
1198 | (lambda _ | |
60b88466 | 1199 | (invoke "python" "-m" "unittest" "Tests.tests")))))) |
ad5a7d49 HG |
1200 | (home-page "http://mstamy2.github.com/PyPDF2") |
1201 | (synopsis "Pure Python PDF toolkit") | |
1202 | (description "PyPDF2 is a pure Python PDF library capable of: | |
1203 | ||
1204 | @enumerate | |
1205 | @item extracting document information (title, author, …) | |
1206 | @item splitting documents page by page | |
1207 | @item merging documents page by page | |
1208 | @item cropping pages | |
1209 | @item merging multiple pages into a single page | |
1210 | @item encrypting and decrypting PDF files | |
1211 | @end enumerate | |
1212 | ||
1213 | By being pure Python, it should run on any Python platform without any | |
1214 | dependencies on external libraries. It can also work entirely on | |
1215 | @code{StringIO} objects rather than file streams, allowing for PDF | |
1216 | manipulation in memory. It is therefore a useful tool for websites that | |
1217 | manage or manipulate PDFs.") | |
1218 | (license license:bsd-3))) | |
1219 | ||
1220 | (define-public python2-pypdf2 | |
1221 | (package-with-python2 python-pypdf2)) | |
c68e8591 HG |
1222 | |
1223 | (define-public python2-pypdf | |
1224 | (package | |
1225 | (name "python2-pypdf") | |
1226 | (version "1.13") | |
1227 | (source (origin | |
1228 | (method url-fetch) | |
1229 | (uri (pypi-uri "pyPdf" version)) | |
1230 | (sha256 | |
1231 | (base32 | |
1232 | "0fqfvamir7k41w84c73rghzkiv891gdr17q5iz4hgbf6r71y9v9s")))) | |
1233 | (build-system python-build-system) | |
1234 | (arguments | |
1235 | `(#:tests? #f ; no tests | |
1236 | #:python ,python-2)) | |
1237 | (home-page "http://pybrary.net/pyPdf/") | |
1238 | (synopsis "Pure Python PDF toolkit") | |
1239 | (description "PyPDF2 is a pure Python PDF toolkit. | |
1240 | ||
1241 | Note: This module isn't maintained anymore. For new projects please use | |
1242 | python-pypdf2 instead.") | |
1243 | (license license:bsd-3))) | |
99abcdbd | 1244 | |
0cd4a746 BS |
1245 | (define-public pdfarranger |
1246 | (package | |
1247 | (name "pdfarranger") | |
88fbcab1 | 1248 | (version "1.8.2") |
0cd4a746 BS |
1249 | (source |
1250 | (origin | |
1251 | (method git-fetch) | |
1252 | (uri (git-reference | |
b0e7b699 | 1253 | (url "https://github.com/jeromerobert/pdfarranger") |
0cd4a746 BS |
1254 | (commit version))) |
1255 | (file-name (git-file-name name version)) | |
1256 | (sha256 | |
88fbcab1 | 1257 | (base32 "18bpnnwjx72d5ps06dr89mkixiwzc9hf5gr75k8qcnrkshl038v2")))) |
0cd4a746 BS |
1258 | (build-system python-build-system) |
1259 | (arguments | |
1a4f1ea1 | 1260 | '(#:tests? #f ;no tests |
1a925d3a NG |
1261 | #:phases |
1262 | (modify-phases %standard-phases | |
1263 | (add-after 'install 'wrap-for-typelib | |
1264 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
1265 | (let* ((out (assoc-ref outputs "out")) | |
1266 | (program (string-append out "/bin/pdfarranger"))) | |
1267 | (wrap-program program | |
1268 | `("GI_TYPELIB_PATH" ":" prefix | |
1269 | (,(getenv "GI_TYPELIB_PATH")))))))))) | |
0cd4a746 | 1270 | (native-inputs |
8394619b | 1271 | (list intltool python-distutils-extra)) |
f63b8978 | 1272 | (inputs |
8394619b | 1273 | (list gtk+ poppler)) |
f63b8978 | 1274 | (propagated-inputs |
88fbcab1 NG |
1275 | (list img2pdf |
1276 | python-dateutil | |
1277 | python-pikepdf | |
1278 | python-pycairo | |
8394619b | 1279 | python-pygobject)) |
0cd4a746 BS |
1280 | (home-page "https://github.com/jeromerobert/pdfarranger") |
1281 | (synopsis "Merge, split and re-arrange pages from PDF documents") | |
1282 | (description | |
1283 | "PDF Arranger is a small application which allows one to merge or split | |
1284 | PDF documents and rotate, crop and rearrange their pages using an interactive | |
1285 | and intuitive graphical interface. | |
1286 | ||
1287 | PDF Arranger was formerly known as PDF-Shuffler.") | |
1288 | (license license:gpl3+))) | |
1289 | ||
99abcdbd HG |
1290 | (define-public pdfposter |
1291 | (package | |
1292 | (name "pdfposter") | |
60ba9d8c | 1293 | (version "0.7.post1") |
99abcdbd HG |
1294 | (source (origin |
1295 | (method url-fetch) | |
60ba9d8c | 1296 | (uri (pypi-uri "pdftools.pdfposter" version)) |
99abcdbd HG |
1297 | (sha256 |
1298 | (base32 | |
60ba9d8c | 1299 | "0c1avpbr9q53yzq5ar2x485rmp9d0l3z27aham32bg7gplzd7w0j")))) |
99abcdbd HG |
1300 | (build-system python-build-system) |
1301 | (arguments | |
60ba9d8c | 1302 | `(#:tests? #f)) ; test-suite not included in source archive |
99abcdbd | 1303 | (inputs |
8394619b | 1304 | (list python-pypdf2)) |
99abcdbd HG |
1305 | (home-page "https://pythonhosted.org/pdftools.pdfposter/") |
1306 | (synopsis "Scale and tile PDF images/pages to print on multiple pages") | |
1307 | (description "@command{pdfposter} can be used to create a large poster by | |
d6901d93 | 1308 | building it from multiple pages and/or printing it on large media. It expects |
99abcdbd HG |
1309 | as input a PDF file, normally printing on a single page. The output is again |
1310 | a PDF file, maybe containing multiple pages together building the poster. The | |
1311 | input page will be scaled to obtain the desired size. | |
1312 | ||
1313 | This is much like @command{poster} does for Postscript files, but working with | |
1314 | PDF. Since sometimes @command{poster} does not like your files converted from | |
1315 | PDF. Indeed @command{pdfposter} was inspired by @command{poster}.") | |
1316 | (license license:gpl3+))) | |
e05fc441 RS |
1317 | |
1318 | (define-public pdfgrep | |
1319 | (package | |
1320 | (name "pdfgrep") | |
7da4dbb3 | 1321 | (version "2.1.2") |
e05fc441 RS |
1322 | (source |
1323 | (origin | |
1324 | (method url-fetch) | |
1325 | (uri (string-append "https://pdfgrep.org/download/" | |
1326 | name "-" version ".tar.gz")) | |
1327 | (sha256 | |
1328 | (base32 | |
7da4dbb3 | 1329 | "1fia10djcxxl7n9jw2prargw4yzbykk6izig2443ycj9syhxrwqf")))) |
e05fc441 RS |
1330 | (build-system gnu-build-system) |
1331 | (native-inputs | |
8394619b | 1332 | (list pkg-config)) |
e05fc441 | 1333 | (inputs |
8394619b | 1334 | (list libgcrypt pcre poppler)) |
e05fc441 RS |
1335 | (home-page "https://pdfgrep.org") |
1336 | (synopsis "Command-line utility to search text in PDF files") | |
1337 | (description | |
1338 | "Pdfgrep searches in pdf files for strings matching a regular expression. | |
1339 | Support some GNU grep options as file name output, page number output, | |
1340 | optional case insensitivity, count occurrences, color highlights and search in | |
1341 | multiple files.") | |
1342 | (license license:gpl2+))) | |
e2ec95c4 RW |
1343 | |
1344 | (define-public pdfpc | |
1345 | (package | |
1346 | (name "pdfpc") | |
000b3408 | 1347 | (version "4.5.0") |
e2ec95c4 RW |
1348 | (source |
1349 | (origin | |
1350 | (method git-fetch) | |
1351 | (uri (git-reference | |
b0e7b699 | 1352 | (url "https://github.com/pdfpc/pdfpc") |
e2ec95c4 RW |
1353 | (commit (string-append "v" version)))) |
1354 | (file-name (git-file-name name version)) | |
1355 | (sha256 | |
000b3408 | 1356 | (base32 "0bmy51w6ypz927hxwp5g7wapqvzqmsi3w32rch6i3f94kg1152ck")))) |
e2ec95c4 | 1357 | (build-system cmake-build-system) |
000b3408 RW |
1358 | (arguments |
1359 | '(#:tests? #f ; no test target | |
1360 | #:phases | |
1361 | (modify-phases %standard-phases | |
1362 | ;; This is really a bug in Vala. | |
1363 | ;; https://github.com/pdfpc/pdfpc/issues/594 | |
1364 | (add-after 'unpack 'fix-vala-API-conflict | |
1365 | (lambda _ | |
1366 | (substitute* "src/classes/action/movie.vala" | |
1367 | (("info.from_caps\\(caps\\)") | |
1368 | "Gst.Video.info_from_caps(out info, caps)"))))))) | |
e2ec95c4 RW |
1369 | (inputs |
1370 | `(("cairo" ,cairo) | |
000b3408 | 1371 | ("discount" ,discount) ; libmarkdown |
e2ec95c4 RW |
1372 | ("gtk+" ,gtk+) |
1373 | ("gstreamer" ,gstreamer) | |
1374 | ("gst-plugins-base" ,gst-plugins-base) | |
000b3408 | 1375 | ("json-glib" ,json-glib) |
e2ec95c4 RW |
1376 | ("libgee" ,libgee) |
1377 | ("poppler" ,poppler) | |
1378 | ("pango" ,pango) | |
000b3408 | 1379 | ("vala" ,vala) |
e55547bf | 1380 | ("webkitgtk" ,webkitgtk-with-libsoup2))) |
e2ec95c4 | 1381 | (native-inputs |
8394619b | 1382 | (list pkg-config)) |
e2ec95c4 RW |
1383 | (home-page "https://pdfpc.github.io/") |
1384 | (synopsis "Presenter console with multi-monitor support for PDF files") | |
1385 | (description | |
1386 | "pdfpc is a presentation viewer application which uses multi-monitor | |
1387 | output to provide meta information to the speaker during the presentation. It | |
1388 | is able to show a normal presentation window on one screen, while showing a | |
1389 | more sophisticated overview on the other one providing information like a | |
1390 | picture of the next slide, as well as the left over time till the end of the | |
1391 | presentation. The input files processed by pdfpc are PDF documents.") | |
000b3408 | 1392 | (license license:gpl3+))) |
a773f141 RW |
1393 | |
1394 | (define-public paps | |
a26b73b6 TGR |
1395 | (package |
1396 | (name "paps") | |
1397 | (version "0.7.1") | |
1398 | (source | |
1399 | (origin | |
1400 | (method url-fetch) | |
1401 | (uri (string-append "https://github.com/dov/paps/releases/download/v" | |
1402 | version "/paps-" version ".tar.gz")) | |
1403 | (sha256 | |
1404 | (base32 "1z1w1fg2bvb8p92n1jlpqp3n9mq42szb2mqhh4xqmmnmfcdkpi9s")))) | |
1405 | (build-system gnu-build-system) | |
1406 | (inputs | |
8394619b | 1407 | (list pango)) |
a26b73b6 | 1408 | (native-inputs |
8394619b | 1409 | (list intltool pkg-config)) |
a26b73b6 TGR |
1410 | (home-page "https://github.com/dov/paps") |
1411 | (synopsis "Pango to PostScript converter") | |
1412 | (description | |
1413 | "Paps reads a UTF-8 encoded file and generates a PostScript language | |
6fdd40b3 | 1414 | rendering of the file through the Pango Cairo back end.") |
a26b73b6 | 1415 | (license license:lgpl2.0+))) |
667c004c AI |
1416 | |
1417 | (define-public stapler | |
1418 | (package | |
1419 | (name "stapler") | |
09dfb0c4 | 1420 | (version "1.0.0") |
667c004c AI |
1421 | (source |
1422 | (origin | |
09dfb0c4 KK |
1423 | (method url-fetch) |
1424 | (uri (pypi-uri "stapler" version)) | |
667c004c AI |
1425 | (sha256 |
1426 | (base32 | |
09dfb0c4 | 1427 | "0b2lbm3f79cdxcsagwhzihbzwahjabxqmbws0c8ki25gpdnygdd7")))) |
667c004c | 1428 | (build-system python-build-system) |
667c004c | 1429 | (arguments |
09dfb0c4 | 1430 | '(#:phases |
667c004c | 1431 | (modify-phases %standard-phases |
09dfb0c4 | 1432 | (add-after 'unpack 'fix-more-itertools-version-requirement |
667c004c | 1433 | (lambda _ |
09dfb0c4 KK |
1434 | ;; Tests require an version of the more-itertools module older |
1435 | ;; than the one we have packaged. | |
667c004c | 1436 | (substitute* "setup.py" |
09dfb0c4 | 1437 | (("more-itertools>=2\\.2,<6\\.0\\.0") "more-itertools>=2.2")) |
667c004c | 1438 | #t))))) |
09dfb0c4 | 1439 | (propagated-inputs |
8394619b | 1440 | (list python-more-itertools python-pypdf2)) |
667c004c AI |
1441 | (home-page "https://github.com/hellerbarde/stapler") |
1442 | (synopsis "PDF manipulation tool") | |
1443 | (description "Stapler is a pure Python alternative to PDFtk, a tool for | |
1444 | manipulating PDF documents from the command line. It supports | |
1445 | ||
1446 | @itemize | |
1447 | @item cherry-picking pages and concatenating them into a new file | |
1448 | @item splitting a PDF document into single pages each in its own file | |
1449 | @item merging PDF documents with their pages interleaved | |
1450 | @item displaying metadata in a PDF document | |
1451 | @item displaying the mapping between logical and physical page numbers | |
1452 | @end itemize") | |
1453 | (license license:bsd-3))) | |
77e0cebc HG |
1454 | |
1455 | (define-public weasyprint | |
1456 | (package | |
1457 | (name "weasyprint") | |
c601e2bf | 1458 | (version "52.1") |
77e0cebc HG |
1459 | (source |
1460 | (origin | |
c601e2bf MC |
1461 | (method git-fetch) |
1462 | (uri (git-reference | |
1463 | (url "https://github.com/FelixSchwarz/WeasyPrint") | |
1464 | (commit (string-append "v" version)))) | |
1465 | (file-name (git-file-name name version)) | |
77e0cebc | 1466 | (sha256 |
c601e2bf MC |
1467 | (base32 |
1468 | "0rcj9yah3bp6bbvkmny3w4csx4l5v49lc7mrk29g0x77qnwswjy7")))) | |
77e0cebc HG |
1469 | (build-system python-build-system) |
1470 | (arguments | |
1471 | `(#:phases | |
1472 | (modify-phases %standard-phases | |
1473 | (add-after 'unpack 'patch-library-paths | |
1474 | (lambda* (#:key inputs #:allow-other-keys) | |
1475 | (let ((fontconfig (assoc-ref inputs "fontconfig")) | |
1476 | (glib (assoc-ref inputs "glib")) | |
1477 | (pango (assoc-ref inputs "pango")) | |
1478 | (pangoft2 (assoc-ref inputs "pangoft2"))) | |
1479 | (substitute* "weasyprint/fonts.py" | |
c601e2bf MC |
1480 | (("'fontconfig'") |
1481 | (format #f "'~a/lib/libfontconfig.so'" fontconfig)) | |
1482 | (("'pangoft2-1.0'") | |
1483 | (format #f "'~a/lib/libpangoft2-1.0.so'" pango))) | |
77e0cebc | 1484 | (substitute* "weasyprint/text.py" |
c601e2bf MC |
1485 | (("'gobject-2.0'") |
1486 | (format #f "'~a/lib/libgobject-2.0.so'" glib)) | |
1487 | (("'pango-1.0'") | |
1488 | (format #f "'~a/lib/libpango-1.0.so'" pango)) | |
1489 | (("'pangocairo-1.0'") | |
1490 | (format #f "'~a/lib/libpangocairo-1.0.so'" pango))) | |
1491 | #t))) | |
1492 | (add-after 'unpack 'disable-linters | |
1493 | ;; Their check fails; none of our business. | |
77e0cebc HG |
1494 | (lambda _ |
1495 | (substitute* "setup.cfg" | |
c601e2bf MC |
1496 | ((".*pytest-flake8.*") "") |
1497 | ((".*pytest-isort.*") "") | |
1498 | (("--flake8") "") | |
1499 | (("--isort") "")) | |
1500 | #t)) | |
1501 | (add-before 'check 'register-dejavu-font | |
1502 | (lambda* (#:key inputs #:allow-other-keys) | |
1503 | ;; TODO: fix FreeType so that fonts found in XDG_DATA_DIRS are | |
1504 | ;; honored. | |
1505 | (let* ((HOME "/tmp") | |
1506 | (dejavu (assoc-ref inputs "font-dejavu")) | |
1507 | (fonts-dir (string-append HOME "/.fonts"))) | |
1508 | (setenv "HOME" HOME) | |
1509 | (mkdir-p fonts-dir) | |
1510 | (symlink (string-append dejavu "/share/fonts/truetype") | |
1511 | (string-append fonts-dir "/truetype")) | |
1512 | (invoke "fc-cache" "-rv"))))))) | |
77e0cebc HG |
1513 | (inputs |
1514 | `(("fontconfig" ,fontconfig) | |
1515 | ("glib" ,glib) | |
1516 | ("pango" ,pango))) | |
1517 | (propagated-inputs | |
8394619b LC |
1518 | (list gdk-pixbuf |
1519 | python-cairocffi | |
1520 | python-cairosvg | |
1521 | python-cffi | |
1522 | python-cssselect2 | |
1523 | python-html5lib | |
1524 | python-pyphen | |
1525 | python-tinycss2)) | |
77e0cebc | 1526 | (native-inputs |
8394619b LC |
1527 | (list font-dejavu ;tests depend on it |
1528 | python-pytest-cov python-pytest-runner)) | |
77e0cebc HG |
1529 | (home-page "https://weasyprint.org/") |
1530 | (synopsis "Document factory for creating PDF files from HTML") | |
1531 | (description "WeasyPrint helps web developers to create PDF documents. It | |
1532 | turns simple HTML pages into gorgeous statistical reports, invoices, tickets, | |
1533 | etc. | |
1534 | ||
1535 | From a technical point of view, WeasyPrint is a visual rendering engine for | |
1536 | HTML and CSS that can export to PDF and PNG. It aims to support web standards | |
1537 | for printing. | |
1538 | ||
1539 | It is based on various libraries but not on a full rendering engine like | |
1540 | WebKit or Gecko. The CSS layout engine is written in Python, designed for | |
1541 | pagination, and meant to be easy to hack on. Weasyprint can also be used as a | |
1542 | python library. | |
1543 | ||
1544 | Keywords: html2pdf, htmltopdf") | |
1545 | (license license:bsd-3))) |