* [gentoo-commits] repo/gentoo:master commit in: sci-libs/onnx/files/, sci-libs/onnx/
@ 2024-02-18 14:35 Alfredo Tupone
0 siblings, 0 replies; 2+ messages in thread
From: Alfredo Tupone @ 2024-02-18 14:35 UTC (permalink / raw
To: gentoo-commits
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/onnx/files/, sci-libs/onnx/
@ 2024-05-04 18:24 Alfredo Tupone
0 siblings, 0 replies; 2+ messages in thread
From: Alfredo Tupone @ 2024-05-04 18:24 UTC (permalink / raw
To: gentoo-commits
commit: a3380e05cc3bf05ef227c05c52fe764433e54d8d
Author: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
AuthorDate: Sat May 4 18:18:43 2024 +0000
Commit: Alfredo Tupone <tupone <AT> gentoo <DOT> org>
CommitDate: Sat May 4 18:23:29 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3380e05
sci-libs/onnx: fix unresolved symbol
Signed-off-by: Alfredo Tupone <tupone <AT> gentoo.org>
sci-libs/onnx/files/onnx-1.15.0-hidden.patch | 10 +++++
...onnx-1.15.0-r1.ebuild => onnx-1.15.0-r2.ebuild} | 45 +++++++++++-----------
2 files changed, 32 insertions(+), 23 deletions(-)
diff --git a/sci-libs/onnx/files/onnx-1.15.0-hidden.patch b/sci-libs/onnx/files/onnx-1.15.0-hidden.patch
new file mode 100644
index 000000000000..b500c01a91bc
--- /dev/null
+++ b/sci-libs/onnx/files/onnx-1.15.0-hidden.patch
@@ -0,0 +1,10 @@
+--- a/CMakeLists.txt 2024-05-04 19:39:17.464135798 +0200
++++ b/CMakeLists.txt 2024-05-04 19:39:23.155068064 +0200
+@@ -496,7 +496,6 @@
+ else()
+ # On non-Windows, hide all symbols we don't need
+ set(ONNX_API_DEFINE "-DONNX_API=__attribute__\(\(__visibility__\(\"default\"\)\)\)")
+- set_target_properties(onnx_proto PROPERTIES CXX_VISIBILITY_PRESET hidden)
+ set_target_properties(onnx_proto PROPERTIES VISIBILITY_INLINES_HIDDEN 1)
+ endif()
+ target_compile_definitions(onnx_proto PRIVATE ${ONNX_API_DEFINE})
diff --git a/sci-libs/onnx/onnx-1.15.0-r1.ebuild b/sci-libs/onnx/onnx-1.15.0-r2.ebuild
similarity index 60%
rename from sci-libs/onnx/onnx-1.15.0-r1.ebuild
rename to sci-libs/onnx/onnx-1.15.0-r2.ebuild
index 8e846b3e6d5f..63e8ab1695e9 100644
--- a/sci-libs/onnx/onnx-1.15.0-r1.ebuild
+++ b/sci-libs/onnx/onnx-1.15.0-r2.ebuild
@@ -3,6 +3,7 @@
EAPI=8
DISTUTILS_USE_PEP517=setuptools
+DISTUTILS_OPTIONAL=1
DISTUTILS_EXT=1
PYTHON_COMPAT=( python3_{9..12} )
inherit distutils-r1 cmake
@@ -15,49 +16,47 @@ 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="
- dev-python/protobuf-python[${PYTHON_USEDEP}]
- dev-python/pybind11[${PYTHON_USEDEP}]
+ python? (
+ ${PYTHON_DEPS}
+ dev-python/protobuf-python[${PYTHON_USEDEP}]
+ dev-python/pybind11[${PYTHON_USEDEP}]
+ )
dev-libs/protobuf:=
"
DEPEND="${RDEPEND}"
+BDEPEND="python? (
+ ${DISTUTILS_DEPS}
+)"
+
+PATCHES=( "${FILESDIR}"/${P}-hidden.patch )
+
src_prepare() {
cmake_src_prepare
- distutils-r1_src_prepare
+ use python && distutils-r1_src_prepare
}
-python_configure_all() {
+src_configure() {
mycmakeargs=(
-DONNX_USE_PROTOBUF_SHARED_LIBS=ON
-DONNX_USE_LITE_PROTO=ON
+ -DONNX_BUILD_SHARED_LIBS=ON
)
cmake_src_configure
-}
-
-src_configure() {
- distutils-r1_src_configure
-}
-
-python_compile_all() {
- cmake_src_compile
+ use python && distutils-r1_src_configure
}
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
- distutils-r1_python_install_all
+ cmake_src_compile
+ use python && CMAKE_ARGS="${mycmakeargs[@]}" distutils-r1_src_compile
}
src_install() {
- distutils-r1_src_install
+ cmake_src_install
+ use python && distutils-r1_src_install
}
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-05-04 18:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-18 14:35 [gentoo-commits] repo/gentoo:master commit in: sci-libs/onnx/files/, sci-libs/onnx/ Alfredo Tupone
-- strict thread matches above, loose matches on Subject: below --
2024-05-04 18:24 Alfredo Tupone
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox