mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
93 lines
2.2 KiB
Bash
93 lines
2.2 KiB
Bash
SUMMARY="Python Build Reasonableness"
|
||
DESCRIPTION="PBR is a library that injects some useful and sensible default \
|
||
behaviors into your setuptools run.
|
||
|
||
PBR is only mildly configurable. The basic idea is that there’s a decent way \
|
||
to run things and if you do, you should reap the rewards, because then it’s \
|
||
simple and repeatable."
|
||
HOMEPAGE="https://docs.openstack.org/pbr/latest/
|
||
https://pypi.org/project/pbr/
|
||
https://github.com/openstack-dev/pbr"
|
||
COPYRIGHT="2013-2018 OpenStack Contributors"
|
||
LICENSE="Apache v2"
|
||
REVISION="2"
|
||
SOURCE_URI="https://files.pythonhosted.org/packages/source/p/pbr/pbr-$portVersion.tar.gz"
|
||
CHECKSUM_SHA256="5fad80b613c402d5b7df7bd84812548b2a61e9977387a80a5fc5c396492b13c9"
|
||
|
||
ARCHITECTURES="any"
|
||
|
||
PROVIDES="
|
||
$portName = $portVersion
|
||
"
|
||
REQUIRES="
|
||
haiku
|
||
"
|
||
|
||
BUILD_REQUIRES="
|
||
haiku_devel
|
||
"
|
||
|
||
PYTHON_PACKAGES=(python39 python310)
|
||
PYTHON_VERSIONS=(3.9 3.10)
|
||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||
eval "PROVIDES_$pythonPackage=\"
|
||
${portName}_$pythonPackage = $portVersion
|
||
\""
|
||
eval "REQUIRES_$pythonPackage=\"
|
||
haiku
|
||
cmd:python$pythonVersion
|
||
\""
|
||
BUILD_REQUIRES="$BUILD_REQUIRES
|
||
setuptools_$pythonPackage"
|
||
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
|
||
cmd:python$pythonVersion"
|
||
done
|
||
PROVIDES_python39+="
|
||
cmd:pbr
|
||
"
|
||
PROVIDES_python310+="
|
||
cmd:pbr310
|
||
"
|
||
|
||
BUILD()
|
||
{
|
||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||
|
||
rm -rf "$sourceDir"-$pythonPackage
|
||
cp -a "$sourceDir" "$sourceDir"-$pythonPackage
|
||
cd "$sourceDir"-$pythonPackage
|
||
|
||
python=python$pythonVersion
|
||
$python setup.py build
|
||
done
|
||
}
|
||
|
||
INSTALL()
|
||
{
|
||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||
|
||
cd "$sourceDir"-$pythonPackage
|
||
|
||
python=python$pythonVersion
|
||
installLocation=$prefix/lib/$python/vendor-packages/
|
||
export PYTHONPATH=$installLocation
|
||
mkdir -p "$installLocation"
|
||
$python setup.py install \
|
||
--root=/ --prefix="$prefix"
|
||
|
||
if [ "$pythonPackage" = python310 ]; then
|
||
mv "$binDir"/pbr "$binDir"/pbr310
|
||
fi
|
||
|
||
packageEntries $pythonPackage \
|
||
"$binDir" \
|
||
"$prefix"/lib/$python
|
||
done
|
||
}
|