1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-22 10:45:15 +03:00
aports/community/py3-pybind11/APKBUILD
2023-01-07 03:13:40 +01:00

65 lines
1.6 KiB
Text

# Maintainer: Carlo Landmeter <clandmeter@alpinelinux.org>
pkgname=py3-pybind11
_pkgname=pybind11
pkgver=2.10.3
pkgrel=0
pkgdesc="Seamless operability between C++11 and Python"
url="https://github.com/pybind/pybind11"
arch="noarch"
license="MPL-2.0"
makedepends="
boost-dev
cmake
py3-setuptools
python3-dev
samurai
"
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
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake -B build -G Ninja \
-DCMAKE_BUILD_TYPE=None \
-DPYTHON_EXECUTABLE=/usr/bin/python3 \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_PYTHON_INCLUDE_DIR=FALSE \
$CMAKE_CROSSOPTS
cmake --build build
}
check() {
ctest --test-dir build --output-on-failure
}
package() {
python3 setup.py install --root="$pkgdir" \
--install-headers=/usr/include/pybind11 --skip-build
DESTDIR="$pkgdir" cmake --install build
}
dev() {
depends_dev="$pkgname=$pkgver-r$pkgrel"
amove usr/share/cmake
default_dev
}
sha512sums="
3894400f04cd08e2dbb14b3d696339f0364434f1d6f8bb057338ac88157ec7491b2df1e1e46ebd5abccdcd5775c5e9238de6404f0db87f64f5a1802db3a5b18c py3-pybind11-2.10.3.tar.gz
"