[packages/frozen] - new, with Fedora patches

qboosh qboosh at pld-linux.org
Thu Aug 29 21:34:59 CEST 2024


commit e76e5d51c71cca9e725368543d81e010b1bd9097
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Thu Aug 29 21:28:30 2024 +0200

    - new, with Fedora patches

 frozen-fix-arch-in-cmake.patch |  18 +++++++
 frozen-gcc.patch               |  37 +++++++++++++
 frozen-includes.patch          |  11 ++++
 frozen.spec                    | 117 +++++++++++++++++++++++++++++++++++++++++
 4 files changed, 183 insertions(+)
---
diff --git a/frozen.spec b/frozen.spec
new file mode 100644
index 0000000..f9c5195
--- /dev/null
+++ b/frozen.spec
@@ -0,0 +1,117 @@
+#
+# Conditional build:
+%bcond_without	tests	# unit tests
+#
+Summary:	Header-only, constexpr alternative to gperf for C++14 users
+Summary(pl.UTF-8):	Składająca się z samych nagłówków, wykorzystująca constexpr alternatywa dla gperfa dla C++14
+Name:		frozen
+Version:	1.1.1
+Release:	1
+License:	Apache v2.0
+Group:		Libraries
+#Source0Download: https://github.com/serge-sans-paille/frozen/tags
+Source0:	https://github.com/serge-sans-paille/frozen/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	9c498c6845e4e33ea686770d3d429aa2
+Patch0:		%{name}-gcc.patch
+Patch1:		%{name}-includes.patch
+Patch2:		%{name}-fix-arch-in-cmake.patch
+URL:		https://github.com/serge-sans-paille/frozen
+BuildRequires:	cmake >= 3.8
+BuildRequires:	libstdc++-devel >= 6:5
+%if %{with tests}
+BuildRequires:	libstdc++-devel >= 6:7
+%endif
+BuildRequires:	rpmbuild(macros) >= 1.605
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Header-only library that provides 0 cost initialization for immutable
+containers, fixed-size containers, and various algorithms.
+
+Frozen provides:
+- immutable (a.k.a. frozen), constexpr-compatible versions of
+  std::set, std::unordered_set, std::map and std::unordered_map.
+- fixed-capacity, constinit-compatible versions of std::map and 
+  std::unordered_map with immutable, compile-time selected keys mapped
+  to mutable values.
+- 0-cost initialization version of std::search for frozen needles
+  using Boyer-Moore or Knuth-Morris-Pratt algorithms.
+
+%description -l pl.UTF-8
+Składająca się z samych nagłówków biblioteka zapewniająca bezkosztowe
+inicjowanie niezmiennych kontenerów, kontenery o stałym rozmiarze i
+różne algorytmy.
+
+W tym:
+- niezmienne (czyli zamrożone - frozen), zgodne z constexpr wersje
+  std::set, std::unordered_set, std::map, std::unordered_map.
+- stałej pojemności, zgodne z constinit wersje std::map i
+  std::unordered_map z niezmiennymi, wybieranymi w czasie kompilacji
+  kluczami odwzorowywanymi na zmienne wartości.
+- wersja std::search o bezkosztowym inicjowaniu dla niezmiennych
+  wartości wyszukiwanych, wykorzystująca algorytmy Boyera-Moore'a i
+  Knuta-Morrisa-Pratta.
+
+%package devel
+Summary:	Header-only, constexpr alternative to gperf for C++14 users
+Summary(pl.UTF-8):	Składająca się z samych nagłówków, wykorzystująca constexpr alternatywa dla gperfa dla C++14
+Group:		Development/Libraries
+Requires:	libstdc++-devel >= 6:5
+
+%description devel
+Header-only library that provides 0 cost initialization for immutable
+containers, fixed-size containers, and various algorithms.
+
+Frozen provides:
+- immutable (a.k.a. frozen), constexpr-compatible versions of
+  std::set, std::unordered_set, std::map and std::unordered_map.
+- fixed-capacity, constinit-compatible versions of std::map and 
+  std::unordered_map with immutable, compile-time selected keys mapped
+  to mutable values.
+- 0-cost initialization version of std::search for frozen needles
+  using Boyer-Moore or Knuth-Morris-Pratt algorithms.
+
+%description devel -l pl.UTF-8
+Składająca się z samych nagłówków biblioteka zapewniająca bezkosztowe
+inicjowanie niezmiennych kontenerów, kontenery o stałym rozmiarze i
+różne algorytmy.
+
+W tym:
+- niezmienne (czyli zamrożone - frozen), zgodne z constexpr wersje
+  std::set, std::unordered_set, std::map, std::unordered_map.
+- stałej pojemności, zgodne z constinit wersje std::map i
+  std::unordered_map z niezmiennymi, wybieranymi w czasie kompilacji
+  kluczami odwzorowywanymi na zmienne wartości.
+- wersja std::search o bezkosztowym inicjowaniu dla niezmiennych
+  wartości wyszukiwanych, wykorzystująca algorytmy Boyera-Moore'a i
+  Knuta-Morrisa-Pratta.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p0
+%patch2 -p1
+
+%build
+install -d build
+cd build
+%cmake .. \
+	-DBUILD_TESTING=OFF
+
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files devel
+%defattr(644,root,root,755)
+%doc AUTHORS README.rst
+%{_includedir}/frozen
+%{_datadir}/cmake/frozen
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-gcc.patch b/frozen-gcc.patch
new file mode 100644
index 0000000..1ce542e
--- /dev/null
+++ b/frozen-gcc.patch
@@ -0,0 +1,37 @@
+From 079f73cc5c6413127d47f325cbb34a607e2cb030 Mon Sep 17 00:00:00 2001
+From: serge-sans-paille <serge.guelton at telecom-bretagne.eu>
+Date: Fri, 16 Dec 2022 22:58:51 +0100
+Subject: [PATCH] Workaround gcc 11 limitation
+
+For some reason, gcc sees a constexpr violation here. Trust clang and msvc on this.
+---
+ include/frozen/unordered_set.h | 2 +-
+ tests/test_unordered_set.cpp   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/frozen/unordered_set.h b/include/frozen/unordered_set.h
+index 4d16df9..196ea50 100644
+--- a/include/frozen/unordered_set.h
++++ b/include/frozen/unordered_set.h
+@@ -105,7 +105,7 @@ class unordered_set {
+   /* lookup */
+   template <class KeyType, class Hasher, class Equal>
+   constexpr std::size_t count(KeyType const &key, Hasher const &hash, Equal const &equal) const {
+-    auto const k = lookup(key, hash);
++    auto const & k = lookup(key, hash);
+     return equal(k, key);
+   }
+   template <class KeyType>
+diff --git a/tests/test_unordered_set.cpp b/tests/test_unordered_set.cpp
+index e90a0d4..042c1a8 100644
+--- a/tests/test_unordered_set.cpp
++++ b/tests/test_unordered_set.cpp
+@@ -65,7 +65,7 @@ TEST_CASE("tripleton str frozen unordered set", "[unordered set]") {
+   constexpr auto max_size = ze_set.max_size();
+   REQUIRE(max_size == 3);
+ 
+-  constexpr auto nocount = ze_set.count(4);
++  const auto nocount = ze_set.count(4);
+   REQUIRE(nocount == 0);
+ 
+   constexpr auto count = ze_set.count(1);
diff --git a/frozen-includes.patch b/frozen-includes.patch
new file mode 100644
index 0000000..039138b
--- /dev/null
+++ b/frozen-includes.patch
@@ -0,0 +1,11 @@
+--- include/frozen/bits/pmh.h~	2022-03-31 00:56:25.000000000 -0500
++++ include/frozen/bits/pmh.h	2023-07-17 13:42:52.903675376 -0500
+@@ -30,6 +30,8 @@
+ #include <array>
+ #include <limits>
+ 
++#include <cstdint>
++
+ namespace frozen {
+ 
+ namespace bits {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/frozen.git/commitdiff/e76e5d51c71cca9e725368543d81e010b1bd9097



More information about the pld-cvs-commit mailing list