Mirror of GNU Guix
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
5.8 KiB

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