1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
3 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
6 ;;; This file is part of GNU Guix.
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21 (define-module (gnu packages ebook)
22 #:use-module ((guix licenses) #:select (gpl3 lgpl2.1+))
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages)
27 #:use-module (guix build-system python)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages databases)
30 #:use-module (gnu packages fontutils)
31 #:use-module (gnu packages freedesktop)
32 #:use-module (gnu packages glib)
33 #:use-module (gnu packages icu4c)
34 #:use-module (gnu packages image)
35 #:use-module (gnu packages libusb)
36 #:use-module (gnu packages pdf)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages python)
39 #:use-module (gnu packages qt)
40 #:use-module (gnu packages tls)
41 #:use-module (gnu packages xorg))
49 (uri (string-append "http://www.jedrea.com/chmlib/chmlib-"
53 "18zzb4x3z0d7fjh1x5439bs62dmgsi4c1pg3qyr7h5gp1i5xcj9l"))
54 (patches (search-patches "chmlib-inttypes.patch"))))
55 (build-system gnu-build-system)
56 (home-page "http://www.jedrea.com/chmlib/")
57 (synopsis "Library for CHM files")
58 (description "CHMLIB is a library for dealing with ITSS/CHM format files.")
61 (define-public calibre
68 (uri (string-append "http://download.calibre-ebook.com/"
73 "1rwgv6rsmy3ljfwcpv42w203ghngw86s5kzb0yjm1zgsxmas2wh6"))
74 ;; Remove non-free or doubtful code, see
75 ;; https://lists.gnu.org/archive/html/guix-devel/2015-02/msg00478.html
76 (modules '((guix build utils)))
79 (delete-file-recursively "src/unrar")
80 (delete-file "src/odf/thumbnail.py")))
81 (patches (search-patches "calibre-drop-unrar.patch"
82 "calibre-no-updates-dialog.patch"))))
83 (build-system python-build-system)
85 `(("pkg-config" ,pkg-config)
86 ("qt" ,qt) ; for qmake
87 ;; xdg-utils is supposed to be used for desktop integration, but it
88 ;; also creates lots of messages
89 ;; mkdir: cannot create directory '/homeless-shelter': Permission denied
90 ("xdg-utils" ,xdg-utils)))
91 ;; FIXME: The following are missing inputs according to the documentation,
92 ;; but the package can apparently be used without them,
93 ;; They may need to be added if a deficiency is detected.
94 ;; BeautifulSoup >= 3.0.5
99 ;; python-pygments >= 2.0.1 ; used for ebook editing
102 ("fontconfig" ,fontconfig)
108 ("libxrender" ,libxrender)
112 ("python2-apsw" ,python2-apsw)
113 ("python2-cssselect" ,python2-cssselect)
114 ("python2-cssutils" ,python2-cssutils)
115 ("python2-dateutil" ,python2-dateutil)
116 ("python2-dbus" ,python2-dbus)
117 ("python2-lxml" ,python2-lxml)
118 ("python2-mechanize" ,python2-mechanize)
119 ("python2-netifaces" ,python2-netifaces)
120 ("python2-pillow" ,python2-pillow)
121 ("python2-pyqt" ,python2-pyqt-5.5)
122 ("python2-sip" ,python2-sip)
127 #:test-target "check"
128 #:tests? #f ; FIXME: enable once flake8 is packaged
130 (modify-phases %standard-phases
131 (add-before 'build 'configure
132 (lambda* (#:key inputs #:allow-other-keys)
133 (let ((podofo (assoc-ref inputs "podofo"))
134 (pyqt (assoc-ref inputs "python2-pyqt")))
135 (substitute* "setup/build_environment.py"
136 (("sys.prefix") (string-append "'" pyqt "'")))
137 (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo"))
138 (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib"))))))))
139 (home-page "http://calibre-ebook.com/")
140 (synopsis "E-book library management software")
141 (description "Calibre is an ebook library manager. It can view, convert
142 and catalog ebooks in most of the major ebook formats. It can also talk
143 to many ebook reader devices. It can go out to the Internet and fetch
144 metadata for books. It can download newspapers and convert them into
145 ebooks for convenient reading.")
146 (license gpl3))) ; some files are under various other licenses, see COPYRIGHT