mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-21 19:20:08 +02:00
pybind11: update to version 2.11.1 (#9220)
Also, provide a non-versioned pybind11-config symlink to the 3.10 version (matching our current default Python version). This should (might?) help with packages as contourpy that expect to find a non-versioned "pybind11-config".
This commit is contained in:
106
dev-python/pybind11/pybind11-2.11.1.recipe
Normal file
106
dev-python/pybind11/pybind11-2.11.1.recipe
Normal file
@@ -0,0 +1,106 @@
|
||||
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://github.com/pybind/pybind11/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="d475978da0cdc2d43b73f30910786759d593a9d8ee05b1b6846d1eb16c6d2e0c"
|
||||
SOURCE_FILENAME="pybind11-v$portVersion.tar.gz"
|
||||
|
||||
ARCHITECTURES="all !x86_gcc2"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
$portName = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
"
|
||||
|
||||
PYTHON_PACKAGES=(python38 python39 python310)
|
||||
PYTHON_VERSIONS=(3.8 3.9 3.10)
|
||||
defaultVersion=3.10
|
||||
for i in "${!PYTHON_PACKAGES[@]}"; do
|
||||
pythonPackage=${PYTHON_PACKAGES[i]}
|
||||
pythonVersion=${PYTHON_VERSIONS[$i]}
|
||||
|
||||
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
|
||||
setuptools_$pythonPackage
|
||||
devel:eigen$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES+="
|
||||
cmd:cmake # setup.py calls cmake
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:make
|
||||
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 #$prefix/lib/cmake
|
||||
rm -rf build
|
||||
|
||||
$python setup.py build install \
|
||||
--root=/ --prefix=$prefix
|
||||
|
||||
# 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
|
||||
|
||||
# Not sure we want to run cmake build
|
||||
# this will install the headers and cmake files double
|
||||
# cmake -B build $cmakeDirArgs \
|
||||
# -DCMAKE_BUILD_TYPE=None \
|
||||
# -DPYBIND11_PYTHON_VERSION=$pythonVersion \
|
||||
# -DPYBIND11_TEST=OFF \
|
||||
# -DUSE_PYTHON_INCLUDE_DIR=OFF
|
||||
# make -C build install
|
||||
|
||||
# mv $dataDir/cmake/pybind11 $prefix/lib/cmake
|
||||
# rm -rf $dataDir
|
||||
|
||||
packageEntries $pythonPackage \
|
||||
$prefix/bin \
|
||||
$prefix/lib/python*
|
||||
done
|
||||
}
|
||||
Reference in New Issue
Block a user