void-packages/srcpkgs/python3-pybind11/template

52 lines
1.3 KiB
Bash

# Template file for 'python3-pybind11'
pkgname=python3-pybind11
version=2.10.1
revision=1
build_style=python3-module
hostmakedepends="cmake python3-setuptools
python3-pytest python3-sphinx_rtd_theme python3-breathe"
depends="python3-devel"
checkdepends="python3-numpy $depends"
short_desc="C++ header-only library to produce Python bindings"
maintainer="Andrew J. Hesford <ajh@sideband.org>"
license="BSD-3-Clause"
homepage="https://github.com/pybind/pybind11"
distfiles="https://github.com/pybind/pybind11/archive/v${version}.tar.gz"
checksum=111014b516b625083bef701df7880f78c2243835abdb263065b6b59b960b6bad
post_patch() {
# These dependencies are not packaged and don't affect the man page
vsed -e '/sphinx_copybutton/d' \
-e '/sphinxcontrib.rsvgconverter/d' \
-e '/sphinxcontrib.moderncmakedomain/d' -i docs/conf.py
}
post_build() {
# Build the man page
make $makejobs -C docs man
}
pre_check() {
mkdir -p build.tests
cd build.tests
CFLAGS="-DNDEBUG ${CFLAGS/ -pipe / }" \
CXXFLAGS="-DNDEBUG ${CXXFLAGS/ -pipe / }" cmake ..
make $makejobs
}
do_check() {
make $makejobs -C build.tests check
}
post_install() {
vlicense LICENSE
# Copy the man page, but make it section 7
_manpage=docs/.build/man/pybind11.1
vsed -i ${_manpage} -e '/^\.TH/ s/"1"/"7"/'
vman ${_manpage} pybind11.7
}