SHA256
1
0
forked from pool/python-onnx

- Add patch to fix build with new protobuf:

* protobuf.patch

OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/python-onnx?expand=0&rev=13
This commit is contained in:
Tomáš Chvátal
2020-03-15 08:59:16 +00:00
committed by Git OBS Bridge
parent 067eb5f36a
commit 1b5aaa13a8
3 changed files with 30 additions and 0 deletions

22
protobuf.patch Normal file
View File

@@ -0,0 +1,22 @@
From 7bcb1302352c9953bfc396c3ec2114b382c65614 Mon Sep 17 00:00:00 2001
From: Tongliang Liao <xkszltl@gmail.com>
Date: Fri, 29 Nov 2019 19:48:59 -0800
Subject: [PATCH] python_out does not recognize dllexport_decl.
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7ab64fdda..bf23ac75fe 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -238,7 +238,7 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP NAME SRCS HDRS ROOT_DIR DEPEND)
${ONNX_DLLEXPORT_STR}${CMAKE_CURRENT_BINARY_DIR})
if(BUILD_ONNX_PYTHON)
list(APPEND PROTOC_ARGS --python_out
- ${ONNX_DLLEXPORT_STR}${CMAKE_CURRENT_BINARY_DIR})
+ ${CMAKE_CURRENT_BINARY_DIR})
if(ONNX_GEN_PB_TYPE_STUBS)
# Haven't figured out how to generate mypy stubs on Windows yet
if(NOT WIN32)

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Mar 15 08:55:22 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>
- Add patch to fix build with new protobuf:
* protobuf.patch
-------------------------------------------------------------------
Tue Feb 25 13:57:48 UTC 2020 - Tomáš Chvátal <tchvatal@suse.com>

View File

@@ -26,6 +26,7 @@ License: MIT
URL: https://onnx.ai/
Source0: https://github.com/onnx/onnx/archive/v%{version}.tar.gz#/onnx-%{version}.tar.gz
Source1: %{name}-rpmlintrc
Patch0: protobuf.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy}
BuildRequires: %{python_module protobuf}
@@ -60,6 +61,7 @@ The headers and other files needed for the development.
%setup -q -n onnx-%{version}
# avoid bundles
rm -rf third_party
%patch0 -p1
# say that the cmake was already built (we used our macros)
sed -i -e 's:built = False:built = True:g' setup.py
# do not require extra pytest modules