aboutsummaryrefslogtreecommitdiffstats
path: root/community/py3-pybind11/APKBUILD
blob: 4f78dbb18d7aefc90901ff0211f6c012a0d0224f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=py3-pybind11
_pkgname=pybind11
pkgver=2.4.3
pkgrel=1
pkgdesc="Seamless operability between C++11 and Python"
url="https://github.com/pybind/pybind11"
arch="noarch"
license="MPL-2.0"
makedepends="
	python3-dev
	py3-setuptools
	cmake
	boost-dev
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/pybind/pybind11/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-pybind11" # Backwards compatibility
provides="py-pybind11=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	# fails to build with fortify headers enabled
	# https://github.com/pybind/pybind11/issues/1650
	export CXXFLAGS="$CXXFLAGS -U_FORTIFY_SOURCE"

	python3 setup.py build

	mkdir -p "$builddir"/build-cmake
	cd "$builddir"/build-cmake
	cmake .. \
		-DPYTHON_EXECUTABLE=/usr/bin/python3 \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DUSE_PYTHON_INCLUDE_DIR=FALSE
	make
}

check() {
	make -C build-cmake check
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir" \
		--install-headers=/usr/include/pybind11 --skip-build

	DESTDIR="$pkgdir" make -C build-cmake install
}

dev() {
	depends_dev="$pkgname"
	default_dev
}

sha512sums="993b9a00fb9a4280d5500f8bae2b1238c026c1635862307c7b06ac0d26c3a9743d9c69658190decd126d0de45353a51c4b354bcc023345a05fce0bdc52b56fe0  py3-pybind11-2.4.3.tar.gz"