commit:     a197fa798970b37e4adfca9fbe6a7303f47b47d6
Author:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sun Feb 18 14:34:19 2024 +0000
Commit:     Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sun Feb 18 14:34:50 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a197fa79

sci-libs/onnx: fix build on musl

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

 sci-libs/onnx/files/onnx-1.14.1-musl.patch | 11 +++++++++++
 sci-libs/onnx/onnx-1.14.1-r2.ebuild        |  5 ++++-
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/sci-libs/onnx/files/onnx-1.14.1-musl.patch 
b/sci-libs/onnx/files/onnx-1.14.1-musl.patch
new file mode 100644
index 000000000000..04748ed67e6a
--- /dev/null
+++ b/sci-libs/onnx/files/onnx-1.14.1-musl.patch
@@ -0,0 +1,11 @@
+--- a/onnx/checker.cc  2024-02-18 15:30:03.316320035 +0100
++++ b/onnx/checker.cc  2024-02-18 15:31:05.715473732 +0100
+@@ -184,7 +184,7 @@
+         }
+         std::string data_path = path_join(ctx.get_model_dir(), relative_path);
+         // use stat64 to check whether the file exists
+-#if defined(__APPLE__) || defined(__wasm__)
++#if defined(__APPLE__) || defined(__wasm__) || !defined(__GLIBC__)
+         struct stat buffer; // APPLE does not have stat64
+         if (stat((data_path).c_str(), &buffer) != 0) {
+ #else

diff --git a/sci-libs/onnx/onnx-1.14.1-r2.ebuild 
b/sci-libs/onnx/onnx-1.14.1-r2.ebuild
index 9a6ffb11f82d..e6ecbfd239bc 100644
--- a/sci-libs/onnx/onnx-1.14.1-r2.ebuild
+++ b/sci-libs/onnx/onnx-1.14.1-r2.ebuild
@@ -34,7 +34,10 @@ BDEPEND="python? (
        ${DISTUTILS_DEPS}
 )"
 
-PATCHES=( "${FILESDIR}"/${PN}-1.14.0-cxx_14.patch )
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.14.0-cxx_14.patch
+       "${FILESDIR}"/${P}-musl.patch
+)
 
 src_prepare() {
        cmake_src_prepare

Reply via email to