gnu: calibre: Update qt dependancies.
[jackhill/guix/guix.git] / gnu / packages / ebook.scm
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>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
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.
12 ;;;
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.
17 ;;;
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/>.
20
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))
42
43 (define-public chmlib
44 (package
45 (name "chmlib")
46 (version "0.40")
47 (source (origin
48 (method url-fetch)
49 (uri (string-append "http://www.jedrea.com/chmlib/chmlib-"
50 version ".tar.bz2"))
51 (sha256
52 (base32
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.")
59 (license lgpl2.1+)))
60
61 (define-public calibre
62 (package
63 (name "calibre")
64 (version "2.63.0")
65 (source
66 (origin
67 (method url-fetch)
68 (uri (string-append "http://download.calibre-ebook.com/"
69 version "/calibre-"
70 version ".tar.xz"))
71 (sha256
72 (base32
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)))
77 (snippet
78 '(begin
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)
84 (native-inputs
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
95 ;; dnspython >= 1.6.0
96 ;; poppler >= 0.20.2
97 ;; libwmf >= 0.2.8
98 ;; psutil >= 0.6.1
99 ;; python-pygments >= 2.0.1 ; used for ebook editing
100 (inputs
101 `(("chmlib" ,chmlib)
102 ("fontconfig" ,fontconfig)
103 ("glib" ,glib)
104 ("icu4c" ,icu4c)
105 ("libmtp" ,libmtp)
106 ("libpng" ,libpng)
107 ("libusb" ,libusb)
108 ("libxrender" ,libxrender)
109 ("openssl" ,openssl)
110 ("podofo" ,podofo)
111 ("python" ,python-2)
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)
122 ("python2-sip" ,python2-sip)
123 ("sqlite" ,sqlite)))
124 (arguments
125 `(#:python ,python-2
126 #:test-target "check"
127 #:tests? #f ; FIXME: enable once flake8 is packaged
128 ;; Calibre is using setuptools by itself, but the setup.py is not
129 ;; compatible with the shim wrapper (taken from pip) we are using.
130 #:use-setuptools? #f
131 #:phases
132 (modify-phases %standard-phases
133 (add-before 'build 'configure
134 (lambda* (#:key inputs #:allow-other-keys)
135 (let ((podofo (assoc-ref inputs "podofo"))
136 (pyqt (assoc-ref inputs "python2-pyqt")))
137 (substitute* "setup/build_environment.py"
138 (("sys.prefix") (string-append "'" pyqt "'")))
139 (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo"))
140 (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