Commit | Line | Data |
---|---|---|
1a8bf1dc PW |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2015 Paul van der Walt <paul@denknerd.org> | |
794ebb6b | 3 | ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr> |
e6c2a88f | 4 | ;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr> |
f6a42ac9 | 5 | ;;; Copyright © 2020 Guillaume Le Vaillant <glv@posteo.net> |
1a8bf1dc PW |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
10 | ;;; under the terms of the GNU General Public License as published by | |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
14 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
22 | (define-module (gnu packages djvu) | |
23 | #:use-module ((guix licenses) #:prefix license:) | |
794ebb6b | 24 | #:use-module (guix utils) |
1a8bf1dc PW |
25 | #:use-module (guix packages) |
26 | #:use-module (guix download) | |
e6c2a88f | 27 | #:use-module (guix git-download) |
794ebb6b | 28 | #:use-module (guix build-system gnu) |
e6c2a88f | 29 | #:use-module (gnu packages autotools) |
f6a42ac9 GLV |
30 | #:use-module (gnu packages check) |
31 | #:use-module (gnu packages gettext) | |
794ebb6b NG |
32 | #:use-module (gnu packages glib) |
33 | #:use-module (gnu packages image) | |
f6a42ac9 GLV |
34 | #:use-module (gnu packages imagemagick) |
35 | #:use-module (gnu packages linux) | |
36 | #:use-module (gnu packages pdf) | |
794ebb6b | 37 | #:use-module (gnu packages pkg-config) |
f6a42ac9 | 38 | #:use-module (gnu packages python) |
794ebb6b NG |
39 | #:use-module (gnu packages qt) |
40 | #:use-module (gnu packages xorg)) | |
1a8bf1dc PW |
41 | |
42 | (define-public djvulibre | |
43 | (package | |
44 | (name "djvulibre") | |
45 | (version "3.5.27") | |
46 | (source (origin | |
47 | (method url-fetch) | |
de67e922 LF |
48 | (uri (string-append "mirror://sourceforge/djvu/DjVuLibre/" |
49 | version "/djvulibre-" version ".tar.gz")) | |
1a8bf1dc PW |
50 | (sha256 |
51 | (base32 | |
52 | "0psh3zl9dj4n4r3lx25390nx34xz0bg0ql48zdskhq354ljni5p6")))) | |
53 | (build-system gnu-build-system) | |
5fe2a139 R |
54 | (arguments |
55 | `(#:phases (modify-phases %standard-phases | |
56 | (add-after 'unpack 'reproducible | |
57 | (lambda _ | |
58 | ;; Ensure there are no timestamps in .svgz files. | |
59 | (substitute* "desktopfiles/Makefile.in" | |
60 | (("gzip") "gzip -n")) | |
61 | #t))))) | |
1a8bf1dc PW |
62 | (home-page "http://djvu.sourceforge.net/") |
63 | (synopsis "Implementation of DjVu, the document format") | |
64 | (description "DjVuLibre is an implementation of DjVu, | |
65 | including viewers, browser plugins, decoders, simple encoders, and | |
66 | utilities.") | |
67 | (license license:gpl2+))) | |
794ebb6b NG |
68 | |
69 | (define-public djview | |
70 | (package | |
71 | (name "djview") | |
e6c2a88f | 72 | (version "4.11") |
794ebb6b NG |
73 | (source |
74 | (origin | |
e6c2a88f TGR |
75 | (method git-fetch) |
76 | (uri (git-reference | |
77 | (url "https://git.code.sf.net/p/djvu/djview-git") | |
78 | (commit (string-append "release." version)))) | |
794ebb6b | 79 | (sha256 |
e6c2a88f TGR |
80 | (base32 "0qlhd0xlxn8i869m0hwdjvwivi2vigqm88wliyr1h7s84zl3qhsy")) |
81 | (file-name (git-file-name name version)))) | |
794ebb6b NG |
82 | (build-system gnu-build-system) |
83 | (native-inputs | |
e6c2a88f TGR |
84 | `(("autoconf" ,autoconf) |
85 | ("automake" ,automake) | |
86 | ("libtool" ,libtool) | |
87 | ("pkg-config" ,pkg-config) | |
794ebb6b NG |
88 | ("qttools" ,qttools))) |
89 | (inputs | |
f8c2d324 NG |
90 | `(("djvulibre" ,djvulibre) |
91 | ("glib" ,glib) | |
794ebb6b NG |
92 | ("libxt" ,libxt) |
93 | ("libtiff" ,libtiff) | |
f8c2d324 NG |
94 | ("qtbase" ,qtbase))) |
95 | (arguments | |
96 | `(#:phases | |
97 | (modify-phases %standard-phases | |
98 | (add-after 'unpack 'fix-desktop-file | |
99 | ;; Executable is "djview", not "djview4". | |
100 | (lambda _ | |
101 | (substitute* "desktopfiles/djvulibre-djview4.desktop" | |
102 | (("Exec=djview4 %f") "Exec=djview %f")) | |
e6c2a88f TGR |
103 | #t)) |
104 | (add-after 'unpack 'make-files-writable | |
105 | (lambda _ | |
106 | (for-each make-file-writable | |
107 | (find-files ".")) | |
f8c2d324 | 108 | #t))))) |
0d79e82a | 109 | (home-page "http://djvu.sourceforge.net/djview4.html") |
794ebb6b NG |
110 | (synopsis "Viewer for the DjVu image format") |
111 | (description "DjView is a standalone viewer for DjVu files. | |
112 | ||
113 | Its features include navigating documents, zooming and panning page images, | |
114 | producing and displaying thumbnails, displaying document outlines, searching | |
115 | documents for particular words in the hidden text layer, copying hidden text | |
116 | to the clipboard, saving pages and documents as bundled or indirect multi-page | |
117 | files, and printing page and documents. | |
118 | ||
119 | The viewer can simultaneously display several pages using a side-by-side or | |
120 | a continuous layout.") | |
121 | (license license:gpl2+))) | |
f6a42ac9 GLV |
122 | |
123 | (define-public pdf2djvu | |
124 | (package | |
125 | (name "pdf2djvu") | |
126 | (version "0.9.17.1") | |
127 | (source | |
128 | (origin | |
129 | (method url-fetch) | |
130 | (uri (string-append | |
131 | "https://github.com/jwilk/pdf2djvu/releases/download/" version | |
132 | "/pdf2djvu-" version ".tar.xz")) | |
133 | (sha256 | |
134 | (base32 "18r648kna6ccw0m0nfxxnsmz541k69d0w9zzqvm1x2l5qyyvgfsv")))) | |
135 | (build-system gnu-build-system) | |
136 | (native-inputs | |
137 | `(("gettext" ,gettext-minimal) | |
138 | ("pkg-config" ,pkg-config) | |
139 | ("python2" ,python-2) | |
140 | ("python2-nose" ,python2-nose))) | |
141 | (inputs | |
142 | `(("djvulibre" ,djvulibre) | |
143 | ("exiv2" ,exiv2) | |
144 | ("graphicsmagick" ,graphicsmagick) | |
145 | ("poppler" ,poppler) | |
146 | ("poppler-data" ,poppler-data) | |
147 | ("util-linux-lib" ,util-linux "lib"))) ; for libuuid | |
148 | (arguments | |
149 | `(#:test-target "test")) | |
150 | (synopsis "PDF to DjVu converter") | |
151 | (description | |
152 | "@code{pdf2djvu} creates DjVu files from PDF files. | |
153 | It is able to extract: | |
154 | @itemize | |
155 | @item graphics, | |
156 | @item text layer, | |
157 | @item hyperlinks, | |
158 | @item document outline (bookmarks), | |
159 | @item metadata (including XMP metadata). | |
160 | @end itemize\n") | |
161 | (home-page "https://jwilk.net/software/pdf2djvu") | |
162 | (license license:gpl2))) |