lazy-object-proxy: new recipe (#5571)

This commit is contained in:
tommyjanna
2021-01-05 08:17:18 -05:00
committed by GitHub
parent 6530ab388c
commit af453eaadd

View File

@@ -0,0 +1,63 @@
SUMMARY="A fast and thorough lazy object proxy for Python"
DESCRIPTION="lazy-object-proxy is based on the ObjectProxy from the wrapt \
Python module with one big change: it calls a function the first time the \
proxy object is used, while wrapt.ObjectProxy just forwards the method calls \
to the target object"
HOMEPAGE="https://github.com/ionelmc/python-lazy-object-proxy"
COPYRIGHT="2014-2019, Ionel Cristian Mărieș"
LICENSE="BSD (2-clause)"
REVISION="1"
SOURCE_URI="https://github.com/ionelmc/python-lazy-object-proxy/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="b28708f92930b4e2c0ab39def12ebc6be466db5e91fad88bfc7ebf9aa9c9de16"
SOURCE_DIR="python-lazy-object-proxy-$portVersion"
ARCHITECTURES="any"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
"
BUILD_REQUIRES="
haiku_devel
"
PYTHON_PACKAGES=(python36 python3)
PYTHON_VERSIONS=(3.6 3.7)
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_scm_$pythonPackage"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:python$pythonVersion"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p "$installLocation"
rm -rf build
$python setup.py build install \
--root=/ --prefix="$prefix"
packageEntries $pythonPackage \
"$prefix"/lib/python*
done
}