Commit | Line | Data |
---|---|---|
947ae545 | 1 | ;;; GNU Guix --- Functional package management for GNU |
7d1f8d4f | 2 | ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr> |
152d6bf0 | 3 | ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il> |
37e8a2e2 | 4 | ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com> |
29f61501 | 5 | ;;; Copyright © 2017, 2019, 2020 Brendan Tildesley <mail@brendan.scot> |
f70f3407 | 6 | ;;; Copyright © 2017 Roel Janssen <roel@gnu.org> |
98c3eed1 | 7 | ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr> |
6266a48d | 8 | ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com> |
32ab4541 | 9 | ;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net> |
4c9a4079 | 10 | ;;; Copyright © 2020 Zheng Junjie <873216071@qq.com> |
947ae545 AE |
11 | ;;; |
12 | ;;; This file is part of GNU Guix. | |
13 | ;;; | |
14 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
15 | ;;; under the terms of the GNU General Public License as published by | |
16 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
17 | ;;; your option) any later version. | |
18 | ;;; | |
19 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
20 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 | ;;; GNU General Public License for more details. | |
23 | ;;; | |
24 | ;;; You should have received a copy of the GNU General Public License | |
25 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
26 | ||
27 | (define-module (gnu packages ebook) | |
affaf98f | 28 | #:use-module ((guix licenses) #:prefix license:) |
947ae545 AE |
29 | #:use-module (guix packages) |
30 | #:use-module (guix download) | |
13ba3dc8 | 31 | #:use-module (guix utils) |
6f0ae143 | 32 | #:use-module (guix git-download) |
4c9a4079 | 33 | #:use-module (guix build-system cmake) |
a34816ef | 34 | #:use-module (guix build-system gnu) |
13ba3dc8 | 35 | #:use-module (guix build-system meson) |
b8ac8c28 AE |
36 | #:use-module (guix build-system python) |
37 | #:use-module (gnu packages) | |
d6ef422f DM |
38 | #:use-module (gnu packages compression) |
39 | #:use-module (gnu packages curl) | |
b8ac8c28 | 40 | #:use-module (gnu packages databases) |
13ba3dc8 | 41 | #:use-module (gnu packages file) |
b3399a09 | 42 | #:use-module (gnu packages fonts) |
b8ac8c28 AE |
43 | #:use-module (gnu packages fontutils) |
44 | #:use-module (gnu packages freedesktop) | |
d6ef422f | 45 | #:use-module (gnu packages fribidi) |
04842543 | 46 | #:use-module (gnu packages gcc) |
13ba3dc8 | 47 | #:use-module (gnu packages gettext) |
d6ef422f | 48 | #:use-module (gnu packages gtk) |
eeba7d3a | 49 | #:use-module (gnu packages gnome) |
b8ac8c28 | 50 | #:use-module (gnu packages glib) |
13ba3dc8 | 51 | #:use-module (gnu packages gstreamer) |
b8ac8c28 AE |
52 | #:use-module (gnu packages icu4c) |
53 | #:use-module (gnu packages image) | |
d243b41d | 54 | #:use-module (gnu packages javascript) |
b8ac8c28 | 55 | #:use-module (gnu packages libusb) |
d79ec4fd | 56 | #:use-module (gnu packages libreoffice) |
13ba3dc8 | 57 | #:use-module (gnu packages music) |
b8ac8c28 AE |
58 | #:use-module (gnu packages pdf) |
59 | #:use-module (gnu packages pkg-config) | |
60 | #:use-module (gnu packages python) | |
1b2f753d | 61 | #:use-module (gnu packages python-web) |
44d10b1f | 62 | #:use-module (gnu packages python-xyz) |
b8ac8c28 | 63 | #:use-module (gnu packages qt) |
9ef5940c | 64 | #:use-module (gnu packages serialization) |
cd0322a3 | 65 | #:use-module (gnu packages sqlite) |
33dc54b0 | 66 | #:use-module (gnu packages time) |
cc2b77df | 67 | #:use-module (gnu packages tls) |
d94a99ec | 68 | #:use-module (gnu packages web) |
d6ef422f | 69 | #:use-module (gnu packages xml) |
7c041187 JL |
70 | #:use-module (gnu packages xorg) |
71 | #:use-module (gnu packages wxwidgets)) | |
947ae545 AE |
72 | |
73 | (define-public chmlib | |
74 | (package | |
75 | (name "chmlib") | |
76 | (version "0.40") | |
77 | (source (origin | |
78 | (method url-fetch) | |
79 | (uri (string-append "http://www.jedrea.com/chmlib/chmlib-" | |
80 | version ".tar.bz2")) | |
81 | (sha256 | |
82 | (base32 | |
a34816ef | 83 | "18zzb4x3z0d7fjh1x5439bs62dmgsi4c1pg3qyr7h5gp1i5xcj9l")) |
fc1adab1 | 84 | (patches (search-patches "chmlib-inttypes.patch")))) |
947ae545 AE |
85 | (build-system gnu-build-system) |
86 | (home-page "http://www.jedrea.com/chmlib/") | |
87 | (synopsis "Library for CHM files") | |
88 | (description "CHMLIB is a library for dealing with ITSS/CHM format files.") | |
affaf98f | 89 | (license license:lgpl2.1+))) |
b8ac8c28 AE |
90 | |
91 | (define-public calibre | |
92 | (package | |
93 | (name "calibre") | |
d79ec4fd | 94 | (version "4.18.0") |
b8ac8c28 AE |
95 | (source |
96 | (origin | |
97 | (method url-fetch) | |
98 | (uri (string-append "http://download.calibre-ebook.com/" | |
99 | version "/calibre-" | |
100 | version ".tar.xz")) | |
101 | (sha256 | |
9acd40fe | 102 | (base32 |
d79ec4fd | 103 | "0w9pcfvskjh4v00vjw3i6hzrafy863pgsmmqdx4lffip3p856brw")) |
b8ac8c28 AE |
104 | (modules '((guix build utils))) |
105 | (snippet | |
106 | '(begin | |
d79ec4fd | 107 | ;; Unbundle python2-odfpy. |
68435a7f | 108 | (delete-file-recursively "src/odf") |
d79ec4fd MB |
109 | ;; Disable test that attempts to load it. |
110 | (substitute* "setup/test.py" | |
111 | ((".*SRC, 'odf'.*") | |
112 | "")) | |
113 | ||
114 | ;; Remove unneeded resources. | |
f3f017db BT |
115 | (delete-file "resources/viewer.js") |
116 | (delete-file "resources/viewer.html") | |
117 | (delete-file "resources/mozilla-ca-certs.pem") | |
118 | (delete-file "resources/calibre-portable.bat") | |
119 | (delete-file "resources/calibre-portable.sh") | |
68435a7f | 120 | #t)) |
15871b40 | 121 | (patches (search-patches "calibre-no-updates-dialog.patch" |
cbe399e7 | 122 | "calibre-remove-test-sqlite.patch" ; TODO: fix test. |
15871b40 | 123 | "calibre-remove-test-unrar.patch")))) |
b8ac8c28 AE |
124 | (build-system python-build-system) |
125 | (native-inputs | |
126 | `(("pkg-config" ,pkg-config) | |
c5ea9120 | 127 | ("qtbase" ,qtbase) ; for qmake |
9b7dcc27 | 128 | ("python2-flake8" ,python2-flake8) |
b8ac8c28 | 129 | ("xdg-utils" ,xdg-utils))) |
b8ac8c28 AE |
130 | (inputs |
131 | `(("chmlib" ,chmlib) | |
132 | ("fontconfig" ,fontconfig) | |
13068a8c | 133 | ("font-liberation" ,font-liberation) |
b8ac8c28 | 134 | ("glib" ,glib) |
d79ec4fd MB |
135 | ("hunspell" ,hunspell) |
136 | ("hyphen" ,hyphen) | |
b8ac8c28 | 137 | ("icu4c" ,icu4c) |
d243b41d | 138 | ("js-mathjax" ,js-mathjax) |
b8ac8c28 AE |
139 | ("libmtp" ,libmtp) |
140 | ("libpng" ,libpng) | |
141 | ("libusb" ,libusb) | |
df00e148 | 142 | ("openssl" ,openssl) |
9132212f | 143 | ("optipng" ,optipng) |
b8ac8c28 | 144 | ("podofo" ,podofo) |
9b7dcc27 | 145 | ("poppler" ,poppler) |
b8ac8c28 AE |
146 | ("python" ,python-2) |
147 | ("python2-apsw" ,python2-apsw) | |
d79ec4fd | 148 | ("python2-beautifulsoup4" ,python2-beautifulsoup4) |
eeba7d3a | 149 | ("python2-chardet" ,python2-chardet) |
b8ac8c28 | 150 | ("python2-cssselect" ,python2-cssselect) |
4e6f8a14 | 151 | ("python2-css-parser" ,python2-css-parser) |
b8ac8c28 AE |
152 | ("python2-dateutil" ,python2-dateutil) |
153 | ("python2-dbus" ,python2-dbus) | |
7a8a4fd7 | 154 | ("python2-dnspython" ,python2-dnspython-1.16) |
bf4a40db | 155 | ("python2-dukpy" ,python2-dukpy) |
d94a99ec | 156 | ("python2-feedparser" ,python2-feedparser) |
adc25b68 | 157 | ("python2-html2text" ,python2-html2text) |
026ebc14 | 158 | ("python2-html5-parser" ,python2-html5-parser) |
4f299020 | 159 | ("python2-html5lib" ,python2-html5lib) |
b8ac8c28 | 160 | ("python2-lxml" ,python2-lxml) |
29ec0851 | 161 | ("python2-markdown" ,python2-markdown) |
b8ac8c28 | 162 | ("python2-mechanize" ,python2-mechanize) |
9ef5940c MR |
163 | ;; python2-msgpack is needed for the network content server to work. |
164 | ("python2-msgpack" ,python2-msgpack) | |
b8ac8c28 | 165 | ("python2-netifaces" ,python2-netifaces) |
68435a7f | 166 | ("python2-odfpy" ,python2-odfpy) |
2fbec762 | 167 | ("python2-pillow" ,python2-pillow) |
4f299020 | 168 | ("python2-psutil" ,python2-psutil) |
9b7dcc27 | 169 | ("python2-pygments" ,python2-pygments) |
d79ec4fd | 170 | ("python2-pyqtwebengine" ,python2-pyqtwebengine) |
c5ea9120 | 171 | ("python2-pyqt" ,python2-pyqt) |
b8ac8c28 | 172 | ("python2-sip" ,python2-sip) |
f70f3407 | 173 | ("python2-regex" ,python2-regex) |
d79ec4fd | 174 | ("qtwebengine" ,qtwebengine) |
b8ac8c28 AE |
175 | ("sqlite" ,sqlite))) |
176 | (arguments | |
177 | `(#:python ,python-2 | |
e89aceab HG |
178 | ;; Calibre is using setuptools by itself, but the setup.py is not |
179 | ;; compatible with the shim wrapper (taken from pip) we are using. | |
180 | #:use-setuptools? #f | |
b8ac8c28 | 181 | #:phases |
b111bdb6 | 182 | (modify-phases %standard-phases |
1326166e BT |
183 | (add-after 'unpack 'patch-source |
184 | (lambda _ | |
185 | (substitute* "src/calibre/linux.py" | |
186 | ;; We can't use the uninstaller in Guix. Don't build it. | |
187 | (("self\\.create_uninstaller()") "")) | |
188 | #t)) | |
d79ec4fd MB |
189 | (add-after 'patch-source-shebangs 'patch-more-shebangs |
190 | (lambda _ | |
191 | ;; Patch various inline shebangs. | |
192 | (substitute* '("src/calibre/gui2/preferences/tweaks.py" | |
193 | "src/calibre/gui2/dialogs/custom_recipes.py" | |
194 | "setup/install.py" | |
195 | "setup/linux-installer.sh") | |
196 | (("#!/usr/bin/env python") | |
197 | (string-append "#!" (which "python"))) | |
198 | (("#!/bin/sh") | |
199 | (string-append "#!" (which "sh")))) | |
200 | #t)) | |
f70f3407 RJ |
201 | (add-after 'unpack 'dont-load-remote-icons |
202 | (lambda _ | |
203 | (substitute* "setup/plugins_mirror.py" | |
204 | (("href=\"//calibre-ebook.com/favicon.ico\"") | |
205 | "href=\"favicon.ico\"")) | |
206 | #t)) | |
b111bdb6 | 207 | (add-before 'build 'configure |
6e1ab5fa | 208 | (lambda* (#:key inputs outputs #:allow-other-keys) |
b8ac8c28 | 209 | (let ((podofo (assoc-ref inputs "podofo")) |
6e1ab5fa | 210 | (pyqt (assoc-ref inputs "python2-pyqt")) |
d79ec4fd | 211 | (python-sip (assoc-ref inputs "python2-sip")) |
6e1ab5fa | 212 | (out (assoc-ref outputs "out"))) |
b8ac8c28 | 213 | (substitute* "setup/build_environment.py" |
d79ec4fd MB |
214 | (("= get_sip_dir\\(\\)") |
215 | (string-append "= '" pyqt "/share/sip'"))) | |
216 | ||
b65b78ff MO |
217 | (substitute* "src/calibre/ebooks/pdf/pdftohtml.py" |
218 | (("PDFTOHTML = 'pdftohtml'") | |
219 | (string-append "PDFTOHTML = \"" (assoc-ref inputs "poppler") | |
6e1ab5fa BT |
220 | "/bin/pdftohtml\""))) |
221 | ||
222 | ;; Calibre thinks we are installing desktop files into a home | |
223 | ;; directory, but here we butcher the script in to installing | |
224 | ;; to calibres /share directory. | |
225 | (setenv "XDG_DATA_HOME" (string-append out "/share")) | |
226 | (substitute* "src/calibre/linux.py" | |
227 | (("'~/.local/share'") "''")) | |
228 | ||
d79ec4fd MB |
229 | ;; 'python setup.py rapydscript' uses QtWebEngine, which |
230 | ;; needs to create temporary files in $HOME. | |
231 | (setenv "HOME" "/tmp") | |
232 | ||
233 | ;; XXX: QtWebEngine will fail if no fonts are available. This | |
234 | ;; can likely be removed when fontconfig has been patched to | |
235 | ;; include TrueType fonts by default. | |
236 | (symlink (string-append (assoc-ref inputs "font-liberation") | |
237 | "/share/fonts") | |
238 | "/tmp/.fonts") | |
239 | ||
240 | (setenv "SIP_BIN" (string-append python-sip "/bin/sip")) | |
b8ac8c28 | 241 | (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo")) |
ae16afe9 | 242 | (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib")) |
b01cde1a BT |
243 | ;; This informs the tests we are a continuous integration |
244 | ;; environment and thus have no networking. | |
245 | (setenv "CI" "true") | |
4bcd0647 BT |
246 | ;; The Qt test complains about being unable to load all image plugins, and I |
247 | ;; notice the available plugins list it shows lacks 'svg'. Adding qtsvg doesn't | |
248 | ;; fix it, so I'm not sure how to fix it. TODO: Fix test and remove this. | |
249 | (setenv "SKIP_QT_BUILD_TEST" "true") | |
ae16afe9 | 250 | #t))) |
d243b41d BT |
251 | (add-after 'build 'build-extra |
252 | (lambda* (#:key inputs #:allow-other-keys) | |
421c5e92 BT |
253 | (invoke "python2" "setup.py" "mathjax""--system-mathjax" |
254 | "--path-to-mathjax" (string-append | |
255 | (assoc-ref inputs "js-mathjax") | |
256 | "/share/javascript/mathjax")) | |
d9dec147 | 257 | (invoke "python2" "setup.py" "rapydscript") |
fd3eac4d | 258 | #t)) |
d6dfe8b6 BT |
259 | (add-after 'install 'install-man-pages |
260 | (lambda* (#:key outputs #:allow-other-keys) | |
261 | (copy-recursively | |
262 | "man-pages" | |
263 | (string-append (assoc-ref outputs "out") "/share/man")) | |
264 | #t)) | |
13068a8c BT |
265 | ;; The font TTF files are used in some miscellaneous tests, so we |
266 | ;; unbundle them here to avoid patching the tests. | |
267 | (add-after 'install 'unbundle-font-liberation | |
b3399a09 | 268 | (lambda* (#:key inputs outputs #:allow-other-keys) |
13068a8c BT |
269 | (let ((font-dest (string-append (assoc-ref outputs "out") |
270 | "/share/calibre/fonts/liberation")) | |
271 | (font-src (string-append (assoc-ref inputs "font-liberation") | |
272 | "/share/fonts/truetype"))) | |
273 | (delete-file-recursively font-dest) | |
274 | (symlink font-src font-dest)) | |
d9dec147 PG |
275 | #t)) |
276 | ;; Make run-time dependencies available to the binaries. | |
277 | (add-after 'wrap 'wrap-program | |
278 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
279 | (let ((out (assoc-ref outputs "out")) | |
280 | (qtwebengine (assoc-ref inputs "qtwebengine"))) | |
281 | (with-directory-excursion (string-append out "/bin") | |
282 | (for-each | |
283 | (lambda (binary) | |
284 | (wrap-program binary | |
285 | ;; Make QtWebEngineProcess available. | |
a30627d8 | 286 | `("QTWEBENGINEPROCESS_PATH" = |
d9dec147 PG |
287 | ,(list (string-append |
288 | qtwebengine | |
289 | "/lib/qt5/libexec/QtWebEngineProcess"))))) | |
290 | ;; Wrap all the binaries shipping with the package, except | |
291 | ;; for the wrappings created during the 'wrap standard | |
292 | ;; phase. This extends existing .calibre-real wrappers | |
293 | ;; rather than create ..calibre-real-real-s. For more | |
294 | ;; information see: https://issues.guix.gnu.org/43249. | |
295 | (find-files "." (lambda (file stat) | |
296 | (not (wrapper? file))))))) | |
b3399a09 | 297 | #t))))) |
2ea6d499 | 298 | (home-page "https://calibre-ebook.com/") |
b8ac8c28 | 299 | (synopsis "E-book library management software") |
8572adb2 TGR |
300 | (description "Calibre is an e-book library manager. It can view, convert |
301 | and catalog e-books in most of the major e-book formats. It can also talk | |
302 | to many e-book reader devices. It can go out to the Internet and fetch | |
b8ac8c28 | 303 | metadata for books. It can download newspapers and convert them into |
8572adb2 | 304 | e-books for convenient reading.") |
affaf98f BT |
305 | ;; Calibre is largely GPL3+, but includes a number of components covered |
306 | ;; by other licenses. See COPYRIGHT for more details. | |
307 | (license (list license:gpl3+ | |
308 | license:gpl2+ | |
309 | license:lgpl2.1+ | |
310 | license:lgpl2.1 | |
311 | license:bsd-3 | |
312 | license:expat | |
313 | license:zpl2.1 | |
314 | license:asl2.0 | |
315 | license:public-domain | |
316 | license:silofl1.1 | |
317 | license:cc-by-sa3.0)))) | |
84a52639 | 318 | |
4c9a4079 ZJ |
319 | (define-public ebook-tools |
320 | (package | |
321 | (name "ebook-tools") | |
322 | (version "0.2.2") | |
323 | (source | |
324 | (origin | |
325 | (method url-fetch) | |
326 | (uri (string-append "mirror://sourceforge/ebook-tools/ebook-tools/" | |
327 | version "/ebook-tools-" version ".tar.gz")) | |
328 | (sha256 | |
329 | (base32 | |
330 | "1bi7wsz3p5slb43kj7lgb3r6lb91lvb6ldi556k4y50ix6b5khyb")))) | |
331 | (arguments | |
332 | `(#:tests? #f)) ; No 'test' target | |
333 | (build-system cmake-build-system) | |
334 | (native-inputs | |
335 | `(("pkg-config" ,pkg-config))) | |
336 | (inputs | |
337 | `(("libzip" ,libzip) | |
338 | ("libxml2" ,libxml2))) | |
339 | (home-page "http://ebook-tools.sourceforge.net") | |
340 | (synopsis "Tools and library for dealing with various ebook file formats") | |
341 | (description "This package provides command-line tools and a library for | |
342 | accessing and converting various ebook file formats.") | |
343 | (license license:expat))) | |
344 | ||
84a52639 DM |
345 | (define-public liblinebreak |
346 | (package | |
347 | (name "liblinebreak") | |
348 | (version "2.1") | |
349 | (source (origin | |
350 | (method url-fetch) | |
351 | (uri (string-append "mirror://sourceforge/vimgadgets" | |
352 | "/liblinebreak/" version | |
353 | "/liblinebreak-" version ".tar.gz")) | |
354 | (sha256 | |
355 | (base32 | |
356 | "1f36dbq7nc77lln1by2n1yl050g9dc63viawhs3gc3169mavm36x")))) | |
357 | (build-system gnu-build-system) | |
358 | (home-page "http://vimgadgets.sourceforge.net/liblinebreak/") | |
359 | (synopsis "Library for detecting where linebreaks are allowed in text") | |
360 | (description "@code{liblinebreak} is an implementation of the line | |
361 | breaking algorithm as described in Unicode 6.0.0 Standard Annex 14, | |
362 | Revision 26. It breaks lines that contain Unicode characters. It is | |
363 | designed to be used in a generic text renderer.") | |
364 | (license license:zlib))) | |
d6ef422f DM |
365 | |
366 | (define-public fbreader | |
367 | (package | |
368 | (name "fbreader") | |
369 | (version "0.99.6") | |
370 | (source (origin | |
6f0ae143 EF |
371 | (method git-fetch) |
372 | (uri (git-reference | |
373 | (url "https://github.com/geometer/FBReader") | |
374 | (commit (string-append version "-freebsdport")))) | |
375 | (file-name (git-file-name name version)) | |
d6ef422f DM |
376 | (sha256 |
377 | (base32 | |
6f0ae143 | 378 | "0c0s4silpax74kwfz3dfmzn4lkv6jsyb800vfak166vii0hvbv3d")) |
152d6bf0 | 379 | (patches (search-patches "fbreader-curl-7.62.patch")))) |
d6ef422f DM |
380 | (build-system gnu-build-system) |
381 | (inputs | |
382 | `(("curl" ,curl) | |
383 | ("expat" ,expat) | |
384 | ("fribidi" ,fribidi) | |
385 | ("glib" ,glib) | |
386 | ("gtk+-2" ,gtk+-2) | |
4bd428a7 | 387 | ("libjpeg" ,libjpeg-turbo) |
d6ef422f DM |
388 | ("liblinebreak" ,liblinebreak) |
389 | ("libxft" ,libxft) | |
390 | ("sqlite" ,sqlite) | |
391 | ("zlib" ,zlib))) | |
392 | (native-inputs | |
6266a48d | 393 | `(("gcc@5" ,gcc-5) |
04842543 | 394 | ("pkg-config" ,pkg-config))) |
d6ef422f DM |
395 | (arguments |
396 | `(#:tests? #f ; No tests exist. | |
397 | #:make-flags `("CC=gcc" "TARGET_ARCH=desktop" "UI_TYPE=gtk" | |
398 | "TARGET_STATUS=release" | |
399 | ,(string-append "INSTALLDIR=" | |
400 | (assoc-ref %outputs "out")) | |
401 | ,(string-append "LDFLAGS=-Wl,-rpath=" | |
402 | (assoc-ref %outputs "out") "/lib")) | |
403 | #:phases | |
404 | (modify-phases %standard-phases | |
6266a48d MB |
405 | (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH |
406 | (lambda* (#:key inputs #:allow-other-keys) | |
407 | ;; Hide the default GCC from CPLUS_INCLUDE_PATH to prevent a header | |
408 | ;; conflict with the GCC provided in native-inputs. | |
409 | (let ((gcc (assoc-ref inputs "gcc"))) | |
410 | (setenv "CPLUS_INCLUDE_PATH" | |
411 | (string-join | |
412 | (delete (string-append gcc "/include/c++") | |
413 | (string-split (getenv "CPLUS_INCLUDE_PATH") | |
414 | #\:)) | |
415 | ":")) | |
416 | #t))) | |
5dc5c5ea EF |
417 | (delete 'configure) |
418 | (add-after 'unpack 'fix-install-locations | |
419 | (lambda* (#:key outputs #:allow-other-keys) | |
420 | (let ((out (assoc-ref outputs "out"))) | |
421 | (substitute* "fbreader/desktop/Makefile" | |
422 | (("/usr") out)) | |
423 | #t)))))) | |
d6ef422f DM |
424 | (home-page "https://fbreader.org/") |
425 | (synopsis "E-Book reader") | |
426 | (description "@code{fbreader} is an E-Book reader. It supports the | |
427 | following formats: | |
428 | ||
429 | @enumerate | |
430 | @item CHM | |
431 | @item Docbook | |
432 | @item FB2 | |
433 | @item HTML | |
434 | @item OEB | |
435 | @item PDB | |
436 | @item RTF | |
437 | @item TCR | |
438 | @item TXT | |
439 | @item XHTML | |
440 | @end enumerate") | |
441 | (license license:gpl2+))) | |
7c041187 | 442 | |
13ba3dc8 VM |
443 | (define-public cozy |
444 | (package | |
445 | (name "cozy") | |
32ab4541 | 446 | (version "0.7.8") |
13ba3dc8 VM |
447 | (source |
448 | (origin | |
449 | (method git-fetch) | |
450 | (uri (git-reference | |
451 | (url "https://github.com/geigi/cozy") | |
452 | (commit version))) | |
453 | (file-name (git-file-name name version)) | |
454 | (sha256 | |
32ab4541 | 455 | (base32 "0z2wj9g32aa5g9pw81q49iv1smb6yvlv9zs0vrzbx6mw8cj3c5d2")))) |
13ba3dc8 VM |
456 | (build-system meson-build-system) |
457 | (arguments | |
458 | `(#:glib-or-gtk? #t | |
459 | #:phases | |
460 | (modify-phases %standard-phases | |
461 | (add-after 'unpack 'patch-desktop-file | |
462 | (lambda _ | |
39aa75ba | 463 | (substitute* "data/com.github.geigi.cozy.desktop" |
6854b446 | 464 | (("Exec=com.github.geigi.cozy") "Exec=cozy")) |
13ba3dc8 VM |
465 | #t)) |
466 | (add-after 'install 'patch-executable-name | |
467 | (lambda* (#:key outputs #:allow-other-keys) | |
468 | (with-directory-excursion | |
469 | (string-append (assoc-ref outputs "out") "/bin") | |
470 | (rename-file "com.github.geigi.cozy" "cozy")) | |
471 | #t)) | |
472 | (add-after 'wrap 'wrap-libs | |
473 | (lambda* (#:key outputs #:allow-other-keys) | |
474 | (let* ((out (assoc-ref outputs "out")) | |
475 | (pylib (string-append | |
476 | out "/lib/python" | |
477 | ,(version-major+minor | |
478 | (package-version python)) | |
479 | "/site-packages")) | |
480 | (gi-typelib-path (getenv "GI_TYPELIB_PATH")) | |
481 | (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH")) | |
482 | (libmagic-path (string-append | |
483 | (assoc-ref %build-inputs "file") | |
484 | "/lib")) | |
485 | (python-path (getenv "PYTHONPATH"))) | |
486 | (wrap-program (string-append out "/bin/cozy") | |
487 | `("LD_LIBRARY_PATH" ":" prefix (,libmagic-path)) | |
488 | `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path)) | |
489 | `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path)) | |
490 | `("PYTHONPATH" ":" prefix (,python-path ,pylib)))) | |
491 | #t))))) | |
492 | (native-inputs | |
493 | `(("desktop-file-utils" ,desktop-file-utils) | |
494 | ("gettext" ,gettext-minimal) | |
495 | ("glib:bin" ,glib "bin") | |
496 | ("gobject-introspection" ,gobject-introspection) | |
497 | ("gtk+:bin" ,gtk+ "bin") | |
498 | ("pkg-config" ,pkg-config) | |
499 | ("python" ,python-wrapper))) | |
500 | (inputs | |
501 | `(("file" ,file) | |
502 | ("gsettings-desktop-schemas" ,gsettings-desktop-schemas) | |
503 | ("gst-libav" ,gst-libav) | |
504 | ("gst-plugins-bad" ,gst-plugins-bad) | |
505 | ("gst-plugins-good" ,gst-plugins-good) | |
506 | ("gst-plugins-ugly" ,gst-plugins-ugly) | |
507 | ("gtk+" ,gtk+) | |
39aa75ba | 508 | ("libhandy" ,libhandy) |
13ba3dc8 VM |
509 | ("python-distro" ,python-distro) |
510 | ("python-gst" ,python-gst) | |
511 | ("python-mutagen" ,python-mutagen) | |
902436a2 | 512 | ("python-packaging" ,python-packaging) |
13ba3dc8 VM |
513 | ("python-peewee" ,python-peewee) |
514 | ("python-pycairo" ,python-pycairo) | |
515 | ("python-pygobject" ,python-pygobject) | |
516 | ("python-pytz" ,python-pytz) | |
517 | ("python-requests" ,python-requests))) | |
518 | (home-page "https://cozy.geigi.de/") | |
519 | (synopsis "Modern audiobook player using GTK+") | |
520 | (description | |
521 | "Cozy is a modern audiobook player written in GTK+. | |
522 | ||
523 | Some of the current features: | |
524 | ||
525 | @itemize | |
526 | @item Import your audiobooks into Cozy to browse them comfortably | |
527 | @item Sort your audio books by author, reader & name | |
528 | @item Remembers your playback position | |
529 | @item Sleep timer | |
530 | @item Playback speed control | |
531 | @item Search your library | |
532 | @item Offline mode | |
533 | @item Add multiple storage locations | |
534 | @item Drag & Drop to import new audio books | |
535 | @item Support for DRM free mp3, m4a (aac, ALAC, …), flac, ogg, opus, wav files | |
536 | @item Mpris integration (Media keys & playback info for desktop environment) | |
537 | @end itemize") | |
538 | ;; TODO: Unbundle python-inject. | |
539 | (license (list license:gpl3+ ;cozy | |
540 | license:asl2.0)))) ;python-inject (bundled dependency) | |
541 | ||
7c041187 JL |
542 | (define-public xchm |
543 | (package | |
544 | (name "xchm") | |
98c3eed1 | 545 | (version "1.32") |
7c041187 JL |
546 | (source (origin |
547 | (method url-fetch) | |
548 | (uri (string-append "https://github.com/rzvncj/xCHM" | |
549 | "/releases/download/" | |
550 | version "/xchm-" version ".tar.gz")) | |
551 | (sha256 | |
552 | (base32 | |
98c3eed1 | 553 | "0b12ym7cn65wy268kbksyhakicwb053c8xfn76q2dawrvbras9dj")))) |
7c041187 JL |
554 | (build-system gnu-build-system) |
555 | (inputs | |
556 | `(("wxwidgets" ,wxwidgets) | |
557 | ("chmlib" ,chmlib))) | |
558 | (native-inputs | |
559 | `(("pkg-config" ,pkg-config))) | |
560 | (home-page "https://github.com/rzvncj/xCHM") | |
561 | (synopsis "CHM file viewer") | |
562 | (description "xCHM is a graphical CHM file viewer. It is a frontend to | |
563 | the CHM library CHMLIB.") | |
564 | (license license:gpl2+))) |