From b754c4f0eff46d92ff214c1776fb0d5fedb6c26ffe3fdc59b2ee4dc1f67ea784 Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Mon, 18 Mar 2024 10:40:02 +0000 Subject: [PATCH] Accepting request 1154625 from LibreOffice:Factory Fix build on different distributions OBS-URL: https://build.opensuse.org/request/show/1154625 OBS-URL: https://build.opensuse.org/package/show/devel:microos/abseil-cpp?expand=0&rev=30 --- abseil-cpp.changes | 8 ++++++++ abseil-cpp.spec | 27 ++++++++++++++++++--------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/abseil-cpp.changes b/abseil-cpp.changes index f4553b0..3752027 100644 --- a/abseil-cpp.changes +++ b/abseil-cpp.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Mar 4 10:30:53 UTC 2024 - Fridrich Strba + +- Fix broken link to sources +- Fix build for distributions that lack the ldconfig_scriptlets + macro +- Make the gcc version condition a bit more generic + ------------------------------------------------------------------- Sun Mar 3 06:35:57 UTC 2024 - Andreas Stieger diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 59d7d48..c15a9ea 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -17,23 +17,26 @@ %define lname libabsl2401_0_0 +%if 0%{?gcc_version} < 7 +%global with_gcc 7 +%endif Name: abseil-cpp Version: 20240116.1 Release: 0 Summary: C++11 libraries which augment the C++ stdlib License: Apache-2.0 URL: https://abseil.io/ -Source0: https://github.com/abseil/abseil-cpp/releases/download/%{version}/%{name}-%{version}.tar.gz +Source0: https://github.com/abseil/%{name}/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: baselibs.conf BuildRequires: cmake BuildRequires: fdupes BuildRequires: pkgconfig -%if 0%{?suse_version} && 0%{?suse_version} < 1500 -BuildRequires: gcc7 -BuildRequires: gcc7-c++ +%if 0%{?with_gcc:1} +BuildRequires: gcc%{with_gcc} +BuildRequires: gcc%{with_gcc}-c++ %else -BuildRequires: gcc >= 7 -BuildRequires: gcc-c++ >= 7 +BuildRequires: gcc +BuildRequires: gcc-c++ %endif # PATCH-FIX-OPENSUSE options-{old,cxx17}.patch Ensure ABI stability regardless of compiler options %if 0%{?suse_version} && 0%{?suse_version} < 1550 @@ -71,9 +74,9 @@ This package contains headers and build system files for it. %autosetup -p1 %build -%if 0%{?suse_version} && 0%{?suse_version} < 1500 -export CC="gcc-7" -export CXX="g++-7" +%if 0%{?with_gcc:1} +export CC="gcc-%{with_gcc}" +export CXX="g++-%{with_gcc}" %endif %cmake %cmake_build @@ -82,7 +85,13 @@ export CXX="g++-7" %cmake_install %fdupes %{buildroot}/%{_prefix} +# SLE12 doed not define this macro +%if %{undefined ldconfig_scriptlets} +%post -n %{lname} -p /sbin/ldconfig +%postun -n %{lname} -p /sbin/ldconfig +%else %ldconfig_scriptlets -n %{lname} +%endif %files -n %{lname} %license LICENSE