mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
* python3.8: bulk removal of now obsolete "_python38" packages. Done via scripting. No functional change intended or expected. Some manual tweaks will follow. * python3.8: further manual tweaks after bulk-3.8-removal. Unlike the previous commit with automated changes, I've tested builds for *these* recipes in beta4 64 bits.
107 lines
2.9 KiB
Bash
107 lines
2.9 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="2"
|
|
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=(python39 python310)
|
|
PYTHON_VERSIONS=(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
|
|
}
|