commit:     31b343d6ff49561e71151fdedd9634385656f764
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Mon Feb 19 21:28:25 2024 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Mon Feb 19 21:29:07 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31b343d6

sci-libs/onnx: always depends on python

Closes: https://bugs.gentoo.org/924937
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 .../{onnx-1.15.0.ebuild => onnx-1.15.0-r1.ebuild}  | 44 ++++++++++++----------
 1 file changed, 24 insertions(+), 20 deletions(-)

diff --git a/sci-libs/onnx/onnx-1.15.0.ebuild 
b/sci-libs/onnx/onnx-1.15.0-r1.ebuild
similarity index 60%
rename from sci-libs/onnx/onnx-1.15.0.ebuild
rename to sci-libs/onnx/onnx-1.15.0-r1.ebuild
index 1e57c8b8213f..8e846b3e6d5f 100644
--- a/sci-libs/onnx/onnx-1.15.0.ebuild
+++ b/sci-libs/onnx/onnx-1.15.0-r1.ebuild
@@ -1,9 +1,8 @@
-# Copyright 2022-2023 Gentoo Authors
+# Copyright 2022-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
 DISTUTILS_USE_PEP517=setuptools
-DISTUTILS_OPTIONAL=1
 DISTUTILS_EXT=1
 PYTHON_COMPAT=( python3_{9..12} )
 inherit distutils-r1 cmake
@@ -16,44 +15,49 @@ 
SRC_URI="https://github.com/onnx/${PN}/archive/refs/tags/v${PV}.tar.gz
 LICENSE="Apache-2.0"
 SLOT="0"
 KEYWORDS="~amd64 ~riscv"
-IUSE="python"
 RESTRICT="test"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
 RDEPEND="
-       python? (
-               ${PYTHON_DEPS}
-               dev-python/protobuf-python[${PYTHON_USEDEP}]
-               dev-python/pybind11[${PYTHON_USEDEP}]
-       )
+       dev-python/protobuf-python[${PYTHON_USEDEP}]
+       dev-python/pybind11[${PYTHON_USEDEP}]
        dev-libs/protobuf:=
 "
 DEPEND="${RDEPEND}"
 
-BDEPEND="python? (
-       ${DISTUTILS_DEPS}
-)"
-
 src_prepare() {
        cmake_src_prepare
-       use python && distutils-r1_src_prepare
+       distutils-r1_src_prepare
 }
 
-src_configure() {
+python_configure_all() {
        mycmakeargs=(
                -DONNX_USE_PROTOBUF_SHARED_LIBS=ON
                -DONNX_USE_LITE_PROTO=ON
        )
        cmake_src_configure
-       use python && distutils-r1_src_configure
 }
 
-src_compile() {
+src_configure() {
+       distutils-r1_src_configure
+}
+
+python_compile_all() {
        cmake_src_compile
-       use python && CMAKE_ARGS="${mycmakeargs[@]}" distutils-r1_src_compile
 }
 
-src_install() {
+src_compile() {
+       mycmakeargs=(
+               -DONNX_USE_PROTOBUF_SHARED_LIBS=ON
+               -DONNX_USE_LITE_PROTO=ON
+       )
+       CMAKE_ARGS="${mycmakeargs[@]}" distutils-r1_src_compile
+}
+
+python_install_all() {
        cmake_src_install
-       use python && distutils-r1_src_install
+       distutils-r1_python_install_all
+}
+
+src_install() {
+       distutils-r1_src_install
 }

Reply via email to