mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
83 lines
2.0 KiB
Bash
83 lines
2.0 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="2019 Filipe Laíns"
|
|
LICENSE="MIT"
|
|
REVISION="2"
|
|
SOURCE_URI="https://files.pythonhosted.org/packages/source/b/build/build-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="119b2fb462adef986483438377a13b2f42064a2a3a4161f24a0cca698a07ac8c"
|
|
|
|
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: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 # only needed for Python < 3.11
|
|
\""
|
|
|
|
BUILD_REQUIRES+="
|
|
flit_core_$pythonPackage
|
|
installer_$pythonPackage
|
|
pyproject_hooks_$pythonPackage
|
|
tomli_$pythonPackage # only needed for Python < 3.11
|
|
"
|
|
BUILD_PREREQUIRES+="
|
|
cmd:python$pythonVersion
|
|
"
|
|
done
|
|
|
|
|
|
INSTALL()
|
|
{
|
|
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
|
|
pythonPackage=python${pythonVersion//.}
|
|
|
|
python=python$pythonVersion
|
|
|
|
# $python -m flit_core.wheel
|
|
PYTHONPATH=src $python -m build --no-isolation --skip-dependency-check
|
|
$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
|
|
}
|