Index: www/Makefile =================================================================== --- www/Makefile +++ www/Makefile @@ -1787,6 +1787,7 @@ SUBDIR += py-qt5-webengine SUBDIR += py-qt6-webengine SUBDIR += py-quilt3 + SUBDIR += py-readability-lxml SUBDIR += py-recaptcha SUBDIR += py-requests SUBDIR += py-requests-aws4auth Index: www/py-readability-lxml/Makefile =================================================================== --- /dev/null +++ www/py-readability-lxml/Makefile @@ -0,0 +1,28 @@ +PORTNAME= readability-lxml +PORTVERSION= 0.8.1 +CATEGORIES= www python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= m.ne@gmx.net +COMMENT= Fast HTML to text parser (article readability tool) +WWW= https://github.com/buriy/python-readability + +LICENSE= APACHE20 + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cssselect>0:www/py-cssselect@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}lxml>0:devel/py-lxml@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}timeout-decorator>0:devel/py-timeout-decorator@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist distutils + +NO_ARCH= yes + +OPTIONS_DEFINE= CCHARDET + +CCHARDET_DESC= Use cchardet instead of chardet +CCHARDET_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}cchardet>0:textproc/py-cchardet@${PY_FLAVOR} +CCHARDET_RUN_DEPENDS_OFF= ${PYTHON_PKGNAMEPREFIX}chardet>0:textproc/py-chardet@${PY_FLAVOR} + +.include Index: www/py-readability-lxml/distinfo =================================================================== --- /dev/null +++ www/py-readability-lxml/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1691368002 +SHA256 (readability-lxml-0.8.1.tar.gz) = e51fea56b5909aaf886d307d48e79e096293255afa567b7d08bca94d25b1a4e1 +SIZE (readability-lxml-0.8.1.tar.gz) = 15878 Index: www/py-readability-lxml/files/patch-readability_compat_two.py =================================================================== --- /dev/null +++ www/py-readability-lxml/files/patch-readability_compat_two.py @@ -0,0 +1,11 @@ +Disable some python-2.x code with invalid syntax in python-3.x. + +--- readability/compat/two.py.orig 2020-07-03 23:38:42 UTC ++++ readability/compat/two.py +@@ -2,5 +2,5 @@ def raise_with_traceback(exc_type, traceback, *args, * + """ + Raise a new exception of type `exc_type` with an existing `traceback`. All + additional (keyword-)arguments are forwarded to `exc_type` +- """ + raise exc_type(*args, **kwargs), None, traceback ++ """ Index: www/py-readability-lxml/pkg-descr =================================================================== --- /dev/null +++ www/py-readability-lxml/pkg-descr @@ -0,0 +1,2 @@ +Fast HTML to text parser (article readability tool). +Given an HTML document, it pulls out the main body text and cleans it up.