public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/onnx] test-1.21.0: Need to patch the generated headers, ship .proto
@ 2026-06-08 15:18 Alejandro Alvarez Ayllon
0 siblings, 0 replies; only message in thread
From: Alejandro Alvarez Ayllon @ 2026-06-08 15:18 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/onnx
Branch : test-1.21.0
Commit : 47bcf8adc17c98de9420cbbdd805bd4a59767b01
Author : Alejandro Alvarez Ayllon <a.alvarezayllon@gmail.com>
Date : 2023-06-07T15:38:27+00:00
Stats : +25/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/onnx/c/47bcf8adc17c98de9420cbbdd805bd4a59767b01?branch=test-1.21.0
Log:
Need to patch the generated headers, ship .proto
---
diff --git a/add-export-protobuf-headers.patch b/add-export-protobuf-headers.patch
new file mode 100644
index 0000000..11ddc89
--- /dev/null
+++ b/add-export-protobuf-headers.patch
@@ -0,0 +1,11 @@
+--- a/onnx/onnx-ml.pb.h 2023-06-07 14:52:21.479754597 +0000
++++ b/onnx/onnx-ml.pb.h 2023-06-07 14:51:49.928137757 +0000
+@@ -167,7 +167,7 @@
+ constexpr AttributeProto_AttributeType AttributeProto_AttributeType_AttributeType_MAX = AttributeProto_AttributeType_TYPE_PROTOS;
+ constexpr int AttributeProto_AttributeType_AttributeType_ARRAYSIZE = AttributeProto_AttributeType_AttributeType_MAX + 1;
+
+-const std::string& AttributeProto_AttributeType_Name(AttributeProto_AttributeType value);
++ONNX_API const std::string& AttributeProto_AttributeType_Name(AttributeProto_AttributeType value);
+ template<typename T>
+ inline const std::string& AttributeProto_AttributeType_Name(T enum_t_value) {
+ static_assert(::std::is_same<T, AttributeProto_AttributeType>::value ||
diff --git a/onnx.spec b/onnx.spec
index 01f6289..f4d57c9 100644
--- a/onnx.spec
+++ b/onnx.spec
@@ -2,12 +2,14 @@
Name: onnx
Version: 1.14.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Open standard for machine learning interoperability
License: Apache-2.0
URL: https://github.com/onnx/onnx
Source0: https://github.com/onnx/onnx/archive/v%{version}/%{name}-%{version}.tar.gz
+# Need to patch the generated headers
+Source1: add-export-protobuf-headers.patch
# Build shared libraries and fix install location
Patch0: onnx-install.patch
# Add what is missing to run tox, disable tests that require network
@@ -67,6 +69,11 @@ Requires: %{name}-libs = %{version}-%{release}
-DPYTHON_EXECUTABLE=%{python3} \
-DPY_EXT_SUFFIX=%{python3_ext_suffix} \
-DPY_SITEARCH=%{python3_sitearch}
+# Generate protobuf header and source files
+%cmake_build -- gen_onnx_proto
+# Add missing ONNX_API
+(cd "%__cmake_builddir"; patch -p1 < "%{_sourcedir}/add-export-protobuf-headers.patch")
+# Build
%cmake_build
%install
@@ -84,6 +91,8 @@ chmod a+x "%{buildroot}/%{python3_sitearch}/%{name}/gen_proto.py"
chmod a+x "%{buildroot}/%{python3_sitearch}/%{name}/defs/gen_doc.py"
%py3_shebang_fix "%{buildroot}/%{python3_sitearch}/%{name}/gen_proto.py"
%py3_shebang_fix "%{buildroot}/%{python3_sitearch}/%{name}/defs/gen_doc.py"
+# Install *.proto files
+install -p "./onnx/"*.proto -t "%{buildroot}/%{_includedir}/onnx/"
%check
export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
@@ -105,6 +114,10 @@ export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}
%{python3_sitearch}/%{name}/
%changelog
+* Wed Jun 07 2023 Alejandro Alvarez Ayllon <a.alvarezayllon@gmail.com> - 1.14.0-2
+- Patch protobuf headers with ONNX_API
+- Ship .proto files
+
* Sat Jun 03 2023 Alejandro Alvarez Ayllon <a.alvarezayllon@gmail.com> - 1.14.0-1
- Release 1.14.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-08 15:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-08 15:18 [rpms/onnx] test-1.21.0: Need to patch the generated headers, ship .proto Alejandro Alvarez Ayllon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox