Gentoo Archives: gentoo-commits

From: Bernd Waibel <waebbl@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-util/pybind11/
Date: Mon, 22 Apr 2019 10:49:11
Message-Id: 1555925857.a3a57530854f61379e2c724ba75010a29c54ad35.waebbl@gentoo
1 commit: a3a57530854f61379e2c724ba75010a29c54ad35
2 Author: Bernd Waibel <waebbl <AT> gmail <DOT> com>
3 AuthorDate: Mon Apr 22 09:37:37 2019 +0000
4 Commit: Bernd Waibel <waebbl <AT> gmail <DOT> com>
5 CommitDate: Mon Apr 22 09:37:37 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=a3a57530
7
8 dev-util/pybind11: new package
9
10 Bidirectional library for C++11 and Python bindings
11
12 Package-Manager: Portage-2.3.62, Repoman-2.3.12
13 Signed-off-by: Bernd Waibel <waebbl <AT> gmail.com>
14
15 dev-util/pybind11/Manifest | 1 +
16 dev-util/pybind11/metadata.xml | 12 +++++
17 dev-util/pybind11/pybind11-2.2.4.ebuild | 94 +++++++++++++++++++++++++++++++++
18 3 files changed, 107 insertions(+)
19
20 diff --git a/dev-util/pybind11/Manifest b/dev-util/pybind11/Manifest
21 new file mode 100644
22 index 0000000..5a4fe9b
23 --- /dev/null
24 +++ b/dev-util/pybind11/Manifest
25 @@ -0,0 +1 @@
26 +DIST pybind11-2.2.4.tar.gz 548404 BLAKE2B b56230b5a4c0f392b714ead40d414a8b587396dbeec4089f5b77141cc7c2caf135f17f680b653d2e5be8b60a19a48a716fe8e562f337650fdac76461fb982aee SHA512 6bddf5c885ff92a3e373bcedc6574dfefe8be9ebb6176c6c96d475457466c76bfb982c6df4066cb0fbead4b867f87dbc4fbc1605c80852635016f614330ce041
27
28 diff --git a/dev-util/pybind11/metadata.xml b/dev-util/pybind11/metadata.xml
29 new file mode 100644
30 index 0000000..e757cfb
31 --- /dev/null
32 +++ b/dev-util/pybind11/metadata.xml
33 @@ -0,0 +1,12 @@
34 +<?xml version="1.0" encoding="UTF-8"?>
35 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
36 +<pkgmetadata>
37 +<maintainer type="person">
38 + <email>waebbl@×××××.com</email>
39 + <name>Bernd Waibel</name>
40 +</maintainer>
41 +<longdescription>
42 + Lightweight header-only library that exposes C++ types in Python and
43 + vice versa, mainly to create Python bindings of existing C++ code.
44 +</longdescription>
45 +</pkgmetadata>
46
47 diff --git a/dev-util/pybind11/pybind11-2.2.4.ebuild b/dev-util/pybind11/pybind11-2.2.4.ebuild
48 new file mode 100644
49 index 0000000..81fe08d
50 --- /dev/null
51 +++ b/dev-util/pybind11/pybind11-2.2.4.ebuild
52 @@ -0,0 +1,94 @@
53 +# Copyright 1999-2019 Gentoo Authors
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI=7
57 +
58 +# according to upstream is compatible with 2.7 and 3.x
59 +# 3.7 not added due to some dependencies not yet supporting it
60 +PYTHON_COMPAT=( python{2_7,3_{5,6}} )
61 +
62 +inherit cmake-utils python-single-r1
63 +
64 +DESCRIPTION="Seamless operability between C++11 and Python"
65 +HOMEPAGE="https://pybind11.readthedocs.io/en/stable/"
66 +SRC_URI="https://github.com/pybind/pybind11/archive/v${PV}.tar.gz -> ${P}.tar.gz"
67 +LICENSE="BSD"
68 +
69 +SLOT="0"
70 +KEYWORDS="~amd64 ~x86"
71 +
72 +IUSE="doc test"
73 +
74 +RESTRICT="!test? ( test )"
75 +
76 +DEPEND="
77 + ${PYTHON_DEP}
78 + doc? (
79 + dev-python/breathe[${PYTHON_USEDEP}]
80 + dev-python/sphinx[${PYTHON_USEDEP}]
81 + )
82 + test? (
83 + dev-cpp/catch
84 + dev-libs/boost[python,${PYTHON_USEDEP}]
85 + dev-python/numpy[${PYTHON_USEDEP}]
86 + dev-python/pytest[${PYTHON_USEDEP}]
87 + sci-libs/scipy[${PYTHON_USEDEP}]
88 + )
89 +"
90 +
91 +RDEPEND="
92 + ${PYTHON_DEP}
93 + dev-cpp/eigen
94 + sys-apps/texinfo
95 + sys-devel/gettext[cxx]
96 + virtual/man
97 +"
98 +
99 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
100 +
101 +DOCS=( README.md CONTRIBUTING.md ISSUE_TEMPLATE.md )
102 +
103 +pkg_setup() {
104 + python-single-r1_pkg_setup
105 +}
106 +
107 +src_configure() {
108 + mycmakeargs=(
109 + -DPYBIND11_INSTALL=ON
110 + -DPYBIND11_TEST=$(usex test)
111 + )
112 +
113 + cmake-utils_src_configure
114 +}
115 +
116 +src_compile() {
117 + cmake-utils_src_compile
118 +
119 + # documentation is not covered by cmake, but has it's own makefile
120 + # using sphinx
121 + if use doc; then
122 + pushd "${S}"/docs || die
123 + emake info man html
124 + popd || die
125 + fi
126 +}
127 +
128 +src_test() {
129 + cmake-utils_src_test
130 + pushd "${BUILD_DIR}" || die
131 + emake check
132 + popd || die
133 +}
134 +
135 +src_install() {
136 + cmake-utils_src_install
137 +
138 + if use doc; then
139 + local HTML_DOCS=( "${S}"/docs/.build/html/. )
140 + einstalldocs
141 +
142 + # install man and info pages
143 + doman "${S}"/docs/.build/man/pybind11.1
144 + doinfo "${S}"/docs/.build/texinfo/pybind11.info
145 + fi
146 +}