public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Alejandro Alvarez Ayllon <a.alvarezayllon@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/onnx] test-1.21.0: Need to patch the generated headers, ship .proto
Date: Mon, 08 Jun 2026 15:18:15 GMT	[thread overview]
Message-ID: <178093189511.1.6369395048065201316.rpms-onnx-47bcf8adc17c@fedoraproject.org> (raw)

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
 

                 reply	other threads:[~2026-06-08 15:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178093189511.1.6369395048065201316.rpms-onnx-47bcf8adc17c@fedoraproject.org \
    --to=a.alvarezayllon@gmail.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox