community/pybind11 to 2.3.0-1

This commit is contained in:
Kevin Mihelich 2019-06-21 18:51:56 +00:00
parent c38d617baa
commit 4548f3c4ae

View file

@ -1,4 +1,4 @@
# Maintainer : Daniel Bermond < gmail-com: danielbermond > # Maintainer : Daniel Bermond <dbermond@archlinux.org>
# Maintainer : Santiago Torres-Arias <santiago@archlinux.org> # Maintainer : Santiago Torres-Arias <santiago@archlinux.org>
# Contributor: Matthew Ellison <matt+aur@arroyonetworks.com> # Contributor: Matthew Ellison <matt+aur@arroyonetworks.com>
@ -6,50 +6,33 @@
# - disable lto via -DPYBIND11_LTO_CXX_FLAGS="" # - disable lto via -DPYBIND11_LTO_CXX_FLAGS=""
pkgname=pybind11 pkgname=pybind11
pkgver=2.2.4 pkgver=2.3.0
pkgrel=5 pkgrel=1
pkgdesc='A lightweight header-only library that exposes C++ types in Python and vice versa' pkgdesc='A lightweight header-only library that exposes C++ types in Python and vice versa'
arch=('any') arch=('any')
url='https://pybind11.readthedocs.org/' url='https://pybind11.readthedocs.org/'
license=('BSD') license=('BSD')
optdepends=('python: to target bindings supporting python 3' optdepends=('python: for python bindings')
'python2: to target bindings supporting python 2')
makedepends=('cmake' 'boost' 'eigen' 'python' 'python-setuptools' 'python-pytest' makedepends=('cmake' 'boost' 'eigen' 'python' 'python-setuptools' 'python-pytest'
'python-sphinx' 'python2' 'python2-setuptools' 'python2-pytest' 'python-breathe') 'python-sphinx' 'python-sphinx_rtd_theme' 'python-breathe')
checkdepends=('python-numpy' 'python-scipy' 'python2-numpy' 'python2-scipy') checkdepends=('python-py' 'python-pluggy' 'python-hypothesis' 'python-numpy' 'python-scipy')
source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/pybind/pybind11/archive/v${pkgver}.tar.gz") source=("${pkgname}-${pkgver}.tar.gz"::"https://github.com/pybind/pybind11/archive/v${pkgver}.tar.gz")
sha256sums=('b69e83658513215b8d1443544d0549b7d231b9f201f6fc787a2b2218b408181e') sha256sums=('0f34838f2c8024a6765168227ba587b3687729ebf03dc912f88ff75c7aa9cfe8')
prepare() { prepare() {
cd "${pkgname}-${pkgver}" cd "${pkgname}-${pkgver}"
mkdir -p build-cmake{,-py2} mkdir -p build-cmake
} }
build () { build () {
local _pythonver
_pythonver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
# python modules # python modules
cd "${pkgname}-${pkgver}" cd "${pkgname}-${pkgver}"
python setup.py build python setup.py build
# cmake files and tests # cmake files and tests
cd build-cmake cd build-cmake
cmake \ cmake -DCMAKE_INSTALL_PREFIX:PATH='/usr' -DPYBIND11_LTO_CXX_FLAGS="" -Wno-dev ..
-DCMAKE_INSTALL_PREFIX='/usr' \
-DPYBIND11_LTO_CXX_FLAGS="" \
-DPYTHON_EXECUTABLE:FILEPATH="/usr/bin/python${_pythonver}" \
-Wno-dev \
..
make all mock_install
cd "${srcdir}/${pkgname}-${pkgver}/build-cmake-py2"
cmake \
-DCMAKE_INSTALL_PREFIX='/usr' \
-DPYBIND11_LTO_CXX_FLAGS="" \
-DPYTHON_EXECUTABLE:FILEPATH='/usr/bin/python2.7' \
-Wno-dev \
..
make all mock_install make all mock_install
# manpage # manpage
@ -60,28 +43,24 @@ build () {
check() { check() {
cd "${pkgname}-${pkgver}" cd "${pkgname}-${pkgver}"
make -C build-cmake check # python3 tests make -C build-cmake check
make -C build-cmake-py2 check # python2 tests
} }
package() { package() {
cd "${pkgname}-${pkgver}" cd "${pkgname}-${pkgver}"
local _pythonver
_pythonver="$(python -c 'import sys; print("%s.%s" %sys.version_info[0:2])')"
# python modules # python modules
python setup.py install --root="$pkgdir" --install-headers='/usr/include/pybind11' --skip-build --optimize='1' python setup.py install --root="$pkgdir" --install-headers='/usr/include/pybind11' --skip-build --optimize='1'
python2 setup.py install --root="$pkgdir" --install-headers='/usr/include/pybind11' --skip-build --optimize='1'
# cmake files # cmake files
mkdir -p "${pkgdir}/usr/share/cmake/${pkgname}" mkdir -p "${pkgdir}/usr/share/cmake/${pkgname}"
cd build-cmake/mock_install/share/cmake/pybind11 cd build-cmake/mock_install/share/cmake/pybind11
install -m644 *.cmake "${pkgdir}/usr/share/cmake/${pkgname}" install -m644 *.cmake "${pkgdir}/usr/share/cmake/${pkgname}"
# manpage # man page
cd "${srcdir}/${pkgname}-${pkgver}/docs/.build/man" cd "${srcdir}/${pkgname}-${pkgver}/docs/.build/man"
install -D -m644 "${pkgname}.1" -t "${pkgdir}/usr/share/man/man1" install -D -m644 "${pkgname}.1" "${pkgdir}/usr/share/man/man7/${pkgname}.7"
sed -i '/^\.TH/s/"1"/"7"/' "${pkgdir}/usr/share/man/man7/${pkgname}.7"
# license # license
cd "${srcdir}/${pkgname}-${pkgver}" cd "${srcdir}/${pkgname}-${pkgver}"