Files
haikuports/dev-python/hatchling/hatchling-1.27.0.recipe
humdinger c27b49356a Update python's "hatchling" (#12952)
In order to build yt-dlp, "hatchling" needs to be updated to v1.27.
2025-09-23 17:53:00 +02:00

82 lines
2.1 KiB
Bash

SUMMARY="Modern, extensible Python build backend"
DESCRIPTION="This is the extensible, standards compliant build backend used by Hatch."
HOMEPAGE="https://hatch.pypa.io/dev/history/hatchling/"
COPYRIGHT="2021-present Ofek Lev"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://files.pythonhosted.org/packages/source/h/$portName/$portName-$portVersion.tar.gz"
CHECKSUM_SHA256="971c296d9819abb3811112fc52c7a9751c8d381898f36533bb16f9791e941fd6"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_VERSIONS=(3.10)
defaultVersion=3.10
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_$pythonPackage=\"
${portName}_$pythonPackage = $portVersion
cmd:hatchling_$pythonVersion
\""
# Provide non-suffixed cmd only for the default Python version
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_$pythonPackage+=\"
cmd:hatchling
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
editables_$pythonPackage >= 0.3
packaging_$pythonPackage >= 23.2
pathspec_$pythonPackage >= 0.10.1
pluggy_$pythonPackage >= 1.0.0
tomli_$pythonPackage > 1.2.2 # Only for Python < 3.11
trove_classifiers_$pythonPackage
cmd:python$pythonVersion
\""
BUILD_REQUIRES+="
build_$pythonPackage
installer_$pythonPackage
pathspec_$pythonPackage >= 0.10.1
pluggy_$pythonPackage >= 1.0.0
trove_classifiers_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
$python -m build --wheel --skip-dependency-check --no-isolation
$python -m installer -p $prefix dist/*.whl
mv $prefix/bin/hatchling $prefix/bin/hatchling-$pythonVersion
# Provide non-suffixed cmd only for the default Python version
if [ $pythonVersion = $defaultVersion ]; then
ln -sr $prefix/bin/hatchling-$pythonVersion $prefix/bin/hatchling
fi
packageEntries $pythonPackage \
$prefix/lib/python* \
$prefix/bin
done
}