From 5e78ed37950eaf1a06ffb1b1b81481a7ee3325dcd409b8a1e049cde8e0430804 Mon Sep 17 00:00:00 2001 From: Richard Brown Date: Thu, 24 Aug 2023 14:19:55 +0000 Subject: [PATCH] Accepting request 1103184 from LibreOffice:Factory Fix build on SLE12SP5 with cmake 3.5 OBS-URL: https://build.opensuse.org/request/show/1103184 OBS-URL: https://build.opensuse.org/package/show/devel:microos/abseil-cpp?expand=0&rev=18 --- abseil-cpp.changes | 9 +++++++++ abseil-cpp.spec | 13 ++++++++++++- cmake.patch | 11 +++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 cmake.patch diff --git a/abseil-cpp.changes b/abseil-cpp.changes index 0fac932..15cf87b 100644 --- a/abseil-cpp.changes +++ b/abseil-cpp.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Aug 9 15:18:16 UTC 2023 - Fridrich Strba + +- Fix build on older systems by requiring C++17 compliant compiler +- Added patch: + * cmake.patch + + lower the cmake requirement to 3.5 in order to be able to + build on SLE12SP5 + ------------------------------------------------------------------- Thu Jun 29 09:52:24 UTC 2023 - Fabian Vogt diff --git a/abseil-cpp.spec b/abseil-cpp.spec index 029bae8..efc0630 100644 --- a/abseil-cpp.spec +++ b/abseil-cpp.spec @@ -25,13 +25,20 @@ License: Apache-2.0 URL: https://abseil.io/ Source0: https://github.com/abseil/abseil-cpp/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: baselibs.conf -BuildRequires: c++_compiler +%if 0%{?suse_version} < 1500 +BuildRequires: gcc7 +BuildRequires: gcc7-c++ +%else +BuildRequires: gcc >= 7 +BuildRequires: gcc-c++ >= 7 +%endif BuildRequires: cmake BuildRequires: fdupes BuildRequires: pkgconfig # PATCH-FIX-OPENSUSE options-{old,cxx17}.patch Ensure ABI stability regardless of compiler options %if 0%{?suse_version} < 1550 Patch0: options-old.patch +Patch1: cmake.patch %else Patch0: options-cxx17.patch %endif @@ -64,6 +71,10 @@ This package contains headers and build system files for it. %autosetup -p1 %build +%if 0%{?suse_version} < 1500 +export CC="gcc-7" +export CXX="g++-7" +%endif %cmake %cmake_build diff --git a/cmake.patch b/cmake.patch new file mode 100644 index 0000000..e395f28 --- /dev/null +++ b/cmake.patch @@ -0,0 +1,11 @@ +--- abseil-cpp-20230125.3/CMakeLists.txt 2023-08-08 13:05:37.796998429 +0200 ++++ abseil-cpp-20230125.3/CMakeLists.txt 2023-08-08 13:06:11.263885421 +0200 +@@ -16,7 +16,7 @@ + + # https://github.com/google/oss-policies-info/blob/main/foundational-cxx-support-matrix.md + # As of 2022-09-06, CMake 3.10 is the minimum supported version. +-cmake_minimum_required(VERSION 3.10) ++cmake_minimum_required(VERSION 3.5) + + # Compiler id for Apple Clang is now AppleClang. + if (POLICY CMP0025)