*_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:
OscarL
2025-07-14 20:48:47 -03:00
committed by GitHub
parent e8a2689159
commit 0922e64579
4 changed files with 175 additions and 115 deletions

View File

@@ -9,7 +9,7 @@ Ogg streams on an individual packet/page level."
HOMEPAGE="https://github.com/quodlibet/mutagen"
COPYRIGHT="Joe Wreschnig, Michael Urman, Lukáš Lalinský, Christoph Reiter, Ben Ockmore & others"
LICENSE="GNU GPL v2"
REVISION="1"
REVISION="2"
SOURCE_URI="https://files.pythonhosted.org/packages/source/m/$portName/$portName-$portVersion.tar.gz"
CHECKSUM_SHA256="719fadef0a978c31b4cf3c956261b3c58b6948b32023078a2117b1de09f0fc99"
SOURCE_DIR="mutagen-$portVersion"
@@ -27,39 +27,51 @@ 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:mid3cp$commandSuffix\n\
cmd:mid3iconv$commandSuffix\n\
cmd:mid3v2$commandSuffix\n\
cmd:moggsplit$commandSuffix\n\
cmd:mutagen_inspect$commandSuffix\n\
cmd:mutagen_pony$commandSuffix\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:mid3cp_$pythonVersion = $portVersion
cmd:mid3iconv_$pythonVersion = $portVersion
cmd:mid3v2_$pythonVersion = $portVersion
cmd:moggsplit_$pythonVersion = $portVersion
cmd:mutagen_inspect_$pythonVersion = $portVersion
cmd:mutagen_pony_$pythonVersion = $portVersion
\""
# Provide non-suffixed cmd only for the default Python version
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:mid3cp = $portVersion
cmd:mid3iconv = $portVersion
cmd:mid3v2 = $portVersion
cmd:moggsplit = $portVersion
cmd:mutagen_inspect = $portVersion
cmd:mutagen_pony = $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/
@@ -72,13 +84,19 @@ INSTALL()
--root=/ --prefix=$prefix \
--install-data=$dataDir
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