60ef39c77e5e9bbaeb12052f0f3c48447280e8bb
[jackhill/guix/guix.git] / gnu / packages / ebook.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016, 2017 Alex Griffin <a@ajgrf.com>
5 ;;; Copyright © 2017, 2019, 2020, 2021 Brendan Tildesley <mail@brendan.scot>
6 ;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
7 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
8 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
9 ;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
10 ;;; Copyright © 2020 Zheng Junjie <873216071@qq.com>
11 ;;; Copyright © 2021 la snesne <lasnesne@lagunposprasihopre.org>
12 ;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
13 ;;; Copyright © 2021 Mathieu Laparie <mlaparie@disr.it>
14 ;;;
15 ;;; This file is part of GNU Guix.
16 ;;;
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
21 ;;;
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
26 ;;;
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
29
30 (define-module (gnu packages ebook)
31 #:use-module ((guix licenses) #:prefix license:)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix utils)
35 #:use-module (guix gexp)
36 #:use-module (guix git-download)
37 #:use-module (guix build-system cmake)
38 #:use-module (guix build-system gnu)
39 #:use-module (guix build-system meson)
40 #:use-module (guix build-system python)
41 #:use-module (guix build-system qt)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages autotools)
44 #:use-module (gnu packages bash)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages curl)
47 #:use-module (gnu packages databases)
48 #:use-module (gnu packages file)
49 #:use-module (gnu packages fonts)
50 #:use-module (gnu packages fontutils)
51 #:use-module (gnu packages freedesktop)
52 #:use-module (gnu packages fribidi)
53 #:use-module (gnu packages gcc)
54 #:use-module (gnu packages gettext)
55 #:use-module (gnu packages gtk)
56 #:use-module (gnu packages gnome)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gstreamer)
59 #:use-module (gnu packages icu4c)
60 #:use-module (gnu packages image)
61 #:use-module (gnu packages javascript)
62 #:use-module (gnu packages language)
63 #:use-module (gnu packages libusb)
64 #:use-module (gnu packages libreoffice)
65 #:use-module (gnu packages music)
66 #:use-module (gnu packages pantheon)
67 #:use-module (gnu packages pdf)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages python-build)
71 #:use-module (gnu packages python-compression)
72 #:use-module (gnu packages python-crypto)
73 #:use-module (gnu packages python-web)
74 #:use-module (gnu packages python-xyz)
75 #:use-module (gnu packages qt)
76 #:use-module (gnu packages serialization)
77 #:use-module (gnu packages speech)
78 #:use-module (gnu packages sqlite)
79 #:use-module (gnu packages time)
80 #:use-module (gnu packages tls)
81 #:use-module (gnu packages web)
82 #:use-module (gnu packages xml)
83 #:use-module (gnu packages xorg)
84 #:use-module (gnu packages wxwidgets))
85
86 (define-public chmlib
87 (package
88 (name "chmlib")
89 (version "0.40")
90 (source (origin
91 (method url-fetch)
92 (uri (string-append "http://www.jedrea.com/chmlib/chmlib-"
93 version ".tar.bz2"))
94 (sha256
95 (base32
96 "18zzb4x3z0d7fjh1x5439bs62dmgsi4c1pg3qyr7h5gp1i5xcj9l"))
97 (patches (search-patches "chmlib-inttypes.patch"))))
98 (build-system gnu-build-system)
99 (home-page "http://www.jedrea.com/chmlib/")
100 (synopsis "Library for CHM files")
101 (description "CHMLIB is a library for dealing with ITSS/CHM format files.")
102 (license license:lgpl2.1+)))
103
104 (define-public python-pychm
105 (package
106 (name "python-pychm")
107 (version "0.8.6")
108 (source
109 (origin
110 (method url-fetch)
111 (uri (pypi-uri "pychm" version))
112 (sha256
113 (base32
114 "0wpn9ijlsmrpyiwg3drmgz4dms1i1i347adgqw37bkrh3vn6yq16"))))
115 (build-system python-build-system)
116 (inputs
117 (list chmlib))
118 (home-page "https://github.com/dottedmag/pychm")
119 (synopsis "Handle CHM files")
120 (description "This package provides a Python module for interacting
121 with Microsoft Compiled HTML (CHM) files")
122 (license license:gpl2+)))
123
124 (define-public calibre
125 (package
126 (name "calibre")
127 (version "5.36.0")
128 (source
129 (origin
130 (method url-fetch)
131 (uri (string-append "http://download.calibre-ebook.com/"
132 version "/calibre-"
133 version ".tar.xz"))
134 (sha256
135 (base32
136 "1c036qmn7lxq0899c2xzzs6whz7z0557frnfqisbvfxa13b2sadk"))
137 (modules '((guix build utils)))
138 (snippet
139 '(begin
140 ;; Unbundle python2-odfpy.
141 (delete-file-recursively "src/odf")
142 ;; Disable test that attempts to load it.
143 (substitute* "setup/test.py"
144 ((".*SRC, 'odf'.*") ""))
145 ;; Remove unneeded resources.
146 (delete-file "resources/mozilla-ca-certs.pem")
147 (delete-file "resources/calibre-portable.bat")
148 (delete-file "resources/calibre-portable.sh")))
149 (patches (search-patches "calibre-no-updates-dialog.patch"
150 "calibre-remove-test-sqlite.patch" ; TODO: fix test.
151 "calibre-remove-test-unrar.patch"))))
152 (build-system python-build-system)
153 (native-inputs
154 (list bash-minimal
155 pkg-config
156 python-flake8
157 python-pyqt-builder
158 qtbase-5 ; for qmake
159 xdg-utils))
160 (inputs
161 (list fontconfig
162 font-liberation
163 glib
164 hunspell
165 hyphen
166 icu4c
167 libmtp
168 libpng
169 libjpeg-turbo
170 libjxr
171 libstemmer
172 libusb
173 openssl
174 optipng
175 podofo
176 poppler
177 python-apsw
178 python-beautifulsoup4
179 python-cchardet
180 python-css-parser
181 python-cssselect
182 python-dateutil
183 python-dnspython-1.16
184 python-feedparser
185 python-html2text
186 python-html5-parser
187 python-html5lib
188 python-jeepney
189 python-lxml
190 python-markdown
191 python-mechanize
192 ;; python-msgpack is needed for the network content server to work.
193 python-msgpack
194 python-netifaces
195 python-odfpy
196 python-pillow
197 python-psutil
198 python-py7zr
199 python-pychm
200 python-pygments
201 python-pyqt-without-qtwebkit
202 python-pyqtwebengine
203 python-regex
204 speech-dispatcher
205 python-zeroconf
206 qtwebengine-5
207 sqlite))
208 (arguments
209 (list
210 ;; Calibre is using setuptools by itself, but the setup.py is not
211 ;; compatible with the shim wrapper (taken from pip) we are using.
212 #:use-setuptools? #f
213 #:phases
214 #~(modify-phases %standard-phases
215 (add-after 'unpack 'patch-source
216 (lambda _
217 (substitute* "src/calibre/linux.py"
218 ;; We can't use the uninstaller in Guix. Don't build it.
219 (("self\\.create_uninstaller()") ""))))
220 (add-after 'patch-source-shebangs 'patch-more-shebangs
221 (lambda* (#:key inputs native-inputs #:allow-other-keys)
222 ;; Patch various inline shebangs.
223 (substitute* '("src/calibre/gui2/preferences/tweaks.py"
224 "src/calibre/gui2/dialogs/custom_recipes.py"
225 "setup/install.py"
226 "setup/linux-installer.sh")
227 (("#!/usr/bin/env python")
228 (string-append "#!" (search-input-file inputs "/bin/python")))
229 (("#!/bin/sh")
230 (string-append "#!"
231 (search-input-file native-inputs "/bin/sh"))))))
232 (add-after 'unpack 'dont-load-remote-icons
233 (lambda _
234 (substitute* "setup/plugins_mirror.py"
235 (("href=\"//calibre-ebook.com/favicon.ico\"")
236 "href=\"favicon.ico\""))))
237 (add-before 'build 'configure
238 (lambda* (#:key inputs #:allow-other-keys)
239 (substitute* "setup/build.py"
240 (("\\[tool.sip.bindings.pictureflow\\]")
241 "[tool.sip.bindings.pictureflow]
242 tags = [\"WS_X11\"]")
243 (("\\[tool.sip.project\\]")
244 (string-append "[tool.sip.project]
245 sip-include-dirs = [\""
246 #$(this-package-input
247 "python-pyqt-without-qtwebkit")
248 "/share/sip\"]")))
249 (substitute* "src/calibre/ebooks/pdf/pdftohtml.py"
250 (("PDFTOHTML = 'pdftohtml'")
251 (string-append "PDFTOHTML = \""
252 (search-input-file inputs "/bin/pdftohtml")
253 "\"")))
254 ;; get_exe_path looks in poppler's output for these
255 ;; binaries. Make it not do that.
256 (substitute* "src/calibre/utils/img.py"
257 (("get_exe_path..jpegtran..")
258 (string-append "'"
259 (search-input-file inputs "/bin/jpegtran")
260 "'"))
261 (("get_exe_path..cjpeg..")
262 (string-append "'"
263 (search-input-file inputs "/bin/cjpeg")
264 "'"))
265 (("get_exe_path..optipng..")
266 (string-append "'"
267 (search-input-file inputs "/bin/optipng")
268 "'"))
269 (("get_exe_path..JxrDecApp..")
270 (string-append "'"
271 (search-input-file inputs "/bin/JxrDecApp")
272 "'")))
273 ;; Calibre thinks we are installing desktop files into a home
274 ;; directory, but here we butcher the script in to installing
275 ;; to calibres /share directory.
276 (setenv "XDG_DATA_HOME" (string-append #$output "/share"))
277 (substitute* "src/calibre/linux.py"
278 (("'~/.local/share'") "''"))
279 ;; 'python setup.py rapydscript' uses QtWebEngine, which
280 ;; needs to create temporary files in $HOME.
281 (setenv "HOME" "/tmp")
282 ;; XXX: QtWebEngine will fail if no fonts are available. This
283 ;; can likely be removed when fontconfig has been patched to
284 ;; include TrueType fonts by default.
285 (symlink (string-append #$(this-package-input "font-liberation")
286 "/share/fonts")
287 "/tmp/.fonts")
288 (let ((podofo #$(this-package-input "podofo")))
289 (setenv "PODOFO_INC_DIR"
290 (string-append podofo "/include/podofo"))
291 (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib")))
292 ;; This informs the tests we are a continuous integration
293 ;; environment and thus have no networking.
294 (setenv "CI" "true")
295 ;; The Qt test complains about being unable to load all image
296 ;; plugins, and I notice the available plugins list it shows
297 ;; lacks 'svg'. Adding qtsvg-5 doesn't fix it, so I'm not sure how
298 ;; to fix it. TODO: Fix test and remove this.
299 (setenv "SKIP_QT_BUILD_TEST" "true")))
300 (add-after 'install 'install-rapydscript
301 (lambda _
302 ;; Unset so QtWebengine doesn't dump temporary files here.
303 (unsetenv "XDG_DATA_HOME")
304 (invoke "python" "setup.py" "rapydscript")))
305 (add-after 'install 'install-man-pages
306 (lambda _
307 (copy-recursively "man-pages"
308 (string-append #$output "/share/man"))))
309 ;; The font TTF files are used in some miscellaneous tests, so we
310 ;; unbundle them here to avoid patching the tests.
311 (add-after 'install 'unbundle-font-liberation
312 (lambda _
313 (let ((font-dest
314 (string-append #$output "/share/calibre/fonts/liberation"))
315 (font-src
316 (string-append #$(this-package-input "font-liberation")
317 "/share/fonts/truetype")))
318 (delete-file-recursively font-dest)
319 (symlink font-src font-dest))))
320 ;; Make run-time dependencies available to the binaries.
321 (add-after 'wrap 'wrap-program
322 (lambda* (#:key inputs #:allow-other-keys)
323 (with-directory-excursion (string-append #$output "/bin")
324 (for-each
325 (lambda (binary)
326 (wrap-program binary
327 ;; Make QtWebEngineProcess available.
328 `("QTWEBENGINEPROCESS_PATH" =
329 ,(list
330 (search-input-file
331 inputs "/lib/qt5/libexec/QtWebEngineProcess")))))
332 ;; Wrap all the binaries shipping with the package, except
333 ;; for the wrappings created during the 'wrap standard
334 ;; phase. This extends existing .calibre-real wrappers
335 ;; rather than create ..calibre-real-real-s. For more
336 ;; information see: https://issues.guix.gnu.org/43249.
337 (find-files "." (lambda (file stat)
338 (not (wrapped-program? file)))))))))))
339 (home-page "https://calibre-ebook.com/")
340 (synopsis "E-book library management software")
341 (description "Calibre is an e-book library manager. It can view, convert
342 and catalog e-books in most of the major e-book formats. It can also talk
343 to many e-book reader devices. It can go out to the Internet and fetch
344 metadata for books. It can download newspapers and convert them into
345 e-books for convenient reading.")
346 ;; Calibre is largely GPL3+, but includes a number of components covered
347 ;; by other licenses. See COPYRIGHT for more details.
348 (license (list license:gpl3+
349 license:gpl2+
350 license:lgpl2.1+
351 license:lgpl2.1
352 license:bsd-3
353 license:expat
354 license:zpl2.1
355 license:asl2.0
356 license:public-domain
357 license:silofl1.1
358 license:cc-by-sa3.0))))
359
360 (define-public ebook-tools
361 (package
362 (name "ebook-tools")
363 (version "0.2.2")
364 (source
365 (origin
366 (method url-fetch)
367 (uri (string-append "mirror://sourceforge/ebook-tools/ebook-tools/"
368 version "/ebook-tools-" version ".tar.gz"))
369 (sha256
370 (base32
371 "1bi7wsz3p5slb43kj7lgb3r6lb91lvb6ldi556k4y50ix6b5khyb"))))
372 (arguments
373 `(#:tests? #f)) ; No 'test' target
374 (build-system cmake-build-system)
375 (native-inputs
376 (list pkg-config))
377 (inputs
378 (list libzip libxml2))
379 (home-page "http://ebook-tools.sourceforge.net")
380 (synopsis "Tools and library for dealing with various ebook file formats")
381 (description "This package provides command-line tools and a library for
382 accessing and converting various ebook file formats.")
383 (license license:expat)))
384
385 (define-public inkbox
386 (package
387 (name "inkbox")
388 (version "1.7")
389 (home-page "https://github.com/Kobo-InkBox/inkbox")
390 (source
391 (origin
392 (method git-fetch)
393 (uri
394 (git-reference
395 (url home-page)
396 (commit version)))
397 (file-name (git-file-name name version))
398 (sha256
399 (base32 "126cqn0ixcn608lv2hd9f7zmzj4g448bnpxc7wv9cvg83qqajh5n"))))
400 (build-system qt-build-system)
401 (arguments
402 (list
403 #:tests? #f ; no test suite
404 #:make-flags
405 #~(list (string-append "PREFIX=" #$output))
406 #:phases
407 #~(modify-phases %standard-phases
408 (add-after 'unpack 'prefix-opt
409 (lambda _
410 (substitute* "inkbox.pro"
411 (("/opt/\\$\\$\\{TARGET\\}")
412 #$output))))
413 (replace 'configure
414 (lambda* (#:key make-flags #:allow-other-keys)
415 (apply invoke (cons "qmake" make-flags)))))))
416 (native-inputs
417 (list qtbase-5))
418 (synopsis "EBook reader")
419 (description "This package provides InkBox eBook reader.")
420 (license license:gpl3)))
421
422 (define-public liblinebreak
423 (package
424 (name "liblinebreak")
425 (version "2.1")
426 (source (origin
427 (method url-fetch)
428 (uri (string-append "mirror://sourceforge/vimgadgets"
429 "/liblinebreak/" version
430 "/liblinebreak-" version ".tar.gz"))
431 (sha256
432 (base32
433 "1f36dbq7nc77lln1by2n1yl050g9dc63viawhs3gc3169mavm36x"))))
434 (build-system gnu-build-system)
435 (home-page "http://vimgadgets.sourceforge.net/liblinebreak/")
436 (synopsis "Library for detecting where linebreaks are allowed in text")
437 (description "@code{liblinebreak} is an implementation of the line
438 breaking algorithm as described in Unicode 6.0.0 Standard Annex 14,
439 Revision 26. It breaks lines that contain Unicode characters. It is
440 designed to be used in a generic text renderer.")
441 (license license:zlib)))
442
443 (define-public fbreader
444 (package
445 (name "fbreader")
446 (version "0.99.6")
447 (source (origin
448 (method git-fetch)
449 (uri (git-reference
450 (url "https://github.com/geometer/FBReader")
451 (commit (string-append version "-freebsdport"))))
452 (file-name (git-file-name name version))
453 (sha256
454 (base32
455 "0c0s4silpax74kwfz3dfmzn4lkv6jsyb800vfak166vii0hvbv3d"))
456 (patches (search-patches "fbreader-curl-7.62.patch"))))
457 (build-system gnu-build-system)
458 (inputs
459 `(("curl" ,curl)
460 ("expat" ,expat)
461 ("fribidi" ,fribidi)
462 ("glib" ,glib)
463 ("gtk+-2" ,gtk+-2)
464 ("libjpeg" ,libjpeg-turbo)
465 ("liblinebreak" ,liblinebreak)
466 ("libxft" ,libxft)
467 ("sqlite" ,sqlite)
468 ("zlib" ,zlib)))
469 (native-inputs
470 `(("gcc@5" ,gcc-5)
471 ("pkg-config" ,pkg-config)))
472 (arguments
473 `(#:tests? #f ; No tests exist.
474 #:make-flags `("CC=gcc" "TARGET_ARCH=desktop" "UI_TYPE=gtk"
475 "TARGET_STATUS=release"
476 ,(string-append "INSTALLDIR="
477 (assoc-ref %outputs "out"))
478 ,(string-append "LDFLAGS=-Wl,-rpath="
479 (assoc-ref %outputs "out") "/lib"))
480 #:phases
481 (modify-phases %standard-phases
482 (add-after 'set-paths 'augment-CPLUS_INCLUDE_PATH
483 (lambda* (#:key inputs #:allow-other-keys)
484 ;; Hide the default GCC from CPLUS_INCLUDE_PATH to prevent a header
485 ;; conflict with the GCC provided in native-inputs.
486 (let ((gcc (assoc-ref inputs "gcc")))
487 (setenv "CPLUS_INCLUDE_PATH"
488 (string-join
489 (delete (string-append gcc "/include/c++")
490 (string-split (getenv "CPLUS_INCLUDE_PATH")
491 #\:))
492 ":"))
493 #t)))
494 (delete 'configure)
495 (add-after 'unpack 'fix-install-locations
496 (lambda* (#:key outputs #:allow-other-keys)
497 (let ((out (assoc-ref outputs "out")))
498 (substitute* "fbreader/desktop/Makefile"
499 (("/usr") out))
500 #t))))))
501 (home-page "https://fbreader.org/")
502 (synopsis "E-Book reader")
503 (description "@code{fbreader} is an E-Book reader. It supports the
504 following formats:
505
506 @enumerate
507 @item CHM
508 @item Docbook
509 @item FB2
510 @item HTML
511 @item OEB
512 @item PDB
513 @item RTF
514 @item TCR
515 @item TXT
516 @item XHTML
517 @end enumerate")
518 (license license:gpl2+)))
519
520 (define-public cozy
521 (package
522 (name "cozy")
523 (version "1.2.1")
524 (source
525 (origin
526 (method git-fetch)
527 (uri (git-reference
528 (url "https://github.com/geigi/cozy")
529 (commit version)))
530 (file-name (git-file-name name version))
531 (sha256
532 (base32 "0qky885fl63d5ih5d3rggm8rhp00sk6lny26qljyz3gga8n9y6ki"))))
533 (build-system meson-build-system)
534 (arguments
535 `(#:glib-or-gtk? #t
536 #:phases
537 (modify-phases %standard-phases
538 (add-after 'unpack 'patch-desktop-file
539 (lambda _
540 (substitute* "data/com.github.geigi.cozy.desktop"
541 (("Exec=com.github.geigi.cozy") "Exec=cozy"))))
542 (add-after 'install 'patch-executable-name
543 (lambda* (#:key outputs #:allow-other-keys)
544 (with-directory-excursion
545 (string-append (assoc-ref outputs "out") "/bin")
546 (rename-file "com.github.geigi.cozy" "cozy"))))
547 (add-after 'wrap 'wrap-libs
548 (lambda* (#:key outputs #:allow-other-keys)
549 (let* ((out (assoc-ref outputs "out"))
550 (pylib (string-append
551 out "/lib/python"
552 ,(version-major+minor
553 (package-version python))
554 "/site-packages"))
555 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
556 (gst-plugin-path (getenv "GST_PLUGIN_SYSTEM_PATH"))
557 (libmagic-path (string-append
558 (assoc-ref %build-inputs "file")
559 "/lib"))
560 (python-path (getenv "GUIX_PYTHONPATH")))
561 (wrap-program (string-append out "/bin/cozy")
562 `("LD_LIBRARY_PATH" ":" prefix (,libmagic-path))
563 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
564 `("GST_PLUGIN_SYSTEM_PATH" ":" prefix (,gst-plugin-path))
565 `("GUIX_PYTHONPATH" ":" prefix (,python-path ,pylib)))))))))
566 (native-inputs
567 (list desktop-file-utils
568 gettext-minimal
569 `(,glib "bin")
570 gobject-introspection
571 `(,gtk+ "bin")
572 pkg-config
573 python-wrapper))
574 (inputs
575 (list bash-minimal
576 file
577 granite
578 gsettings-desktop-schemas
579 gst-libav
580 gst-plugins-bad
581 gst-plugins-good
582 gst-plugins-ugly
583 gtk+
584 libdazzle
585 libgee
586 libhandy
587 python-distro
588 python-gst
589 python-mutagen
590 python-packaging
591 python-peewee
592 python-pycairo
593 python-pygobject
594 python-pytz
595 python-requests))
596 (home-page "https://cozy.geigi.de/")
597 (synopsis "Modern audiobook player using GTK+")
598 (description
599 "Cozy is a modern audiobook player written in GTK+.
600
601 Some of the current features:
602
603 @itemize
604 @item Import your audiobooks into Cozy to browse them comfortably
605 @item Sort your audio books by author, reader & name
606 @item Remembers your playback position
607 @item Sleep timer
608 @item Playback speed control
609 @item Search your library
610 @item Offline mode
611 @item Add multiple storage locations
612 @item Drag & Drop to import new audio books
613 @item Support for DRM free mp3, m4a (aac, ALAC, …), flac, ogg, opus, wav files
614 @item Mpris integration (Media keys & playback info for desktop environment)
615 @end itemize")
616 ;; TODO: Unbundle python-inject.
617 (license (list license:gpl3+ ;cozy
618 license:asl2.0)))) ;python-inject (bundled dependency)
619
620 (define-public xchm
621 (package
622 (name "xchm")
623 (version "1.33")
624 (source (origin
625 (method url-fetch)
626 (uri (string-append "https://github.com/rzvncj/xCHM"
627 "/releases/download/"
628 version "/xchm-" version ".tar.gz"))
629 (sha256
630 (base32
631 "0an09shap2wj9gzj5fsw5sc2i6paq3kc3mc52fnwg2bb2dan5qxk"))))
632 (build-system gnu-build-system)
633 (inputs
634 (list wxwidgets chmlib))
635 (native-inputs
636 (list pkg-config))
637 (home-page "https://github.com/rzvncj/xCHM")
638 (synopsis "CHM file viewer")
639 (description "xCHM is a graphical CHM file viewer. It is a frontend to
640 the CHM library CHMLIB.")
641 (license license:gpl2+)))
642
643 (define-public libmobi
644 (package
645 (name "libmobi")
646 (version "0.6")
647 (source (origin
648 (method git-fetch)
649 (uri (git-reference
650 (url "https://github.com/bfabiszewski/libmobi/")
651 (commit (string-append "v" version))))
652 (file-name (git-file-name name version))
653 (sha256
654 (base32
655 "0yps72cm609xn2k7alflkdhp9kgr1w7zzyxjygz0n1kqrdcplihh"))))
656 (build-system gnu-build-system)
657 (native-inputs
658 (list autoconf automake libtool))
659 (inputs
660 (list zlib libxml2))
661 (home-page "https://github.com/bfabiszewski/libmobi/")
662 (synopsis "C library for handling MOBI formats")
663 (description "Libmobi is a C library for handling MOBI ebook
664 format documents, with the following features:
665
666 @itemize
667 @item reading and parsing:
668 @itemize
669 @item some older text Palmdoc formats (pdb),
670 @item Mobipocket files (prc, mobi),
671 @item newer MOBI files including KF8 format (azw, azw3),
672 @item Replica Print files (azw4)
673 @end itemize
674 @item recreating source files using indices
675 @item reconstructing references (links and embedded) in html files
676 @item reconstructing source structure that can be fed back to kindlegen
677 @item reconstructing dictionary markup (orth, infl tags)
678 @item writing back loaded documents
679 @item metadata editing
680 @item handling encrypted documents
681 @end itemize\n")
682 (license license:lgpl3+)))
683
684 (define-public python-ebooklib
685 (package
686 (name "python-ebooklib")
687 (version "0.17.1")
688 (source (origin
689 (method url-fetch)
690 (uri (pypi-uri "EbookLib" version))
691 (sha256
692 (base32
693 "1w972g0kmh9cdxf3kjr7v4k99wvv4lxv3rxkip39c08550nf48zy"))))
694 (build-system python-build-system)
695 (propagated-inputs (list python-lxml python-six))
696 (home-page "https://github.com/aerkalov/ebooklib")
697 (synopsis "Ebook library which can handle EPUB2/EPUB3 and Kindle format")
698 (description
699 "Ebook library which can handle EPUB2/EPUB3 and Kindle format.")
700 (license license:agpl3+)))
701
702 (define-public shirah
703 (package
704 (name "shirah")
705 (version "1.0.0")
706 (source (origin
707 (method url-fetch)
708 (uri (pypi-uri "shirah_reader" version))
709 (sha256
710 (base32
711 "0j15v435lz68c1mj5clfx5dmfyjc6jvvz2q8hqvv799mb2faj42y"))))
712 (build-system python-build-system)
713 (propagated-inputs (list python-beautifulsoup4 python-ebooklib
714 python-syllables python-termcolor))
715 (home-page "https://github.com/hallicopter/shirah-reader")
716 (synopsis "Terminal ebook reader with an optional RSVP mode")
717 (description
718 "@command{shirah} is a curses based terminal ebook reader that can
719 display ebooks in the usual way or with Rapid Serial Visual Presentation, a
720 method to enable speedreading by showing the text word by word at configurable
721 speeds.")
722 (license license:gpl2+)))