mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 21:30:08 +02:00
97 lines
2.5 KiB
Bash
97 lines
2.5 KiB
Bash
SUMMARY="Seamless operability between C++11 and Python"
|
|
DESCRIPTION="pybind11 is a lightweight header-only library that exposes C++ \
|
|
types in Python and vice versa, mainly to create Python bindings of existing \
|
|
C++ code.
|
|
Its goals and syntax are similar to the excellent Boost.Python library by \
|
|
David Abrahams: to minimize boilerplate code in traditional extension modules \
|
|
by inferring type information using compile-time introspection."
|
|
HOMEPAGE="https://pypi.org/project/pybind11/"
|
|
COPYRIGHT="2015-2023 Wenzel Jakob"
|
|
LICENSE="BSD (2-clause)"
|
|
REVISION="1"
|
|
SOURCE_URI="https://files.pythonhosted.org/packages/source/p/pybind11/pybind11-$portVersion.tar.gz"
|
|
CHECKSUM_SHA256="ba6af10348c12b24e92fa086b39cfba0eff619b61ac77c406167d813b096d39a"
|
|
|
|
ARCHITECTURES="all !x86_gcc2"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
PROVIDES="
|
|
$portName = $portVersion
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
"
|
|
|
|
PYTHON_VERSIONS=(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:pybind11_config_$pythonVersion
|
|
\""
|
|
|
|
if [ $pythonVersion = $defaultVersion ]; then
|
|
eval "PROVIDES_${pythonPackage}+=\"
|
|
cmd:pybind11_config
|
|
\""
|
|
fi
|
|
|
|
if [ "$targetArchitecture" = x86_gcc2 ]; then
|
|
eval "PROVIDES_$pythonPackage+=\"
|
|
pybind11_$pythonPackage = $portVersion
|
|
\""
|
|
fi
|
|
eval "REQUIRES_$pythonPackage=\"
|
|
haiku
|
|
cmd:python$pythonVersion
|
|
\""
|
|
BUILD_REQUIRES+="
|
|
haiku${secondaryArchSuffix}_devel
|
|
build_$pythonPackage
|
|
installer_$pythonPackage
|
|
setuptools_$pythonPackage
|
|
wheel_$pythonPackage
|
|
"
|
|
BUILD_PREREQUIRES+="
|
|
cmd:python$pythonVersion
|
|
"
|
|
done
|
|
|
|
BUILD()
|
|
{
|
|
for i in "${!PYTHON_VERSIONS[@]}"; do
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
python=python$pythonVersion
|
|
|
|
$python -m build --wheel --skip-dependency-check --no-isolation
|
|
done
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
for i in "${!PYTHON_VERSIONS[@]}"; do
|
|
pythonVersion=${PYTHON_VERSIONS[$i]}
|
|
pythonPackage=python${pythonVersion//.}
|
|
|
|
python=python$pythonVersion
|
|
|
|
$python -m installer --p $prefix dist/*-$portVersion-*.whl
|
|
|
|
# Version suffix pybind11-config
|
|
mv $prefix/bin/pybind11-config $prefix/bin/pybind11-config-$pythonVersion
|
|
|
|
# Provide suffix-less symlink for the default Python version
|
|
if [ $pythonVersion = $defaultVersion ]; then
|
|
ln -sr $prefix/bin/pybind11-config-$pythonVersion $prefix/bin/pybind11-config
|
|
fi
|
|
|
|
packageEntries $pythonPackage \
|
|
$prefix/bin \
|
|
$prefix/lib/python*
|
|
done
|
|
}
|