mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-10 22:00:09 +02:00
*_python*: clean up around commands suffixes. Drop Python3.9 support. (#12591)
Plus general recipe clean ups, while we're at it. ---- Tested locally only for mutagen. Will fix if something breaks. `requests_python39` will pop up in in the reports due to missing `chardet_python39`. Nothing requires `requests_python39` on tree, so will remove that at some point.
This commit is contained in:
@@ -8,7 +8,7 @@ HOMEPAGE="https://github.com/html2text/html2text.py
|
||||
https://pypi.python.org/pypi/html2text"
|
||||
COPYRIGHT="2004-2008 Aaron Swartz"
|
||||
LICENSE="GNU GPL v3"
|
||||
REVISION="4"
|
||||
REVISION="5"
|
||||
SOURCE_URI="https://github.com/Alir3z4/html2text/archive/$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="209a2c4d7897e83a6999160ef51ae71bdb8c3eede99e103f12edb25199d4d11e"
|
||||
|
||||
@@ -25,34 +25,41 @@ BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python39 python310)
|
||||
PYTHON_VERSIONS=(3.9 3.10)
|
||||
commandSuffixes=(3.8 "" 3.10)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
commandSuffix=${commandSuffixes[$i]}
|
||||
eval "PROVIDES_${pythonPackage}=\"\
|
||||
${portName}_$pythonPackage = $portVersion\n\
|
||||
cmd:html2text$commandSuffix = $portVersion\n\
|
||||
\"; \
|
||||
REQUIRES_$pythonPackage=\"\
|
||||
haiku\n\
|
||||
cmd:python$pythonVersion\
|
||||
\""
|
||||
BUILD_REQUIRES="$BUILD_REQUIRES
|
||||
setuptools_$pythonPackage"
|
||||
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
||||
cmd:python$pythonVersion"
|
||||
PYTHON_VERSIONS=(3.10)
|
||||
defaultVersion=3.10
|
||||
|
||||
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
||||
pythonPackage=python${pythonVersion//.}
|
||||
|
||||
eval "PROVIDES_${pythonPackage}=\"
|
||||
${portName}_$pythonPackage = $portVersion
|
||||
cmd:html2text_$pythonVersion = $portVersion
|
||||
\""
|
||||
# Provide non-suffixed cmd only for the default Python version
|
||||
if [ $pythonVersion = $defaultVersion ]; then
|
||||
eval "PROVIDES_$pythonPackage+=\"
|
||||
cmd:html2text = $portVersion
|
||||
\""
|
||||
fi
|
||||
|
||||
eval "REQUIRES_$pythonPackage=\"
|
||||
haiku
|
||||
cmd:python$pythonVersion
|
||||
\""
|
||||
|
||||
BUILD_REQUIRES+="
|
||||
setuptools_$pythonPackage
|
||||
"
|
||||
BUILD_PREREQUIRES+="
|
||||
cmd:python$pythonVersion
|
||||
"
|
||||
done
|
||||
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
commandSuffix=${commandSuffixes[$i]}
|
||||
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
||||
pythonPackage=python${pythonVersion//.}
|
||||
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages/
|
||||
@@ -64,13 +71,19 @@ INSTALL()
|
||||
$python setup.py build install \
|
||||
--root=/ --prefix=$prefix
|
||||
|
||||
if [ "$pythonVersion" = "$commandSuffix" ]; then
|
||||
# Version suffix all the scripts
|
||||
for f in $binDir/*; do
|
||||
mv $f $f-$pythonVersion
|
||||
done
|
||||
|
||||
# And provide suffix-less symlinks for the default version
|
||||
if [ $pythonVersion = $defaultVersion ]; then
|
||||
for f in $binDir/*; do
|
||||
mv $f ${f}$commandSuffix
|
||||
ln -sr $f ${f%-$pythonVersion}
|
||||
done
|
||||
fi
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/lib/python* \
|
||||
$binDir
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user