From 117550bab9f43c4a3b37ddd12c42fe1f1d5e136f Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Thu, 15 May 2025 11:53:01 +0200 Subject: [PATCH 1/4] Allow to build with CMake 4.0 --- 1211.patch | 29 +++++++++++++++++++++++++++++ yaml-cpp.spec | 30 ++++++++++++++++++++++-------- 2 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 1211.patch diff --git a/1211.patch b/1211.patch new file mode 100644 index 0000000..29085ab --- /dev/null +++ b/1211.patch @@ -0,0 +1,29 @@ +From 8153a1add19018f65527faad3c4d3941705baf39 Mon Sep 17 00:00:00 2001 +From: Craig Scott +Date: Wed, 16 Aug 2023 15:55:44 +1000 +Subject: [PATCH] Specify CMake policy range to avoid deprecation warning + +CMake 3.27 started issuing a deprecation warning for any +cmake_minimum_required() call that specified a minimum +version older than 3.5. Specifying a version range instead of +a simple minimum version avoids that warning without +raising the minimum supported CMake version. The NEW +policy behavior will be used for all policies introduced up to +CMake 3.14 with this change. +--- + CMakeLists.txt | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 46dc18059..1ae92e2b7 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,5 +1,6 @@ +-# 3.5 is actually available almost everywhere, but this a good minimum +-cmake_minimum_required(VERSION 3.4) ++# 3.5 is actually available almost everywhere, but this a good minimum. ++# 3.14 as the upper policy limit avoids CMake deprecation warnings. ++cmake_minimum_required(VERSION 3.4...3.14) + + # enable MSVC_RUNTIME_LIBRARY target property + # see https://cmake.org/cmake/help/latest/policy/CMP0091.html diff --git a/yaml-cpp.spec b/yaml-cpp.spec index 2bcf1c6..d4d0a3d 100644 --- a/yaml-cpp.spec +++ b/yaml-cpp.spec @@ -2,7 +2,7 @@ Name: yaml-cpp Version: 0.8.0 -Release: 2%{?dist} +Release: 3%{?dist} License: MIT Summary: A YAML parser and emitter for C++ @@ -11,10 +11,12 @@ Source0: https://github.com/jbeder/yaml-cpp/archive/%{version}/%{name}-%{ Patch0: yaml-cpp-include.patch +# Allow CMake 4.0 build +Patch1: https://github.com/jbeder/yaml-cpp/pull/1211.patch + BuildRequires: cmake BuildRequires: gcc BuildRequires: gcc-c++ -BuildRequires: make %description yaml-cpp is a YAML parser and emitter in C++ written around the YAML 1.2 spec. @@ -39,26 +41,34 @@ The %{name}-static package contains the static library for %{name}. %autosetup -p1 %build -%cmake -B build_static \ +# Define separate build directories for static and shared +%global _vpath_builddir %{_target_platform}-${variant} + +variant=static +%cmake \ -DCMAKE_BUILD_TYPE=Release \ -DYAML_CPP_BUILD_TOOLS:BOOL=OFF \ -DYAML_CPP_FORMAT_SOURCE:BOOL=OFF \ -DYAML_CPP_INSTALL:BOOL=ON \ -DYAML_BUILD_SHARED_LIBS:BOOL=OFF \ -DYAML_CPP_BUILD_TESTS:BOOL=OFF -%make_build -C build_static -%cmake -B build_shared \ +variant=shared +%cmake \ -DCMAKE_BUILD_TYPE=Release \ -DYAML_CPP_BUILD_TOOLS:BOOL=OFF \ -DYAML_CPP_FORMAT_SOURCE:BOOL=OFF \ -DYAML_CPP_INSTALL:BOOL=ON \ -DYAML_BUILD_SHARED_LIBS:BOOL=ON \ -DYAML_CPP_BUILD_TESTS:BOOL=OFF -%make_build -C build_shared + +for variant in static shared; do + %cmake_build +done %install -%make_install -C build_static yaml-cpp +variant=static +%cmake_install # Move files so they don't get trampled mv %{buildroot}%{_libdir}/cmake/%{name} \ @@ -66,7 +76,8 @@ mv %{buildroot}%{_libdir}/cmake/%{name} \ mv %{buildroot}%{_libdir}/pkgconfig/%{name}.pc \ %{buildroot}%{_libdir}/pkgconfig/%{name}-static.pc -%make_install -C build_shared +variant=shared +%cmake_install %files %doc CONTRIBUTING.md README.md @@ -86,6 +97,9 @@ mv %{buildroot}%{_libdir}/pkgconfig/%{name}.pc \ %{_libdir}/pkgconfig/%{name}-static.pc %changelog +* Thu May 15 2025 Cristian Le - 0.8.0-3 +- Allow to build with CMake 4.0 and Ninja generator + * Sun Jan 26 2025 Richard Shaw - 0.8.0-2 - Added patch for FTBFS, BZ#2341591. From 0a64fb057bf4da6da90c42bca27561a806a77636 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 21:10:15 +0000 Subject: [PATCH 2/4] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- yaml-cpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yaml-cpp.spec b/yaml-cpp.spec index d4d0a3d..39a5770 100644 --- a/yaml-cpp.spec +++ b/yaml-cpp.spec @@ -2,7 +2,7 @@ Name: yaml-cpp Version: 0.8.0 -Release: 3%{?dist} +Release: 4%{?dist} License: MIT Summary: A YAML parser and emitter for C++ @@ -97,6 +97,9 @@ variant=shared %{_libdir}/pkgconfig/%{name}-static.pc %changelog +* Fri Jul 25 2025 Fedora Release Engineering - 0.8.0-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Thu May 15 2025 Cristian Le - 0.8.0-3 - Allow to build with CMake 4.0 and Ninja generator From 21474c78e94840ffa5f49c23571d9cfaee4c64e2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 21:00:01 +0000 Subject: [PATCH 3/4] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild --- yaml-cpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yaml-cpp.spec b/yaml-cpp.spec index 39a5770..4239bc3 100644 --- a/yaml-cpp.spec +++ b/yaml-cpp.spec @@ -2,7 +2,7 @@ Name: yaml-cpp Version: 0.8.0 -Release: 4%{?dist} +Release: 5%{?dist} License: MIT Summary: A YAML parser and emitter for C++ @@ -97,6 +97,9 @@ variant=shared %{_libdir}/pkgconfig/%{name}-static.pc %changelog +* Sat Jan 17 2026 Fedora Release Engineering - 0.8.0-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild + * Fri Jul 25 2025 Fedora Release Engineering - 0.8.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From db6c2dc0cd537bc9b9fe00f5b4f80f550d8560d1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 09:32:30 +0000 Subject: [PATCH 4/4] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild --- yaml-cpp.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yaml-cpp.spec b/yaml-cpp.spec index 4239bc3..6234375 100644 --- a/yaml-cpp.spec +++ b/yaml-cpp.spec @@ -2,7 +2,7 @@ Name: yaml-cpp Version: 0.8.0 -Release: 5%{?dist} +Release: 6%{?dist} License: MIT Summary: A YAML parser and emitter for C++ @@ -97,6 +97,9 @@ variant=shared %{_libdir}/pkgconfig/%{name}-static.pc %changelog +* Fri Jul 17 2026 Fedora Release Engineering - 0.8.0-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild + * Sat Jan 17 2026 Fedora Release Engineering - 0.8.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild