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