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>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages ebook)
21 #:use-module ((guix licenses) #:select (gpl3 lgpl2.1+))
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (guix build-system python)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages databases)
29 #:use-module (gnu packages fontutils)
30 #:use-module (gnu packages freedesktop)
31 #:use-module (gnu packages glib)
32 #:use-module (gnu packages icu4c)
33 #:use-module (gnu packages image)
34 #:use-module (gnu packages imagemagick)
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 "15qskfsdg3fy9cpw1m3mccwgn45366yn7lci5kim0fdzpw9pnkna"))
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 ("qtbase" ,qtbase) ; 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)
105 ("imagemagick" ,imagemagick)
109 ("libxrender" ,libxrender)
113 ("python2-apsw" ,python2-apsw)
114 ("python2-cssselect" ,python2-cssselect)
115 ("python2-cssutils" ,python2-cssutils)
116 ("python2-dateutil" ,python2-dateutil)
117 ("python2-dbus" ,python2-dbus)
118 ("python2-lxml" ,python2-lxml)
119 ("python2-mechanize" ,python2-mechanize)
120 ("python2-netifaces" ,python2-netifaces)
121 ("python2-pillow" ,python2-pillow)
122 ("python2-pyqt" ,python2-pyqt)
123 ("python2-sip" ,python2-sip)
128 #:test-target "check"
129 #:tests? #f ; FIXME: enable once flake8 is packaged
133 (lambda* (#:key inputs #:allow-other-keys)
134 (let ((podofo (assoc-ref inputs "podofo"))
135 (pyqt (assoc-ref inputs "python2-pyqt")))
136 (substitute* "setup/build_environment.py"
137 (("sys.prefix") (string-append "'" pyqt "'")))
138 (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo"))
139 (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib"))))
141 (home-page "http://calibre-ebook.com/")
142 (synopsis "E-book library management software")
143 (description "Calibre is an ebook library manager. It can view, convert
144 and catalog ebooks in most of the major ebook formats. It can also talk
145 to many ebook reader devices. It can go out to the Internet and fetch
146 metadata for books. It can download newspapers and convert them into
147 ebooks for convenient reading.")
148 (license gpl3))) ; some files are under various other licenses, see COPYRIGHT