Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pybind11/
Date: Mon, 16 May 2022 16:05:09
Message-Id: 1652717099.e7ff8dd75b227145260eeb8d60139d8338019a5d.mgorny@gentoo
1 commit: e7ff8dd75b227145260eeb8d60139d8338019a5d
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 16 15:53:31 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Mon May 16 16:04:59 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7ff8dd7
7
8 dev-python/pybind11: Use PEP517 build
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/pybind11/pybind11-2.9.2-r1.ebuild | 67 ++++++++++++++++++++++++++++
13 1 file changed, 67 insertions(+)
14
15 diff --git a/dev-python/pybind11/pybind11-2.9.2-r1.ebuild b/dev-python/pybind11/pybind11-2.9.2-r1.ebuild
16 new file mode 100644
17 index 000000000000..669e930dee0a
18 --- /dev/null
19 +++ b/dev-python/pybind11/pybind11-2.9.2-r1.ebuild
20 @@ -0,0 +1,67 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +DISTUTILS_USE_PEP517=setuptools
27 +PYTHON_COMPAT=( python3_{8..10} )
28 +
29 +inherit cmake distutils-r1
30 +
31 +DESCRIPTION="AST-based Python refactoring library"
32 +HOMEPAGE="
33 + https://pybind11.readthedocs.io/en/stable/
34 + https://github.com/pybind/pybind11/
35 + https://pypi.org/project/pybind11/
36 +"
37 +SRC_URI="
38 + https://github.com/pybind/pybind11/archive/v${PV}.tar.gz
39 + -> ${P}.tar.gz
40 +"
41 +
42 +LICENSE="BSD"
43 +SLOT="0"
44 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
45 +
46 +RDEPEND="
47 + dev-cpp/eigen:3
48 +"
49 +BDEPEND="
50 + test? (
51 + >=dev-cpp/catch-2.13.5
52 + >=dev-libs/boost-1.56
53 + )
54 +"
55 +
56 +distutils_enable_tests pytest
57 +
58 +python_prepare_all() {
59 + export PYBIND11_USE_CMAKE=1
60 + cmake_src_prepare
61 + distutils-r1_python_prepare_all
62 +}
63 +
64 +python_configure() {
65 + local mycmakeargs=(
66 + # disable forced lto
67 + -DPYBIND11_LTO_CXX_FLAGS=
68 + -DPYBIND11_INSTALL=ON
69 + -DPYBIND11_TEST=$(usex test)
70 + )
71 + cmake_src_configure
72 +}
73 +
74 +python_compile() {
75 + distutils-r1_python_compile
76 + # Compilation only does anything for tests
77 + use test && cmake_src_compile
78 +}
79 +
80 +python_test() {
81 + cmake_build check
82 +}
83 +
84 +python_install() {
85 + distutils-r1_python_install
86 + cmake_src_install
87 +}