ebook.scm 26 KB

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