gnu: python-pyqt: Build with more qt modules.
[jackhill/guix/guix.git] / gnu / packages / ebook.scm
CommitLineData
947ae545 1;;; GNU Guix --- Functional package management for GNU
7d1f8d4f 2;;; Copyright © 2015, 2016 Andreas Enge <andreas@enge.fr>
9acd40fe 3;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
b111bdb6 4;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
947ae545
AE
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)
b8ac8c28 22 #:use-module ((guix licenses) #:select (gpl3 lgpl2.1+))
947ae545
AE
23 #:use-module (guix packages)
24 #:use-module (guix download)
a34816ef 25 #:use-module (guix build-system gnu)
b8ac8c28
AE
26 #:use-module (gnu packages)
27 #:use-module (guix build-system python)
28 #:use-module (gnu packages)
29 #:use-module (gnu packages databases)
b8ac8c28
AE
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)
b8ac8c28
AE
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)
cc2b77df 40 #:use-module (gnu packages tls)
b8ac8c28 41 #:use-module (gnu packages xorg))
947ae545
AE
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
a34816ef 53 "18zzb4x3z0d7fjh1x5439bs62dmgsi4c1pg3qyr7h5gp1i5xcj9l"))
fc1adab1 54 (patches (search-patches "chmlib-inttypes.patch"))))
947ae545
AE
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.")
71e1de33 59 (license lgpl2.1+)))
b8ac8c28
AE
60
61(define-public calibre
62 (package
63 (name "calibre")
b111bdb6 64 (version "2.63.0")
b8ac8c28
AE
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
9acd40fe 72 (base32
b111bdb6 73 "1rwgv6rsmy3ljfwcpv42w203ghngw86s5kzb0yjm1zgsxmas2wh6"))
b8ac8c28
AE
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")))
fc1adab1
AK
81 (patches (search-patches "calibre-drop-unrar.patch"
82 "calibre-no-updates-dialog.patch"))))
b8ac8c28
AE
83 (build-system python-build-system)
84 (native-inputs
85 `(("pkg-config" ,pkg-config)
0e5f6061 86 ("qt" ,qt) ; for qmake
b8ac8c28
AE
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)
b8ac8c28
AE
105 ("libmtp" ,libmtp)
106 ("libpng" ,libpng)
107 ("libusb" ,libusb)
108 ("libxrender" ,libxrender)
df00e148 109 ("openssl" ,openssl)
b8ac8c28
AE
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)
2fbec762 120 ("python2-pillow" ,python2-pillow)
0e5f6061 121 ("python2-pyqt" ,python2-pyqt-5.5)
b8ac8c28 122 ("python2-sip" ,python2-sip)
0e5f6061 123 ("qt" ,qt)
b8ac8c28
AE
124 ("sqlite" ,sqlite)))
125 (arguments
126 `(#:python ,python-2
127 #:test-target "check"
128 #:tests? #f ; FIXME: enable once flake8 is packaged
e89aceab
HG
129 ;; Calibre is using setuptools by itself, but the setup.py is not
130 ;; compatible with the shim wrapper (taken from pip) we are using.
131 #:use-setuptools? #f
b8ac8c28 132 #:phases
b111bdb6
AG
133 (modify-phases %standard-phases
134 (add-before 'build 'configure
b8ac8c28
AE
135 (lambda* (#:key inputs #:allow-other-keys)
136 (let ((podofo (assoc-ref inputs "podofo"))
137 (pyqt (assoc-ref inputs "python2-pyqt")))
138 (substitute* "setup/build_environment.py"
139 (("sys.prefix") (string-append "'" pyqt "'")))
140 (setenv "PODOFO_INC_DIR" (string-append podofo "/include/podofo"))
b111bdb6 141 (setenv "PODOFO_LIB_DIR" (string-append podofo "/lib"))))))))
b8ac8c28
AE
142 (home-page "http://calibre-ebook.com/")
143 (synopsis "E-book library management software")
144 (description "Calibre is an ebook library manager. It can view, convert
145and catalog ebooks in most of the major ebook formats. It can also talk
146to many ebook reader devices. It can go out to the Internet and fetch
147metadata for books. It can download newspapers and convert them into
148ebooks for convenient reading.")
149 (license gpl3))) ; some files are under various other licenses, see COPYRIGHT