From 02a9bd1d8976f38ccc36a643ea1d70c905a167d45f31b841f59f090f2f2c1025 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 29 Oct 2024 17:15:02 +0000 Subject: [PATCH] - Add versionize-shlibs.patch, delete static-utf8-ranges.patch * Build the libutf8_range and libutf8_validity as shared library to conform to SLPP OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/protobuf?expand=0&rev=197 --- baselibs.conf | 1 + protobuf-java.changes | 7 +++++++ protobuf.changes | 7 +++++++ protobuf.spec | 28 ++++++++++++++++++++++++---- python-protobuf.changes | 7 +++++++ static-utf8-ranges.patch | 18 ------------------ versionize-shlibs.patch | 32 ++++++++++++++++++++++++++++++++ 7 files changed, 78 insertions(+), 22 deletions(-) delete mode 100644 static-utf8-ranges.patch create mode 100644 versionize-shlibs.patch diff --git a/baselibs.conf b/baselibs.conf index 353739d..52a5c98 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -1,3 +1,4 @@ libprotobuf28_3_0 libprotoc28_3_0 libprotobuf-lite28_3_0 +libutf8_range-28_3_0 diff --git a/protobuf-java.changes b/protobuf-java.changes index d070205..9167d79 100644 --- a/protobuf-java.changes +++ b/protobuf-java.changes @@ -4,6 +4,13 @@ Mon Oct 28 08:20:17 UTC 2024 - Dirk Müller - python: switch to pypi package to get the cythonized component - drop python-protobuf-setup_py.patch (obsolete) +------------------------------------------------------------------- +Sat Oct 26 08:40:48 UTC 2024 - Jan Engelhardt + +- Add versionize-shlibs.patch, delete static-utf8-ranges.patch + * Build the libutf8_range and libutf8_validity as shared library + to conform to SLPP + ------------------------------------------------------------------- Fri Oct 25 15:24:11 UTC 2024 - Dirk Müller diff --git a/protobuf.changes b/protobuf.changes index d070205..9167d79 100644 --- a/protobuf.changes +++ b/protobuf.changes @@ -4,6 +4,13 @@ Mon Oct 28 08:20:17 UTC 2024 - Dirk Müller - python: switch to pypi package to get the cythonized component - drop python-protobuf-setup_py.patch (obsolete) +------------------------------------------------------------------- +Sat Oct 26 08:40:48 UTC 2024 - Jan Engelhardt + +- Add versionize-shlibs.patch, delete static-utf8-ranges.patch + * Build the libutf8_range and libutf8_validity as shared library + to conform to SLPP + ------------------------------------------------------------------- Fri Oct 25 15:24:11 UTC 2024 - Dirk Müller diff --git a/protobuf.spec b/protobuf.spec index 97f2f18..8196cd2 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -74,7 +74,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 +Patch1: versionize-shlibs.patch BuildRequires: cmake BuildRequires: fdupes BuildRequires: gcc%{?with_gcc}-c++ @@ -152,11 +152,20 @@ 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 -n libutf8_range-%{sover} +Summary: UTF-8 validation libraries from Protobuf +Group: System/Libraries + +%description -n libutf8_range-%{sover} +UTF-8 string validation library with optional SIMD acceleration (armv8a NEON, +SSE4 and AVX2). + %package devel Summary: Header files, libraries and development documentation for %{name} Group: Development/Libraries/C and C++ Requires: libprotobuf%{sover} = %{version} -Requires: libprotobuf-lite%{sover} +Requires: libprotobuf-lite%{sover} = %{version} +Requires: libutf8_range-%{sover} = %{version} Conflicts: protobuf2-devel Conflicts: protobuf21-devel Provides: libprotobuf-devel = %{version} @@ -194,6 +203,9 @@ export CC=gcc-%{with_gcc} %install %cmake_install install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto.vim +# manual ln that we could not manage to get into versionize-shlibs.patch +ln -s libutf8_range-%{version}.0.so %{buildroot}/%{_libdir}/libutf8_range.so +ln -s libutf8_validity-%{version}.0.so %{buildroot}/%{_libdir}/libutf8_validity.so # create maven metadata for the protoc executable install -dm 0755 %{buildroot}%{_datadir}/maven-metadata @@ -222,10 +234,13 @@ __PROTOBUF__ %postun -n libprotoc%{sover} -p /sbin/ldconfig %post -n libprotobuf-lite%{sover} -p /sbin/ldconfig %postun -n libprotobuf-lite%{sover} -p /sbin/ldconfig +%post -n libutf8_range-%{sover} -p /sbin/ldconfig +%postun -n libutf8_range-%{sover} -p /sbin/ldconfig %else %ldconfig_scriptlets -n libprotobuf%{sover} %ldconfig_scriptlets -n libprotoc%{sover} %ldconfig_scriptlets -n libprotobuf-lite%{sover} +%ldconfig_scriptlets -n libutf8_range-%{sover} %endif %files -n libprotobuf%{sover} @@ -240,6 +255,11 @@ __PROTOBUF__ %license LICENSE %{_libdir}/libprotobuf-lite.so.%{version}.0 +%files -n libutf8_range-%{sover} +%license LICENSE +%{_libdir}/libutf8_range-%{version}.0.so +%{_libdir}/libutf8_validity-%{version}.0.so + %files devel %license LICENSE %doc CONTRIBUTORS.txt README.md @@ -264,8 +284,8 @@ __PROTOBUF__ %{_libdir}/libprotobuf.so %{_libdir}/libprotoc.so %{_libdir}/libupb.a -%{_libdir}/libutf8_range.a -%{_libdir}/libutf8_validity.a +%{_libdir}/libutf8_range.so +%{_libdir}/libutf8_validity.so %{_datadir}/vim %{_datadir}/maven-metadata diff --git a/python-protobuf.changes b/python-protobuf.changes index d070205..9167d79 100644 --- a/python-protobuf.changes +++ b/python-protobuf.changes @@ -4,6 +4,13 @@ Mon Oct 28 08:20:17 UTC 2024 - Dirk Müller - python: switch to pypi package to get the cythonized component - drop python-protobuf-setup_py.patch (obsolete) +------------------------------------------------------------------- +Sat Oct 26 08:40:48 UTC 2024 - Jan Engelhardt + +- Add versionize-shlibs.patch, delete static-utf8-ranges.patch + * Build the libutf8_range and libutf8_validity as shared library + to conform to SLPP + ------------------------------------------------------------------- Fri Oct 25 15:24:11 UTC 2024 - Dirk Müller diff --git a/static-utf8-ranges.patch b/static-utf8-ranges.patch deleted file mode 100644 index d3a2441..0000000 --- a/static-utf8-ranges.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- 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) diff --git a/versionize-shlibs.patch b/versionize-shlibs.patch new file mode 100644 index 0000000..8829a73 --- /dev/null +++ b/versionize-shlibs.patch @@ -0,0 +1,32 @@ +From: Jan Engelhardt +Date: 2024-10-28 10:10:20.918922623 +0100 +References: https://github.com/protocolbuffers/protobuf/pull/19009 + +Unversioned libraries are strongly discouraged. Use +https://en.opensuse.org/openSUSE:Shared_library_packaging_policy#When_there_is_no_versioning +method 1 to remedy. Though utf8_range has a version of its own ("1.0" +visible through the .pc file) and gets third_party/-like treatment, +protobuf is the authoritative repository for it, using the protobuf +version for our SONAME seems acceptable. + +This openSUSE patch follows SLPP's naming provisions and so is +slightly different from PR19009 while the PR is unmerged. + +--- + third_party/utf8_range/CMakeLists.txt | 8 ++++++++ + 1 file changed, 8 insertions(+) + +Index: protobuf-28.3/third_party/utf8_range/CMakeLists.txt +=================================================================== +--- protobuf-28.3.orig/third_party/utf8_range/CMakeLists.txt ++++ protobuf-28.3/third_party/utf8_range/CMakeLists.txt +@@ -19,6 +19,9 @@ add_library (utf8_range + # A heavier-weight C++ wrapper that supports Abseil. + add_library (utf8_validity utf8_validity.cc utf8_range.c) + ++set_target_properties(utf8_range PROPERTIES OUTPUT_NAME ${LIB_PREFIX}utf8_range-${protobuf_VERSION}) ++set_target_properties(utf8_validity PROPERTIES OUTPUT_NAME ${LIB_PREFIX}utf8_validity-${protobuf_VERSION}) ++ + # Load Abseil dependency. + if (NOT TARGET absl::strings) + if (NOT ABSL_ROOT_DIR)