diff options
author | Carlo Landmeter <clandmeter@alpinelinux.org> | 2019-01-20 15:30:24 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@alpinelinux.org> | 2019-01-20 15:31:17 +0000 |
commit | 0fe948e5773afedba271c259ec8dac6e50e8f147 (patch) | |
tree | 57a04591633d03987f5ffb5b55174a470ffdc052 /testing | |
parent | 1000910860bd5281fcc9696cd34bc6bc80113b1c (diff) | |
download | aports-0fe948e5773afedba271c259ec8dac6e50e8f147.tar.bz2 aports-0fe948e5773afedba271c259ec8dac6e50e8f147.tar.xz |
testing/pybind11: new aport
fortify breaks build:
https://github.com/pybind/pybind11/issues/1650
Diffstat (limited to 'testing')
-rw-r--r-- | testing/pybind11/APKBUILD | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/testing/pybind11/APKBUILD b/testing/pybind11/APKBUILD new file mode 100644 index 0000000000..64c7397754 --- /dev/null +++ b/testing/pybind11/APKBUILD @@ -0,0 +1,66 @@ +# 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" |