commit:     97b5995ec2f8453c145e5080beeb69f85685e284
Author:     Pavel Sobolev <contact <AT> paveloom <DOT> dev>
AuthorDate: Sat Dec  6 14:00:05 2025 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Tue Dec  9 20:42:42 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97b5995e

sci-ml/onnx: add 1.20.0

Signed-off-by: Pavel Sobolev <contact <AT> paveloom.dev>
Part-of: https://github.com/gentoo/gentoo/pull/44926
Closes: https://github.com/gentoo/gentoo/pull/44926
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>

 sci-ml/onnx/Manifest                               |  1 +
 ...1.20.0-don-t-hide-symbols-in-object-files.patch | 16 ++++++
 sci-ml/onnx/onnx-1.20.0.ebuild                     | 67 ++++++++++++++++++++++
 3 files changed, 84 insertions(+)

diff --git a/sci-ml/onnx/Manifest b/sci-ml/onnx/Manifest
index 63363dcfb2f4..34bfa9cc9073 100644
--- a/sci-ml/onnx/Manifest
+++ b/sci-ml/onnx/Manifest
@@ -1,2 +1,3 @@
 DIST onnx-1.17.0.tar.gz 12475304 BLAKE2B 
17e3cdd4bf101749ba841599d1b4e89ad80cfa3de6adabc10491f84ec928c385b1fe517e32657b24ca57d14780d51cc9a641860c06194cec082d9a9950004c8c
 SHA512 
5a18e2b19ec9c18c8b115fb7e12ed98eddaa581c95f15c4dd420cd6c86e7caa04f9a393da589e76b89cf9b3544abd3749a8c77c2446782f37502eb74e9b1f661
 DIST onnx-1.18.0.tar.gz 12826788 BLAKE2B 
7b48cf4017816c4ba926cc4bfcaf3b95d4630421e71e70f3f5ce47f2a9e152e1fa26ca1b407a198216fe777daf014546e35ce7ab06f47ddcebb5d71ee79e834c
 SHA512 
2f38664947c8d1efc40620a7c1b1953d2aa4b0a37b67c4886b86e77c1d697363c26413413ddda8eabc545892fb1bcb43afc7e93e62f0901527524a2727e1ea8d
+DIST onnx-1.20.0.tar.gz 13187591 BLAKE2B 
b7ecbb2c52fe7227b665fa2933c252aa662d9394ab75fc741f1f8097177d53f6763f075c0855c19f8e57eeffae4020808c4d8b8ff2cc241bc76993ee4434037d
 SHA512 
7b59ca1a42d3ca177a75e78d913c9fc4f6b80f167496b9416932289750f46c6999b02f4270fe7701917a494306bd84148f6d9d6cdaa0ca4f068d994ddd3076ab

diff --git 
a/sci-ml/onnx/files/onnx-1.20.0-don-t-hide-symbols-in-object-files.patch 
b/sci-ml/onnx/files/onnx-1.20.0-don-t-hide-symbols-in-object-files.patch
new file mode 100644
index 000000000000..d51360484b48
--- /dev/null
+++ b/sci-ml/onnx/files/onnx-1.20.0-don-t-hide-symbols-in-object-files.patch
@@ -0,0 +1,16 @@
+From: Pavel Sobolev <[email protected]>
+Subject: [PATCH] Don't hide symbols in object files.
+
+Signed-off-by: Pavel Sobolev <[email protected]>
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -443,7 +443,6 @@ add_library(onnx_object OBJECT ${ONNX_SRCS})
+ add_dependencies(onnx_object onnx_proto_object)
+ target_include_directories(onnx_object PUBLIC
+   $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>)
+-set_target_properties(onnx_object PROPERTIES CXX_VISIBILITY_PRESET hidden)
+ set_target_properties(onnx_object PROPERTIES VISIBILITY_INLINES_HIDDEN ON)
+ target_include_directories(onnx_object PUBLIC $<BUILD_INTERFACE:${ONNX_ROOT}>)
+ add_onnx_global_defines(onnx_object)
+

diff --git a/sci-ml/onnx/onnx-1.20.0.ebuild b/sci-ml/onnx/onnx-1.20.0.ebuild
new file mode 100644
index 000000000000..3f2d90b2229e
--- /dev/null
+++ b/sci-ml/onnx/onnx-1.20.0.ebuild
@@ -0,0 +1,67 @@
+# Copyright 2022-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+DISTUTILS_UPSTREAM_PEP517=standalone
+DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_EXT=1
+PYTHON_COMPAT=( python3_{11..14} )
+inherit distutils-r1 cmake
+
+DESCRIPTION="Open Neural Network Exchange (ONNX)"
+HOMEPAGE="https://github.com/onnx/onnx";
+SRC_URI="https://github.com/onnx/${PN}/archive/refs/tags/v${PV}.tar.gz
+       -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+IUSE="disableStaticReg"
+RESTRICT="test"
+
+RDEPEND="
+       dev-cpp/abseil-cpp:=
+       dev-libs/protobuf:=[protoc(+)]
+       dev-python/ml-dtypes[$PYTHON_USEDEP]
+       dev-python/numpy[${PYTHON_USEDEP}]
+       dev-python/protobuf[${PYTHON_USEDEP}]
+       dev-python/typing-extensions[$PYTHON_USEDEP]
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       dev-python/nanobind[${PYTHON_USEDEP}]
+"
+
+src_prepare() {
+       eapply 
"${FILESDIR}/${PN}-1.20.0-don-t-hide-symbols-in-object-files.patch"
+       cmake_src_prepare
+       distutils-r1_src_prepare
+}
+
+src_configure() {
+       mycmakeargs=(
+               -DONNX_USE_PROTOBUF_SHARED_LIBS=ON
+               -DONNX_USE_LITE_PROTO=ON
+               -DBUILD_SHARED_LIBS=ON
+               -DONNX_DISABLE_STATIC_REGISTRATION=$(usex disableStaticReg ON 
OFF)
+       )
+       cmake_src_configure
+}
+
+python_compile() {
+       local mycmakeargs=(
+               "${mycmakeargs[@]}"
+               -Dnanobind_DIR="$(python_get_sitedir)/nanobind/cmake"
+       )
+       CMAKE_ARGS="${mycmakeargs[@]}" distutils-r1_python_compile
+}
+
+src_compile() {
+       cmake_src_compile
+       distutils-r1_src_compile
+}
+
+src_install() {
+       cmake_src_install
+       distutils-r1_src_install
+}

Reply via email to