www/py-readability-lxml: Add new port

Fast HTML to text parser (article readability tool).

PR:			273553
Approved by:		zirias (mentor)
Differential Revision:	https://reviews.freebsd.org/D41813
This commit is contained in:
Martin Neubauer 2023-09-11 13:49:00 +02:00 committed by Joel Bodenmann
parent 48398ec51f
commit 4b0d2e1118
5 changed files with 45 additions and 0 deletions

View file

@ -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

View file

@ -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 <bsd.port.mk>

View file

@ -0,0 +1,3 @@
TIMESTAMP = 1691368002
SHA256 (readability-lxml-0.8.1.tar.gz) = e51fea56b5909aaf886d307d48e79e096293255afa567b7d08bca94d25b1a4e1
SIZE (readability-lxml-0.8.1.tar.gz) = 15878

View file

@ -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
+ """

View file

@ -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.