Fix install-check failures by building helper libraries static + split protoc into separate subpackage

OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/protobuf?expand=0&rev=187
This commit is contained in:
2024-10-25 15:06:45 +00:00
committed by Git OBS Bridge
parent 702153286c
commit 4c7c3fcf1d
7 changed files with 73 additions and 6 deletions

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Oct 24 20:56:51 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- C++: split a compiler subpackage from the devel one.
Allows using the protoc compiler without having to install all the
headers and static libraries
- Added patch: static-utf8-ranges.patch
* Build the libutf8_range and libutf8_validity as static library
to avoid installcheck failures
-------------------------------------------------------------------
Wed Oct 23 08:44:06 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@@ -72,7 +72,7 @@ Source3: https://repo1.maven.org/maven2/com/google/protobuf/%{name}-util/
BuildRequires: fdupes
BuildRequires: java-devel >= 1.8
BuildRequires: maven-local
BuildRequires: protobuf-devel >= %{baseversion}
BuildRequires: protobuf-compiler >= %{baseversion}
BuildRequires: mvn(com.google.code.findbugs:jsr305)
BuildRequires: mvn(com.google.code.gson:gson)
BuildRequires: mvn(com.google.errorprone:error_prone_annotations)
@@ -103,7 +103,7 @@ This package contains the runtime for Java bindings.
%package protoc
Summary: Java Bindings for Google Protocol Buffers (maven metadata for protoc)
Requires: %{tarname}-devel >= %{baseversion}
Requires: %{tarname}-compiler >= %{baseversion}
%description protoc
Protocol Buffers are a way of encoding structured data in an efficient yet

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Oct 24 20:56:51 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- C++: split a compiler subpackage from the devel one.
Allows using the protoc compiler without having to install all the
headers and static libraries
- Added patch: static-utf8-ranges.patch
* Build the libutf8_range and libutf8_validity as static library
to avoid installcheck failures
-------------------------------------------------------------------
Wed Oct 23 08:44:06 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@@ -35,6 +35,7 @@ Group: Development/Libraries/C and C++
URL: https://github.com/protocolbuffers/protobuf
Source0: https://github.com/protocolbuffers/protobuf/releases/download/v%{version}/%{tarname}-%{version}.tar.gz
Source1: baselibs.conf
Patch0: static-utf8-ranges.patch
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: gcc%{?with_gcc}-c++
@@ -85,6 +86,19 @@ Protocol Buffers are a way of encoding structured data in an efficient yet
extensible format. Google uses Protocol Buffers for almost all of its internal
RPC protocols and file formats.
%package compiler
Summary: Protocol Buffers compiler
Group: Development/Libraries/C and C++
Conflicts: mvn(com.google.protobuf:protobuf-java) < 4.%{version}
%description compiler
Protocol Buffers are a way of encoding structured data in an efficient yet
extensible format. Google uses Protocol Buffers for almost all of its internal
RPC protocols and file formats.
This package contains Protocol Buffers compiler for all programming
languages
%package -n libprotobuf%{sover}
Summary: Protocol Buffers - Google's data interchange format
Group: System/Libraries
@@ -115,11 +129,11 @@ RPC protocols and file formats.
%package devel
Summary: Header files, libraries and development documentation for %{name}
Group: Development/Libraries/C and C++
Requires: %{name}-compiler = %{version}
Requires: libprotobuf%{sover} = %{version}
Requires: libprotobuf-lite%{sover}
Conflicts: protobuf2-devel
Conflicts: protobuf21-devel
Conflicts: mvn(com.google.protobuf:protobuf-java) < 4.%{version}
Provides: libprotobuf-devel = %{version}
%description devel
@@ -170,6 +184,10 @@ install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto
%ldconfig_scriptlets -n libprotobuf-lite%{sover}
%endif
%files compiler
%{_bindir}/protoc*
%license LICENSE
%files -n libprotobuf%{sover}
%license LICENSE
%{_libdir}/libprotobuf.so.%{version}.0
@@ -185,7 +203,6 @@ install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto
%files devel
%license LICENSE
%doc CONTRIBUTORS.txt README.md
%{_bindir}/protoc*
%{_includedir}/google
%dir %{_includedir}/java
%dir %{_includedir}/java/core
@@ -206,8 +223,8 @@ install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto
%{_libdir}/libprotobuf.so
%{_libdir}/libprotoc.so
%{_libdir}/libupb.a
%{_libdir}/libutf8_range.so
%{_libdir}/libutf8_validity.so
%{_libdir}/libutf8_range.a
%{_libdir}/libutf8_validity.a
%{_datadir}/vim
%changelog

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Thu Oct 24 20:56:51 UTC 2024 - Fridrich Strba <fstrba@suse.com>
- C++: split a compiler subpackage from the devel one.
Allows using the protoc compiler without having to install all the
headers and static libraries
- Added patch: static-utf8-ranges.patch
* Build the libutf8_range and libutf8_validity as static library
to avoid installcheck failures
-------------------------------------------------------------------
Wed Oct 23 08:44:06 UTC 2024 - Fridrich Strba <fstrba@suse.com>

View File

@@ -22,6 +22,8 @@
%if 0%{?gcc_version} < 11
%define with_gcc 11
%endif
%{?!python_module:%define python_module() python3-%{**}}
%define skip_python2 1
%{?sle15_python_module_pythons}
Name: python-protobuf
Version: 5.%{baseversion}

18
static-utf8-ranges.patch Normal file
View File

@@ -0,0 +1,18 @@
--- protobuf-28.2/third_party/utf8_range/CMakeLists.txt 2024-10-24 21:35:09.113008070 +0200
+++ protobuf-28.2/third_party/utf8_range/CMakeLists.txt 2024-10-24 21:35:43.123256664 +0200
@@ -11,13 +11,13 @@
##
# Create the lightweight C library
-add_library (utf8_range
+add_library (utf8_range STATIC
utf8_range.c
)
##
# A heavier-weight C++ wrapper that supports Abseil.
-add_library (utf8_validity utf8_validity.cc utf8_range.c)
+add_library (utf8_validity STATIC utf8_validity.cc utf8_range.c)
# Load Abseil dependency.
if (NOT TARGET absl::strings)