PKGBUILDs/community/pybind11/PKGBUILD

61 lines
2 KiB
Bash
Raw Normal View History

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>
# - disable lto via -DPYBIND11_LTO_CXX_FLAGS=""
pkgname=pybind11
2019-10-20 18:20:30 +00:00
pkgver=2.4.3
2019-11-14 14:42:12 +00:00
pkgrel=3
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')
2018-11-20 00:50:29 +00:00
makedepends=('cmake' 'boost' 'eigen' 'python' 'python-setuptools' 'python-pytest'
2019-06-21 18:51:56 +00:00
'python-sphinx' 'python-sphinx_rtd_theme' 'python-breathe')
checkdepends=('python-py' 'python-pluggy' 'python-hypothesis' 'python-numpy' 'python-scipy')
2018-11-20 00:50:29 +00:00
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/pybind/pybind11/archive/v${pkgver}.tar.gz")
2019-10-20 18:20:30 +00:00
sha256sums=('1eed57bc6863190e35637290f97a20c81cfe4d9090ac0a24f3bbf08f265eb71d')
2018-11-20 00:50:29 +00:00
prepare() {
2019-10-20 18:20:30 +00:00
mkdir -p "${pkgname}-${pkgver}/build-cmake"
2018-11-20 00:50:29 +00:00
}
build () {
# python modules
cd "${pkgname}-${pkgver}"
python setup.py build
# cmake files and tests
cd build-cmake
2019-06-21 18:51:56 +00:00
cmake -DCMAKE_INSTALL_PREFIX:PATH='/usr' -DPYBIND11_LTO_CXX_FLAGS="" -Wno-dev ..
2018-11-20 00:50:29 +00:00
make all mock_install
# manpage
2019-10-20 18:20:30 +00:00
make -C "${srcdir}/${pkgname}-${pkgver}/docs" man
2018-11-20 00:50:29 +00:00
}
check() {
2019-10-20 18:20:30 +00:00
make -C "${pkgname}-${pkgver}/build-cmake" check
2018-11-20 00:50:29 +00:00
}
package() {
cd "${pkgname}-${pkgver}"
# python modules
python setup.py install --root="$pkgdir" --install-headers='/usr/include/pybind11' --skip-build --optimize='1'
# cmake files
mkdir -p "${pkgdir}/usr/share/cmake/${pkgname}"
2019-10-20 18:20:30 +00:00
install -m644 build-cmake/mock_install/share/cmake/pybind11/*.cmake -t "${pkgdir}/usr/share/cmake/${pkgname}"
2018-11-20 00:50:29 +00:00
2019-06-21 18:51:56 +00:00
# man page
2019-10-20 18:20:30 +00:00
install -D -m644 "docs/.build/man/${pkgname}.1" "${pkgdir}/usr/share/man/man7/${pkgname}.7"
2019-06-21 18:51:56 +00:00
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}"
}