html5_parser: update to 0.4.10, drop support for Python 2.7/3.7, add it for 3.10. (#8173)

This commit is contained in:
OscarL
2023-03-30 01:50:12 -03:00
committed by GitHub
parent bcbeb14698
commit c0da47f3e8

View File

@@ -13,9 +13,9 @@ COPYRIGHT="2017 Kovid Goyal
2015-2016 Kevin B. Hendricks, Stratford Ontario
2008-2009 Bjoern Hoehrmann"
LICENSE="Apache v2"
REVISION="3"
REVISION="1"
SOURCE_URI="https://files.pythonhosted.org/packages/source/h/html5-parser/html5-parser-$portVersion.tar.gz"
CHECKSUM_SHA256="25fe8f6848cbc15187f6748c0695df32bcf1b37df6420b6a01b4ebe1ec1ed48f"
CHECKSUM_SHA256="f9294418c0da95c2d5facc19d3dc32941093a6b8e3b3e4b36cc7b5a1697fbca4"
SOURCE_DIR="html5-parser-$portVersion"
ARCHITECTURES="all !x86_gcc2"
@@ -37,52 +37,33 @@ BUILD_PREREQUIRES="
cmd:pkg_config$secondaryArchSuffix
"
PYTHON_PACKAGES=()
PYTHON_VERSIONS=()
PYTHON_LIBSUFFIXES=()
# We don't have python2 for secondaryArch
if [ -z "$secondaryArchSuffix" ]; then
PYTHON_PACKAGES+=(python)
PYTHON_VERSIONS+=(2.7)
PYTHON_LIBSUFFIXES+=("")
BUILD_REQUIRES+="
setuptools_python
"
BUILD_PREREQUIRES+="
cmd:python2
"
fi
# gcc2 does not support the flags passed by python3
if [ "$effectiveTargetArchitecture" != x86_gcc2 ]; then
PYTHON_PACKAGES+=(python3 python38 python39)
PYTHON_VERSIONS+=(3.7 3.8 3.9)
PYTHON_LIBSUFFIXES+=(m '' '')
BUILD_REQUIRES+="
setuptools_python3
setuptools_python38
setuptools_python39
"
BUILD_PREREQUIRES+="
cmd:python3
cmd:python3.8
cmd:python3.9
"
fi
PYTHON_PACKAGES=(python38 python39 python310)
PYTHON_VERSIONS=(3.8 3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonLibSuffix=${PYTHON_LIBSUFFIXES[$i]}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
\""
if [ "$targetArchitecture" = "x86_gcc2" ]; then
eval "PROVIDES_$pythonPackage+=\"
html5_parser_$pythonPackage = $portVersion
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku$secondaryArchSuffix
chardet_$pythonPackage
lxml${secondaryArchSuffix}_$pythonPackage
lib:libpython$pythonVersion$pythonLibSuffix$secondaryArchSuffix
lib:libpython$pythonVersion$secondaryArchSuffix
\""
BUILD_REQUIRES+="
setuptools_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
TEST_REQUIRES+="
${portName}_$pythonPackage
beautifulsoup_$pythonPackage
@@ -90,17 +71,7 @@ for i in "${!PYTHON_PACKAGES[@]}"; do
lxml${secondaryArchSuffix}_$pythonPackage
"
done
if [ "$targetArchitecture" = x86_gcc2 -a -n "$secondaryArchSuffix" ]; then
PROVIDES_python3+="
html5_parser_python3 = $portVersion
"
PROVIDES_python38+="
html5_parser_python38 = $portVersion
"
PROVIDES_python39+="
html5_parser_python39 = $portVersion
"
fi
BUILD()
{
@@ -117,6 +88,7 @@ BUILD()
done
}
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
@@ -128,7 +100,9 @@ INSTALL()
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages
export PYTHONPATH=$installLocation
mkdir -p "$installLocation"
$python setup.py install \
--root=/ --prefix="$prefix"
@@ -141,6 +115,7 @@ INSTALL()
install -m 644 -t "$docDir" README.rst
}
TEST()
{
for i in "${!PYTHON_PACKAGES[@]}"; do