description="A lightweight header-only library that exposes C++ types in Python and vice versa."
url="http://pybind11.readthedocs.org/"

maintainer="Pybind11 Team"
packager="spiky <spiky@nutyx.org>"

makedepends=(cmake)
run=(python)

name=pybind11
version=2.10.3
source=(https://github.com/pybind/${name}/archive/refs/tags/v${version}.tar.gz)

build() {
cd $name-$version

python setup.py build
python setup.py install --root="$PKG" --skip-build --optimize='1'

local _pyver
_pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
install -d -m755 "${PKG}/usr"/{include,lib/cmake}
ln -s "../lib/python${_pyver}/site-packages/pybind11/include/pybind11" "${PKG}/usr/include/pybind11"
ln -s "../../lib/python${_pyver}/site-packages/pybind11/share/cmake/pybind11" "${PKG}/usr/lib/cmake/pybind11"
    
# license
install -D -m644 LICENSE -t "${PKG}/usr/share/licenses/${name}"

}
