commit:     78812ee4feafba07e463e940b72255c508d1dfd8
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Mon May 16 13:13:49 2022 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Mon May 16 13:13:49 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=78812ee4

dev-libs/FP16: add PeachPy depend

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 ...2021.03.20.ebuild => FP16-2021.03.20-r1.ebuild} | 23 ++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/dev-libs/FP16/FP16-2021.03.20.ebuild 
b/dev-libs/FP16/FP16-2021.03.20-r1.ebuild
similarity index 63%
rename from dev-libs/FP16/FP16-2021.03.20.ebuild
rename to dev-libs/FP16/FP16-2021.03.20-r1.ebuild
index 160c3c91f429..4fb39fced810 100644
--- a/dev-libs/FP16/FP16-2021.03.20.ebuild
+++ b/dev-libs/FP16/FP16-2021.03.20-r1.ebuild
@@ -2,9 +2,11 @@
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
-inherit cmake
+PYTHON_COMPAT=( python3_{8,9,10,11} )
+inherit python-r1 cmake
 
 CommitId=0a92994d729ff76a58f692d3028ca1b64b145d91
+
 DESCRIPTION="conversion to/from half-precision floating point formats"
 HOMEPAGE="https://github.com/Maratyszcza/FP16/";
 SRC_URI="https://github.com/Maratyszcza/${PN}/archive/${CommitId}.tar.gz
@@ -14,9 +16,10 @@ LICENSE="MIT"
 SLOT="0"
 KEYWORDS="~amd64"
 IUSE="test"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
 DEPEND="dev-libs/psimd"
-RDEPEND="${DEPEND}"
+RDEPEND="${DEPEND} ${PYTHON_DEPS}"
 BDEPEND="test? ( dev-cpp/gtest )"
 RESTRICT="!test? ( test )"
 
@@ -26,6 +29,12 @@ PATCHES=(
        "${FILESDIR}"/${P}-gentoo.patch
 )
 
+src_prepare() {
+       cmake_src_prepare
+       mkdir -p module/fp16 || die
+       cp include/fp16/*py module/fp16 || die
+}
+
 src_configure() {
        local mycmakeargs=(
                -DFP16_BUILD_BENCHMARKS=OFF
@@ -33,3 +42,13 @@ src_configure() {
        )
        cmake_src_configure
 }
+
+python_install() {
+       python_domodule module/fp16
+}
+
+src_install() {
+       cmake_src_install
+       rm "${D}"/usr/include/fp16/*.py || die
+       python_foreach_impl python_install
+}

Reply via email to