From e714bec19dd8387e8695455f1793eae4a2808fc9 Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Fri, 19 May 2023 09:06:24 +0200 Subject: [PATCH] hatchling, new python recipe (#8675) Co-authored-by: Oscar Lesta --- dev-python/hatchling/hatchling-1.17.0.recipe | 82 ++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 dev-python/hatchling/hatchling-1.17.0.recipe diff --git a/dev-python/hatchling/hatchling-1.17.0.recipe b/dev-python/hatchling/hatchling-1.17.0.recipe new file mode 100644 index 000000000..fbc802947 --- /dev/null +++ b/dev-python/hatchling/hatchling-1.17.0.recipe @@ -0,0 +1,82 @@ +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="b1244db3f45b4ef5a00106a46612da107cdfaf85f1580b8e1c059fefc98b0930" + +ARCHITECTURES="any" + +PROVIDES=" + $portName = $portVersion + " +REQUIRES=" + haiku + " + +BUILD_REQUIRES=" + haiku_devel + " + +PYTHON_PACKAGES=(python39 python310) +PYTHON_VERSIONS=(3.9 3.10) +defaultVersion=3.9 +for i in "${!PYTHON_PACKAGES[@]}"; do + pythonPackage=${PYTHON_PACKAGES[i]} + pythonVersion=${PYTHON_VERSIONS[$i]} + + 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 >= 21.3 + 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 i in "${!PYTHON_PACKAGES[@]}"; do + pythonVersion=${PYTHON_VERSIONS[$i]} + + 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 ${PYTHON_PACKAGES[i]} \ + $prefix/lib/python* \ + $prefix/bin + done +}