2019-01-20 15:45:34 +00:00

67 lines
1.5 KiB
Plaintext

# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=py-pybind11
_pkgname=pybind11
pkgver=2.2.4
pkgrel=0
pkgdesc="Seamless operability between C++11 and Python"
url="https://github.com/pybind/pybind11"
arch="noarch"
license="MPL-2.0"
depends=""
makedepends="
python2-dev
python3-dev
py-setuptools
cmake
pytest
boost-dev
"
subpackages="py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2"
source="$pkgname-$pkgver.tar.gz::https://github.com/pybind/pybind11/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
build() {
# fails to build with fortify headers enabled
# https://github.com/pybind/pybind11/issues/1650
export CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE"
local python=
for python in python2 python3; do
cd "$builddir"
$python setup.py build
mkdir "$builddir"/$python
cd "$builddir"/$python
cmake -DPYTHON_EXECUTABLE=/usr/bin/$python \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_PYTHON_INCLUDE_DIR=FALSE ..
make
done
}
package() {
mkdir -p "$pkgdir"
}
_py2() {
replaces="$pkgname"
depends="${depends//py-/py2-}"
_py python2
}
_py3() {
depends="${depends//py-/py3-}"
_py python3
}
_py() {
local python="$1"
pkgdesc="$pkgdesc (for $python)"
depends="$depends $python"
install_if="$pkgname=$pkgver-r$pkgrel $python"
cd "$builddir"
$python setup.py install --prefix=/usr --root="$subpkgdir" \
--install-headers='/usr/include/pybind11' --skip-build
}
sha512sums="6bddf5c885ff92a3e373bcedc6574dfefe8be9ebb6176c6c96d475457466c76bfb982c6df4066cb0fbead4b867f87dbc4fbc1605c80852635016f614330ce041 py-pybind11-2.2.4.tar.gz"