mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +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:
@@ -10,7 +10,7 @@ Wilbert Berendsen."
|
||||
HOMEPAGE="https://github.com/frescobaldi/python-ly/"
|
||||
COPYRIGHT="2008-2015 Wilbert Berendsen"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="4"
|
||||
REVISION="5"
|
||||
SOURCE_URI="https://pypi.io/packages/source/p/python-ly/python-ly-$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="d4d2b68eb0ef8073200154247cc9bd91ed7fb2671ac966ef3d2853281c15d7a8"
|
||||
SOURCE_FILENAME="python-ly-$portVersion.tar.gz"
|
||||
@@ -28,47 +28,63 @@ REQUIRES="
|
||||
BUILD_REQUIRES="
|
||||
haiku_devel
|
||||
"
|
||||
PYTHON_PACKAGES=(python39 python310)
|
||||
PYTHON_VERSIONS=(3.9 3.10)
|
||||
commandSuffixes=(38 "" 310)
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
commandSuffix=${commandSuffixes[$i]}
|
||||
eval "PROVIDES_${pythonPackage}=\"\n\
|
||||
${portName}_$pythonPackage = $portVersion\n\
|
||||
cmd:ly$commandSuffix = $portVersion\n\
|
||||
cmd:ly_server$commandSuffix = $portVersion\n\
|
||||
\"; \
|
||||
REQUIRES_$pythonPackage=\"\n\
|
||||
haiku\n\
|
||||
cmd:python$pythonVersion\n\
|
||||
\""
|
||||
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:ly_$pythonVersion = $portVersion
|
||||
cmd:ly_server_$pythonVersion = $portVersion
|
||||
\""
|
||||
# Provide non-suffixed cmd only for the default Python version
|
||||
if [ $pythonVersion = $defaultVersion ]; then
|
||||
eval "PROVIDES_$pythonPackage+=\"
|
||||
cmd:ly = $portVersion
|
||||
cmd:ly_server = $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]}
|
||||
pythonPackageName=${portName}_$pythonPackage-$portFullVersion
|
||||
pythonLinksDir=$(dirname $portPackageLinksDir)/$pythonPackageName
|
||||
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
||||
pythonPackage=python${pythonVersion//.}
|
||||
|
||||
python=python$pythonVersion
|
||||
installLocation=$prefix/lib/$python/vendor-packages/
|
||||
export PYTHONPATH=$installLocation:$PYTHONPATH
|
||||
|
||||
mkdir -p $installLocation
|
||||
rm -rf build
|
||||
|
||||
$python setup.py build install \
|
||||
--root=/ --prefix=$prefix
|
||||
|
||||
if [ $pythonPackage = python$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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user