Files
haikuports/dev-python/hatchling/hatchling-1.25.0.recipe
OscarL a6bff52757 _python* packages: do not use Python 3.9 as "defaultVersion" anymore. (#12589)
While switching to 3.10 as default, lets just drop the 3.9 versions of these packages.

----

Checked runtime and build dependencies, but only tried a build of `hatchling` locally. I'll merge as is, and if something breaks, will fix later on.
2025-07-14 15:09:48 -03: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="2"
SOURCE_URI="https://files.pythonhosted.org/packages/source/h/$portName/$portName-$portVersion.tar.gz"
CHECKSUM_SHA256="7064631a512610b52250a4d3ff1bd81551d6d1431c4eb7b72e734df6c74f4262"
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
}