2019-06-21 18:51:56 +00:00
|
|
|
# Maintainer : Daniel Bermond <dbermond@archlinux.org>
|
2018-11-20 00:50:29 +00:00
|
|
|
# Maintainer : Santiago Torres-Arias <santiago@archlinux.org>
|
|
|
|
# Contributor: Matthew Ellison <matt+aur@arroyonetworks.com>
|
|
|
|
|
|
|
|
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
2020-10-29 14:04:52 +00:00
|
|
|
# - disable lto via -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF
|
2018-11-20 00:50:29 +00:00
|
|
|
|
|
|
|
pkgname=pybind11
|
2021-07-18 21:25:48 +00:00
|
|
|
pkgver=2.7.0
|
|
|
|
pkgrel=1
|
2018-11-20 00:50:29 +00:00
|
|
|
pkgdesc='A lightweight header-only library that exposes C++ types in Python and vice versa'
|
|
|
|
arch=('any')
|
|
|
|
url='https://pybind11.readthedocs.org/'
|
|
|
|
license=('BSD')
|
2019-06-21 18:51:56 +00:00
|
|
|
optdepends=('python: for python bindings')
|
2020-10-29 02:10:18 +00:00
|
|
|
makedepends=('cmake' 'boost' 'eigen' 'python' 'python-setuptools' 'python-pytest')
|
|
|
|
#'python-sphinx' 'python-sphinx_rtd_theme' 'python-breathe')
|
2021-01-27 23:05:55 +00:00
|
|
|
checkdepends=('python-numpy' 'python-scipy')
|
2020-10-29 02:10:18 +00:00
|
|
|
source=("https://github.com/pybind/pybind11/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
|
2021-07-18 21:25:48 +00:00
|
|
|
sha256sums=('6cd73b3d0bf3daf415b5f9b87ca8817cc2e2b64c275d65f9500250f9fee1677e')
|
2018-11-20 00:50:29 +00:00
|
|
|
|
|
|
|
build () {
|
|
|
|
cd "${pkgname}-${pkgver}"
|
|
|
|
python setup.py build
|
|
|
|
|
2020-10-29 02:10:18 +00:00
|
|
|
# tests
|
|
|
|
cmake \
|
|
|
|
-B "${srcdir}/build-cmake" \
|
|
|
|
-S "${srcdir}/${pkgname}-${pkgver}" \
|
|
|
|
-DCMAKE_BUILD_TYPE:STRING='None' \
|
|
|
|
-DCMAKE_INSTALL_PREFIX:PATH='/usr' \
|
2020-10-29 14:04:52 +00:00
|
|
|
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \
|
2020-10-29 02:10:18 +00:00
|
|
|
-Wno-dev
|
|
|
|
make -C "${srcdir}/build-cmake" all mock_install
|
2018-11-20 00:50:29 +00:00
|
|
|
|
2021-07-18 21:25:48 +00:00
|
|
|
# manpage (needs python-sphinxcontrib-{moderncmakedomain,svg2pdfconverter})
|
2020-10-29 02:10:18 +00:00
|
|
|
# make -C "${srcdir}/${pkgname}-${pkgver}/docs" man
|
2018-11-20 00:50:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
check() {
|
2020-10-29 02:10:18 +00:00
|
|
|
make -C build-cmake check
|
2018-11-20 00:50:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
cd "${pkgname}-${pkgver}"
|
2020-10-29 02:10:18 +00:00
|
|
|
python setup.py install --root="$pkgdir" --skip-build --optimize='1'
|
2018-11-20 00:50:29 +00:00
|
|
|
|
2020-10-29 02:10:18 +00:00
|
|
|
# symlinks
|
|
|
|
local _pyver
|
|
|
|
_pyver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
|
2021-07-18 21:25:48 +00:00
|
|
|
install -d -m755 "${pkgdir}/usr"/{include,lib/cmake}
|
2020-10-29 02:10:18 +00:00
|
|
|
ln -s "../lib/python${_pyver}/site-packages/pybind11/include/pybind11" "${pkgdir}/usr/include/pybind11"
|
2021-04-17 19:29:41 +00:00
|
|
|
ln -s "../../lib/python${_pyver}/site-packages/pybind11/share/cmake/pybind11" "${pkgdir}/usr/lib/cmake/pybind11"
|
2018-11-20 00:50:29 +00:00
|
|
|
|
2019-06-21 18:51:56 +00:00
|
|
|
# man page
|
2020-10-29 02:10:18 +00:00
|
|
|
# install -D -m644 "docs/.build/man/${pkgname}.1" "${pkgdir}/usr/share/man/man7/${pkgname}.7"
|
|
|
|
# sed -i '/^\.TH/s/"1"/"7"/' "${pkgdir}/usr/share/man/man7/${pkgname}.7"
|
2018-11-20 00:50:29 +00:00
|
|
|
|
|
|
|
# license
|
|
|
|
install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
|
|
|
|
}
|