Files
haikuports/dev-python/build/build-1.0.3.recipe
OscarL dc323d814f build: update to version 1.0.3 (#9567)
Performed the usual recipes cleanups.
2023-10-04 07:08:33 +00:00

83 lines
1.9 KiB
Bash

SUMMARY="A simple, correct PEP 517 build frontend"
DESCRIPTION="build will invoke the PEP 517 hooks to build a distribution package.
It is a simple build tool and does not perform any dependency management."
HOMEPAGE="https://pypi.org/project/build/"
COPYRIGHT="2010-2023 Filipe Laíns"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/pypa/build/archive/refs/tags/$portVersion.tar.gz"
CHECKSUM_SHA256="4f9201228d0af78aac3c672e89a81749a001d8d7f448cf9196d93cce8d5ee45a"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_VERSIONS=(3.9 3.10)
defaultVersion=3.10
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
cmd:pyproject_build_$pythonVersion
\""
if [ $pythonVersion = $defaultVersion ]; then
eval "PROVIDES_${pythonPackage}+=\"
cmd:pyproject_build
\""
fi
eval "REQUIRES_$pythonPackage=\"
haiku
cmd:python$pythonVersion
packaging_$pythonPackage
pyproject_hooks_$pythonPackage
tomli_$pythonPackage
\""
BUILD_REQUIRES+="
build_$pythonPackage
flit_core_$pythonPackage
installer_$pythonPackage
pyproject_hooks_$pythonPackage
"
BUILD_PREREQUIRES+="
cmd:python$pythonVersion
"
done
INSTALL()
{
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
$python -m flit_core.wheel
$python -m installer -p $prefix dist/*.whl
# Version the script, but provide suffix-less symlink for the default Python version.
mv $prefix/bin/pyproject-build $prefix/bin/pyproject-build-$pythonVersion
if [ $pythonVersion = $defaultVersion ]; then
ln -sr $prefix/bin/pyproject-build-$pythonVersion $prefix/bin/pyproject-build
fi
packageEntries $pythonPackage \
$prefix/lib/python* \
$prefix/bin
done
}