From c40b20daaaee99a92bc32be48aff5dc05302686a Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Wed, 1 Jan 2020 14:52:30 +0100 Subject: [PATCH] pybind11, new recipe (#4509) --- dev-libs/pybind11/pybind11-2.4.3.recipe | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 dev-libs/pybind11/pybind11-2.4.3.recipe diff --git a/dev-libs/pybind11/pybind11-2.4.3.recipe b/dev-libs/pybind11/pybind11-2.4.3.recipe new file mode 100644 index 000000000..e8fc84059 --- /dev/null +++ b/dev-libs/pybind11/pybind11-2.4.3.recipe @@ -0,0 +1,61 @@ +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-2019 Wenzel Jakob" +LICENSE="BSD (2-clause)" +REVISION="1" +SOURCE_URI="https://github.com/pybind/pybind11/archive/v$portVersion.tar.gz" +CHECKSUM_SHA256="1eed57bc6863190e35637290f97a20c81cfe4d9090ac0a24f3bbf08f265eb71d" +SOURCE_FILENAME="pybind11-v$portVersion.tar.gz" + +ARCHITECTURES="any" + +PROVIDES=" + $portName = $portVersion + " +REQUIRES=" + haiku + " + +PYTHON_PACKAGES=(python python36 python3) +PYTHON_VERSIONS=(2.7 3.6 3.7) +for i in "${!PYTHON_PACKAGES[@]}"; do +pythonPackage=${PYTHON_PACKAGES[i]} +pythonVersion=${PYTHON_VERSIONS[$i]} +eval "PROVIDES_${pythonPackage}=\"\ + ${portName}_$pythonPackage = $portVersion\ + \"; \ +REQUIRES_$pythonPackage=\"\ + haiku\n\ + cmd:python$pythonVersion\ + \"" +BUILD_REQUIRES="$BUILD_REQUIRES + setuptools_$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 \ + $developDir \ + $prefix/lib/python* + done +}