From 725cb8bf9314129b691c383f6e66bf353495dc1e Mon Sep 17 00:00:00 2001 From: topazus Date: Sun, 17 Dec 2023 20:57:02 +0800 Subject: [PATCH] Fix error of find_package(frozen) in CMake --- frozen-fix-arch-in-cmake.patch | 18 ++++++++++++++++++ frozen.spec | 7 +++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 frozen-fix-arch-in-cmake.patch diff --git a/frozen-fix-arch-in-cmake.patch b/frozen-fix-arch-in-cmake.patch new file mode 100644 index 0000000..e782761 --- /dev/null +++ b/frozen-fix-arch-in-cmake.patch @@ -0,0 +1,18 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 65fb923..dfcc437 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -126,8 +126,13 @@ if(frozen.installation) + # generate a CMake configuration file for consumption by CMake's `find_package` + # intrinsic + # ++ ++ if(${CMAKE_VERSION} VERSION_GREATER "3.14") ++ set(OPTIONAL_ARCH_INDEPENDENT "ARCH_INDEPENDENT") ++ endif() + write_basic_package_version_file("frozenConfigVersion.cmake" + VERSION ${PROJECT_VERSION} ++ ${OPTIONAL_ARCH_INDEPENDENT} + COMPATIBILITY SameMajorVersion) + + install(FILES "${PROJECT_BINARY_DIR}/frozenConfigVersion.cmake" diff --git a/frozen.spec b/frozen.spec index 5cd5fdc..955bb8a 100644 --- a/frozen.spec +++ b/frozen.spec @@ -3,8 +3,8 @@ Name: frozen Version: 1.1.1 -Release: 3%{?dist} -Summary: A header-only, constexpr alternative to gperf for C++14 users +Release: 4%{?dist} +Summary: A header-only, constexpr alternative to gperf for C++14 users License: Apache-2.0 URL: https://github.com/serge-sans-paille/frozen @@ -12,6 +12,8 @@ Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz # Fixes FTBFS, already present in upstream main branch. Patch0: includes.patch Patch1: 079f73cc5c6413127d47f325cbb34a607e2cb030.patch +# related: https://github.com/serge-sans-paille/frozen/pull/167 +Patch2: frozen-fix-arch-in-cmake.patch BuildRequires: gcc-c++ BuildRequires: cmake @@ -36,6 +38,7 @@ Development files for %{name}. %patch -P 0 -p0 %patch -P 1 -p1 +%patch -P 2 -p1 %build %cmake -DCMAKE_BUILD_TYPE=Release