extra/pybind11 to 2.11.0-1

This commit is contained in:
Kevin Mihelich 2023-07-16 14:51:54 +00:00
parent e9446906a6
commit b1a9bee4bd
2 changed files with 28 additions and 13 deletions

View file

@ -0,0 +1,9 @@
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,5 +1,5 @@
[build-system]
-requires = ["setuptools>=42", "cmake>=3.18", "ninja"]
+requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta"

View file

@ -6,45 +6,51 @@
# - disable lto via -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF # - disable lto via -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF
pkgname=pybind11 pkgname=pybind11
pkgver=2.10.4 pkgver=2.11.0
pkgrel=3 pkgrel=1
pkgdesc='A lightweight header-only library that exposes C++ types in Python and vice versa' pkgdesc='A lightweight header-only library that exposes C++ types in Python and vice versa'
arch=('any') arch=('any')
url='https://pybind11.readthedocs.org/' url='https://pybind11.readthedocs.org/'
license=('BSD') license=('BSD')
optdepends=('python-setuptools: for python bindings') optdepends=('python-setuptools: for python bindings')
makedepends=('cmake' 'boost' 'catch2' 'eigen' 'python-setuptools' 'python-pytest') makedepends=('cmake' 'boost' 'catch2' 'eigen' 'python-build' 'python-installer'
'python-setuptools' 'python-pytest' 'python-wheel')
#'python-sphinx' 'python-sphinx_rtd_theme' 'python-breathe') #'python-sphinx' 'python-sphinx_rtd_theme' 'python-breathe')
checkdepends=('python-numpy' 'python-scipy') checkdepends=('python-numpy' 'python-scipy')
source=("https://github.com/pybind/pybind11/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz") source=("https://github.com/pybind/pybind11/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz"
sha256sums=('832e2f309c57da9c1e6d4542dedd34b24e4192ecb4d62f6f4866a737454c9970') '010-pybind11-remove-unwanted-pip-build-deps.patch')
sha256sums=('7af30a84c6810e721829c4646e31927af9d8861e085aa5dd37c3c8b8169fcda1'
'27f13a9b32ef344223d70f7340cc32d181ed1de0beb9ce8b6779271f7abd15c9')
prepare() {
patch -d "${pkgname}-${pkgver}" -Np1 -i "${srcdir}/010-pybind11-remove-unwanted-pip-build-deps.patch"
}
build () { build () {
cd "${pkgname}-${pkgver}" cd "${pkgname}-${pkgver}"
python setup.py build python -m build --wheel --no-isolation
# tests # tests
cmake \ cmake \
-B "${srcdir}/build-cmake" \
-S "${srcdir}/${pkgname}-${pkgver}" \
-G 'Unix Makefiles' \ -G 'Unix Makefiles' \
-B "${srcdir}/build-tests" \
-S "${srcdir}/${pkgname}-${pkgver}" \
-DCMAKE_BUILD_TYPE:STRING='None' \ -DCMAKE_BUILD_TYPE:STRING='None' \
-DCMAKE_INSTALL_PREFIX:PATH='/usr' \ -DCMAKE_INSTALL_PREFIX:PATH='/usr' \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \ -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=OFF \
-Wno-dev -Wno-dev
make -C "${srcdir}/build-cmake" all mock_install cmake --build "${srcdir}/build-tests"
# manpage (needs python-sphinxcontrib-{moderncmakedomain,svg2pdfconverter}) # manpage (needs python-sphinxcontrib-{moderncmakedomain,svg2pdfconverter})
# make -C "${srcdir}/${pkgname}-${pkgver}/docs" man # make -C "${srcdir}/${pkgname}-${pkgver}/docs" man
} }
check() { check() {
make -C build-cmake check make -C build-tests check
} }
package() { package() {
cd "${pkgname}-${pkgver}" python -m installer --destdir="$pkgdir" "${pkgname}-${pkgver}/dist"/*.whl
python setup.py install --root="$pkgdir" --skip-build --optimize='1'
# symlinks # symlinks
local _pyver local _pyver
@ -59,5 +65,5 @@ package() {
# sed -i '/^\.TH/s/"1"/"7"/' "${pkgdir}/usr/share/man/man7/${pkgname}.7" # sed -i '/^\.TH/s/"1"/"7"/' "${pkgdir}/usr/share/man/man7/${pkgname}.7"
# license # license
install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}" install -D -m644 "${pkgname}-${pkgver}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
} }