forked from pool/protobuf
Accepting request 1084558 from system:homeautomation:home-assistant:unstable
- update to v22.3 - python sub packages version is set 4.22.3 as defined in python/google/protobuf/__init__.py to stay compatible - skip python2 builds by default - 10355.patch got merged upstream - add-missing-stdint-header.patch added for compile fixes OBS-URL: https://build.opensuse.org/request/show/1084558 OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/protobuf?expand=0&rev=146
This commit is contained in:
committed by
Git OBS Bridge
parent
dbb3b2b277
commit
10972090a8
85
10355.patch
85
10355.patch
@@ -1,85 +0,0 @@
|
||||
From 15daef3b7912b9434955a8614e018de00591aefb Mon Sep 17 00:00:00 2001
|
||||
From: Deanna Garcia <deannagarcia@google.com>
|
||||
Date: Wed, 3 Aug 2022 17:40:03 +0000
|
||||
Subject: [PATCH 1/2] Use release version instead of libtool version
|
||||
|
||||
---
|
||||
src/Makefile.am | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: protobuf-21.12/src/Makefile.am
|
||||
===================================================================
|
||||
--- protobuf-21.12.orig/src/Makefile.am
|
||||
+++ protobuf-21.12/src/Makefile.am
|
||||
@@ -18,7 +18,7 @@ else
|
||||
PTHREAD_DEF =
|
||||
endif
|
||||
|
||||
-PROTOBUF_VERSION = 32:12:0
|
||||
+PROTOBUF_VERSION = 3.21.12
|
||||
|
||||
if GCC
|
||||
# Turn on all warnings except for sign comparison (we ignore sign comparison
|
||||
@@ -188,7 +188,7 @@ nobase_include_HEADERS =
|
||||
lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
|
||||
|
||||
libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS)
|
||||
-libprotobuf_lite_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
|
||||
+libprotobuf_lite_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
|
||||
if HAVE_LD_VERSION_SCRIPT
|
||||
libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map
|
||||
EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map
|
||||
@@ -235,7 +235,7 @@ libprotobuf_lite_la_SOURCES =
|
||||
google/protobuf/wire_format_lite.cc
|
||||
|
||||
libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS)
|
||||
-libprotobuf_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
|
||||
+libprotobuf_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
|
||||
if HAVE_LD_VERSION_SCRIPT
|
||||
libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
|
||||
EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map
|
||||
@@ -320,7 +320,7 @@ libprotobuf_la_SOURCES =
|
||||
nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES)
|
||||
|
||||
libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
|
||||
-libprotoc_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
|
||||
+libprotoc_la_LDFLAGS = -release $(PROTOBUF_VERSION) -export-dynamic -no-undefined
|
||||
if HAVE_LD_VERSION_SCRIPT
|
||||
libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
|
||||
EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
|
||||
Index: protobuf-21.12/cmake/libprotobuf-lite.cmake
|
||||
===================================================================
|
||||
--- protobuf-21.12.orig/cmake/libprotobuf-lite.cmake
|
||||
+++ protobuf-21.12/cmake/libprotobuf-lite.cmake
|
||||
@@ -112,7 +112,6 @@ if(protobuf_BUILD_SHARED_LIBS)
|
||||
endif()
|
||||
set_target_properties(libprotobuf-lite PROPERTIES
|
||||
VERSION ${protobuf_VERSION}
|
||||
- SOVERSION 32
|
||||
OUTPUT_NAME ${LIB_PREFIX}protobuf-lite
|
||||
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
|
||||
add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite)
|
||||
Index: protobuf-21.12/cmake/libprotobuf.cmake
|
||||
===================================================================
|
||||
--- protobuf-21.12.orig/cmake/libprotobuf.cmake
|
||||
+++ protobuf-21.12/cmake/libprotobuf.cmake
|
||||
@@ -128,7 +128,6 @@ if(protobuf_BUILD_SHARED_LIBS)
|
||||
endif()
|
||||
set_target_properties(libprotobuf PROPERTIES
|
||||
VERSION ${protobuf_VERSION}
|
||||
- SOVERSION 32
|
||||
OUTPUT_NAME ${LIB_PREFIX}protobuf
|
||||
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
|
||||
add_library(protobuf::libprotobuf ALIAS libprotobuf)
|
||||
Index: protobuf-21.12/cmake/libprotoc.cmake
|
||||
===================================================================
|
||||
--- protobuf-21.12.orig/cmake/libprotoc.cmake
|
||||
+++ protobuf-21.12/cmake/libprotoc.cmake
|
||||
@@ -130,7 +130,6 @@ endif()
|
||||
set_target_properties(libprotoc PROPERTIES
|
||||
COMPILE_DEFINITIONS LIBPROTOC_EXPORTS
|
||||
VERSION ${protobuf_VERSION}
|
||||
- SOVERSION 32
|
||||
OUTPUT_NAME ${LIB_PREFIX}protoc
|
||||
DEBUG_POSTFIX "${protobuf_DEBUG_POSTFIX}")
|
||||
add_library(protobuf::libprotoc ALIAS libprotoc)
|
11
add-missing-stdint-header.patch
Normal file
11
add-missing-stdint-header.patch
Normal file
@@ -0,0 +1,11 @@
|
||||
--- a/src/google/protobuf/port.h.orig 2023-04-24 14:27:40.734888878 +0200
|
||||
+++ b/src/google/protobuf/port.h 2023-04-24 14:27:53.607255222 +0200
|
||||
@@ -33,6 +33,8 @@
|
||||
// port_def.inc and port_undef.inc so they are not visible from outside of
|
||||
// protobuf.
|
||||
|
||||
+#include <stdint.h>
|
||||
+
|
||||
#ifndef GOOGLE_PROTOBUF_PORT_H__
|
||||
#define GOOGLE_PROTOBUF_PORT_H__
|
||||
|
@@ -1,3 +1,3 @@
|
||||
libprotobuf3_21_12
|
||||
libprotoc3_21_12
|
||||
libprotobuf-lite3_21_12
|
||||
libprotobuf22_3_0
|
||||
libprotoc22_3_0
|
||||
libprotobuf-lite22_3_0
|
||||
|
@@ -1,16 +1,17 @@
|
||||
Index: protobuf-21.4/src/google/protobuf/port_def.inc
|
||||
Index: protobuf-22.3/src/google/protobuf/port_def.inc
|
||||
===================================================================
|
||||
--- protobuf-21.4.orig/src/google/protobuf/port_def.inc
|
||||
+++ protobuf-21.4/src/google/protobuf/port_def.inc
|
||||
@@ -652,7 +652,11 @@
|
||||
#define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
|
||||
#define PROTOBUF_CONSTEXPR constexpr
|
||||
#elif PROTOBUF_GNUC_MIN(12, 2)
|
||||
--- protobuf-22.3.orig/src/google/protobuf/port_def.inc
|
||||
+++ protobuf-22.3/src/google/protobuf/port_def.inc
|
||||
@@ -708,7 +708,11 @@ static_assert(PROTOBUF_CPLUSPLUS_MIN(201
|
||||
# define PROTOBUF_CONSTINIT [[clang::require_constant_initialization]]
|
||||
# define PROTOBUF_CONSTEXPR constexpr
|
||||
# elif PROTOBUF_GNUC_MIN(12, 2)
|
||||
-# define PROTOBUF_CONSTINIT __constinit
|
||||
+#if PROTOBUF_CPLUSPLUS_MIN(201703L)
|
||||
#define PROTOBUF_CONSTINIT __constinit
|
||||
+#define PROTOBUF_CONSTINIT __constinit
|
||||
+#else
|
||||
+#define PROTOBUF_CONSTINIT
|
||||
+#endif
|
||||
#define PROTOBUF_CONSTEXPR constexpr
|
||||
// MSVC 17 currently seems to raise an error about constant-initialized pointers.
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1930
|
||||
# define PROTOBUF_CONSTEXPR constexpr
|
||||
# endif
|
||||
#endif
|
||||
|
BIN
protobuf-21.12.tar.gz
(Stored with Git LFS)
BIN
protobuf-21.12.tar.gz
(Stored with Git LFS)
Binary file not shown.
3
protobuf-22.3.tar.gz
Normal file
3
protobuf-22.3.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:786bf22c8fd3f20b7242df3b9649900714b0ba77b24a4971573088f41dfe9f8a
|
||||
size 4922612
|
@@ -9,6 +9,16 @@ Thu Apr 27 06:59:31 UTC 2023 - Fridrich Strba <fstrba@suse.com>
|
||||
- Make possible to build on older systems, like SLE12 that miss
|
||||
some of the used macros.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 24 12:30:51 UTC 2023 - Adrian Schröter <adrian@suse.de>
|
||||
|
||||
- update to v22.3
|
||||
- python sub packages version is set 4.22.3 as defined in
|
||||
python/google/protobuf/__init__.py to stay compatible
|
||||
- skip python2 builds by default
|
||||
- 10355.patch got merged upstream
|
||||
- add-missing-stdint-header.patch added for compile fixes
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Mar 23 09:01:50 UTC 2023 - Martin Liška <mliska@suse.cz>
|
||||
|
||||
|
@@ -18,17 +18,19 @@
|
||||
|
||||
%{!?make_build:%global make_build make %{?_smp_mflags}}
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%define sover 3_21_12
|
||||
%define sover 22_3_0
|
||||
%define tarname protobuf
|
||||
%define src_install_dir %{_prefix}/src/%{name}
|
||||
%define extra_java_flags -source 7 -target 7
|
||||
# requires gmock, which is not yet in the distribution
|
||||
%bcond_with check
|
||||
%bcond_with python2
|
||||
%bcond_without java
|
||||
%bcond_without python2
|
||||
%bcond_without python3
|
||||
Name: protobuf
|
||||
Version: 21.12
|
||||
Version: 22.3
|
||||
# python module have their own version specified in python/google/protobuf/__init__.py
|
||||
%define pversion 4.22.3
|
||||
Release: 0
|
||||
Summary: Protocol Buffers - Google's data interchange format
|
||||
License: BSD-3-Clause
|
||||
@@ -39,13 +41,13 @@ Source1: manifest.txt.in
|
||||
Source2: baselibs.conf
|
||||
Source1000: %{name}-rpmlintrc
|
||||
Patch0: gcc12-disable-__constinit-with-c++-11.patch
|
||||
# https://github.com/protocolbuffers/protobuf/pull/10355
|
||||
Patch1: 10355.patch
|
||||
Patch1: add-missing-stdint-header.patch
|
||||
BuildRequires: %{python_module abseil}
|
||||
BuildRequires: %{python_module devel}
|
||||
BuildRequires: %{python_module python-dateutil}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: abseil-cpp-devel >= 20230125
|
||||
BuildRequires: cmake
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libtool
|
||||
@@ -129,18 +131,11 @@ RPC protocols and file formats.
|
||||
|
||||
This package contains source code for Protocol Buffers.
|
||||
|
||||
%package -n %{name}-java
|
||||
Summary: Java Bindings for Google Protocol Buffers
|
||||
Group: Development/Libraries/Java
|
||||
Requires: java >= 1.6.0
|
||||
|
||||
%description -n %{name}-java
|
||||
This package contains the Java bindings for Google Protocol Buffers.
|
||||
|
||||
%if 0%{?python_subpackage_only}
|
||||
%package -n python-%{name}
|
||||
Summary: Python Bindings for Google Protocol Buffers
|
||||
Group: Development/Libraries/Python
|
||||
Version: %pversion
|
||||
Requires: python-six >= 1.9
|
||||
|
||||
%description -n python-%{name}
|
||||
@@ -154,6 +149,7 @@ Group: Development/Libraries/Python
|
||||
Provides: python-%{name} = %{version}
|
||||
Obsoletes: python-%{name} < %{version}
|
||||
Requires: python2-six >= 1.9
|
||||
Version: %pversion
|
||||
|
||||
%description -n python2-%{name}
|
||||
This package contains the Python bindings for Google Protocol Buffers.
|
||||
@@ -162,13 +158,22 @@ This package contains the Python bindings for Google Protocol Buffers.
|
||||
Summary: Python3 Bindings for Google Protocol Buffers
|
||||
Group: Development/Libraries/Python
|
||||
Requires: python3-six >= 1.9
|
||||
Version: %pversion
|
||||
|
||||
%description -n python3-%{name}
|
||||
This package contains the Python bindings for Google Protocol Buffers.
|
||||
%endif
|
||||
|
||||
%package -n %{name}-java
|
||||
Summary: Java Bindings for Google Protocol Buffers
|
||||
Group: Development/Libraries/Java
|
||||
Requires: java >= 1.6.0
|
||||
|
||||
%description -n %{name}-java
|
||||
This package contains the Java bindings for Google Protocol Buffers.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n %{tarname}-%{version}
|
||||
%autosetup -p1 -n %{tarname}-%{VERSION}
|
||||
|
||||
# The previous blank line is crucial for older system being able
|
||||
# to use the autosetup macro
|
||||
@@ -184,15 +189,15 @@ sed -i '/google_test_dir/d' python/setup.py
|
||||
sed -i -e '/env python/d' python/google/protobuf/internal/*.py
|
||||
|
||||
%build
|
||||
autoreconf -fvi
|
||||
%configure \
|
||||
--disable-static
|
||||
|
||||
%make_build
|
||||
# tests are not part of offical tar ball
|
||||
%cmake \
|
||||
-Dprotobuf_BUILD_TESTS=OFF \
|
||||
-Dprotobuf_ABSL_PROVIDER=package
|
||||
%cmake_build
|
||||
|
||||
%if %{with java}
|
||||
pushd java
|
||||
../src/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto
|
||||
pushd ../java
|
||||
../build/protoc --java_out=core/src/main/java -I../src ../src/google/protobuf/descriptor.proto
|
||||
mkdir classes
|
||||
javac %{extra_java_flags} -d classes core/src/main/java/com/google/protobuf/*.java
|
||||
sed -e 's/@VERSION@/%{version}/' < %{SOURCE1} > manifest.txt
|
||||
@@ -200,7 +205,8 @@ jar cfm %{name}-java-%{version}.jar manifest.txt -C classes com
|
||||
popd
|
||||
%endif
|
||||
|
||||
pushd python
|
||||
pushd ../python
|
||||
export PROTOC=../build/protoc
|
||||
%python_build
|
||||
popd
|
||||
|
||||
@@ -210,10 +216,11 @@ popd
|
||||
%endif
|
||||
|
||||
%install
|
||||
%make_install
|
||||
%cmake_install
|
||||
install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto.vim
|
||||
# no need for that
|
||||
find %{buildroot} -type f -name "*.la" -delete -print
|
||||
rm %{buildroot}%_libdir/libutf8_*.a
|
||||
|
||||
%if %{with java}
|
||||
pushd java
|
||||
@@ -229,6 +236,7 @@ popd
|
||||
%endif
|
||||
|
||||
pushd python
|
||||
export PROTOC=../build/protoc
|
||||
%python_install
|
||||
popd
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
@@ -261,18 +269,21 @@ find %{buildroot}%{src_install_dir} -type f -name ".gitignore" -exec rm -f "{}"
|
||||
|
||||
%files -n libprotobuf%{sover}
|
||||
%license LICENSE
|
||||
%{_libdir}/libprotobuf-3.%{version}.so
|
||||
%{_libdir}/libprotobuf.so.*
|
||||
|
||||
%files -n libprotoc%{sover}
|
||||
%{_libdir}/libprotoc-3.%{version}.so
|
||||
%{_libdir}/libprotoc.so.*
|
||||
|
||||
%files -n libprotobuf-lite%{sover}
|
||||
%{_libdir}/libprotobuf-lite-3.%{version}.so
|
||||
%{_libdir}/libprotobuf-lite.so.*
|
||||
|
||||
%files devel
|
||||
%doc CHANGES.txt CONTRIBUTORS.txt README.md
|
||||
%{_bindir}/protoc
|
||||
%doc CONTRIBUTORS.txt README.md
|
||||
%{_bindir}/protoc*
|
||||
%{_includedir}/google
|
||||
%{_includedir}/*.h
|
||||
%{_libdir}/cmake/protobuf
|
||||
%{_libdir}/cmake/utf8_range
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_libdir}/libprotobuf-lite.so
|
||||
%{_libdir}/libprotobuf.so
|
||||
|
Reference in New Issue
Block a user