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