aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-pybind11
diff options
context:
space:
mode:
authorLeo <thinkabit.ukim@gmail.com>2019-08-31 02:56:07 -0300
committerLeo <thinkabit.ukim@gmail.com>2019-09-03 06:55:05 -0300
commit5bdf7f13eead989a3017689596520620cfe962d3 (patch)
treeb99acae15c3e4fd6d28af8d1693fb4b95c20c61a /community/py3-pybind11
parent2ace169a1e56c7cf09455927de0716d56253ba8d (diff)
downloadaports-5bdf7f13eead989a3017689596520620cfe962d3.tar.bz2
aports-5bdf7f13eead989a3017689596520620cfe962d3.tar.xz
community/py3-pybind11: rename from py-pybind11
Diffstat (limited to 'community/py3-pybind11')
-rw-r--r--community/py3-pybind11/APKBUILD66
1 files changed, 66 insertions, 0 deletions
diff --git a/community/py3-pybind11/APKBUILD b/community/py3-pybind11/APKBUILD
new file mode 100644
index 0000000000..b8a7a172d6
--- /dev/null
+++ b/community/py3-pybind11/APKBUILD
@@ -0,0 +1,66 @@
+# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
+pkgname=py-pybind11
+_pkgname=pybind11
+pkgver=2.2.4
+pkgrel=1
+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"