aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorBrendan Tildesley <brendan.tildesley@openmailbox.org>2017-05-13 22:32:01 +1000
committerMarius Bakke <mbakke@fastmail.com>2017-05-19 23:49:20 +0200
commitd94a99ec665d9c58a534953d877305ad82b10e71 (patch)
tree4decde2192ca35ac6ece22a020f057a65b1d7024 /gnu
parent7010d231dbef94b09c310a8ad44889bcabb2161a (diff)
downloadgnu-guix-d94a99ec665d9c58a534953d877305ad82b10e71.tar
gnu-guix-d94a99ec665d9c58a534953d877305ad82b10e71.tar.gz
gnu: calibre: Import unbundle feedparser patch from debian.
* gnu/packages/ebook.scm (calibre)[source]: Reference new patch file. [inputs]: Add python2-feedparser as an input. * gnu/packages/patches/calibre-use-packaged-feedparser.patch: New file. * gnu/local.mk (dist_patch_DATA): Add it. Signed-off-by: Marius Bakke <mbakke@fastmail.com>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/ebook.scm3
-rw-r--r--gnu/packages/patches/calibre-use-packaged-feedparser.patch51
3 files changed, 55 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 8cfb89ff1b..04d259df9c 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -522,6 +522,7 @@ dist_patch_DATA = \
%D%/packages/patches/calibre-drop-unrar.patch \
%D%/packages/patches/calibre-dont-load-remote-icons.patch \
%D%/packages/patches/calibre-no-updates-dialog.patch \
+ %D%/packages/patches/calibre-use-packaged-feedparser.patch \
%D%/packages/patches/cdparanoia-fpic.patch \
%D%/packages/patches/cdrtools-3.01-mkisofs-isoinfo.patch \
%D%/packages/patches/ceph-disable-cpu-optimizations.patch \
diff --git a/gnu/packages/ebook.scm b/gnu/packages/ebook.scm
index cc43259e26..70ec9ed352 100644
--- a/gnu/packages/ebook.scm
+++ b/gnu/packages/ebook.scm
@@ -39,6 +39,7 @@
#:use-module (gnu packages python)
#:use-module (gnu packages qt)
#:use-module (gnu packages tls)
+ #:use-module (gnu packages web)
#:use-module (gnu packages xorg))
(define-public chmlib
@@ -80,6 +81,7 @@
(delete-file-recursively "src/unrar")
(delete-file "src/odf/thumbnail.py")))
(patches (search-patches "calibre-drop-unrar.patch"
+ "calibre-use-packaged-feedparser.patch"
"calibre-dont-load-remote-icons.patch"
"calibre-no-updates-dialog.patch"))))
(build-system python-build-system)
@@ -116,6 +118,7 @@
("python2-cssutils" ,python2-cssutils)
("python2-dateutil" ,python2-dateutil)
("python2-dbus" ,python2-dbus)
+ ("python2-feedparser" ,python2-feedparser)
("python2-lxml" ,python2-lxml)
("python2-mechanize" ,python2-mechanize)
("python2-netifaces" ,python2-netifaces)
diff --git a/gnu/packages/patches/calibre-use-packaged-feedparser.patch b/gnu/packages/patches/calibre-use-packaged-feedparser.patch
new file mode 100644
index 0000000000..8f4bbc8248
--- /dev/null
+++ b/gnu/packages/patches/calibre-use-packaged-feedparser.patch
@@ -0,0 +1,51 @@
+From: Martin Pitt <mpitt@debian.org>
+Date: Mon, 14 Nov 2016 22:41:23 +0100
+Subject: Use packaged instead of bundled feedparser Python module
+
+---
+ recipes/lenta_ru.recipe | 4 +++-
+ src/calibre/web/feeds/__init__.py | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/recipes/lenta_ru.recipe b/recipes/lenta_ru.recipe
+index aa4dac4..4b6710c 100644
+--- a/recipes/lenta_ru.recipe
++++ b/recipes/lenta_ru.recipe
+@@ -4,11 +4,13 @@
+ Lenta.ru
+ '''
+
+-from calibre.web.feeds.feedparser import parse
+ from calibre.ebooks.BeautifulSoup import Tag
+ from calibre.web.feeds.news import BasicNewsRecipe
++from feedparser import parse
++from functools import partial
+ import re
+
++parse = partial(parse, agent='Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11')
+
+ class LentaRURecipe(BasicNewsRecipe):
+ title = u'Lenta.ru: \u041d\u043e\u0432\u043e\u0441\u0442\u0438'
+diff --git a/src/calibre/web/feeds/__init__.py b/src/calibre/web/feeds/__init__.py
+index 8c9d748..f262604 100644
+--- a/src/calibre/web/feeds/__init__.py
++++ b/src/calibre/web/feeds/__init__.py
+@@ -11,7 +11,10 @@ from calibre.utils.logging import default_log
+ from calibre import entity_to_unicode, strftime, force_unicode
+ from calibre.utils.date import dt_factory, utcnow, local_tz
+ from calibre.utils.cleantext import clean_ascii_chars, clean_xml_chars
++from feedparser import parse
++from functools import partial
+
++parse = partial(parse, agent='Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.11) Gecko/20101012 Firefox/3.6.11')
+
+ class Article(object):
+
+@@ -334,7 +337,6 @@ def feed_from_xml(raw_xml, title=None, oldest_article=7,
+ max_articles_per_feed=100,
+ get_article_url=lambda item: item.get('link', None),
+ log=default_log):
+- from calibre.web.feeds.feedparser import parse
+ # Handle unclosed escaped entities. They trip up feedparser and HBR for one
+ # generates them
+ raw_xml = re.sub(r'(&amp;#\d+)([^0-9;])', r'\1;\2', raw_xml)