From 8b8045f961af1a3e3978da3266c9b0d3c11699d7 Mon Sep 17 00:00:00 2001 From: Vitaly Zaitsev Date: Aug 18 2021 14:01:44 +0000 Subject: Restored bundled hedley version. Json cannot work with unpatched upstream version due to different namespaces. --- diff --git a/json.spec b/json.spec index 4f6fcef..ad6fb3f 100644 --- a/json.spec +++ b/json.spec @@ -1,12 +1,15 @@ %undefine __cmake_in_source_build %global debug_package %{nil} %global test_data_version 3.0.0 +%global bundled_hedley_version 15 Name: json Version: 3.10.0 Release: 1%{?dist} -License: MIT +# The entire source is MIT except +# include/nlohmann/thirdparty/hedley/hedley.hpp, which is CC0 +License: MIT and CC0 Summary: JSON for Modern C++ URL: https://github.com/nlohmann/%{name} Source0: %{url}/archive/v%{version}.tar.gz @@ -14,11 +17,11 @@ Source1: https://github.com/nlohmann/json_test_data/archive/v%{test_data_ BuildRequires: cmake BuildRequires: gcc-c++ -BuildRequires: hedley-devel BuildRequires: ninja-build # Build requirements for the tests. BuildRequires: doctest-devel +BuildRequires: gawk %description This is a packages version of the nlohmann/json header-only C++ @@ -27,7 +30,7 @@ library available at Github. %package devel Summary: Development files for %{name} Provides: %{name}-static = %{?epoch:%{epoch}:}%{version}-%{release} -Requires: hedley-devel%{?_isa} +Provides: bundled(hedley) = %{bundled_hedley_version} Requires: libstdc++-devel%{?_isa} %description devel @@ -38,10 +41,6 @@ applications that use %{name}. %autosetup -p1 %setup -q -D -T -a1 -# Unbundle hedley. Use packaged version. -rm -f include/nlohmann/thirdparty/hedley/hedley.hpp -sed -e 's@nlohmann/thirdparty/hedley/hedley\.hpp@hedley\.h@g' -i include/nlohmann/detail/macro_scope.hpp - # Unbundle doctest. Used only in tests. ln -svf %{_includedir}/doctest/doctest.h ./test/thirdparty/doctest/doctest.h @@ -56,6 +55,12 @@ ln -svf %{_includedir}/doctest/doctest.h ./test/thirdparty/doctest/doctest.h %check %ctest --label-exclude 'git_required' --timeout 3600 +# Verify version of virtual Provides for bundled Hedley matches actual header +[ "$(awk ' +/^[[:blank:]]*#[[:blank:]]*define[[:blank:]]+JSON_HEDLEY_VERSION[[:blank:]]/ { + print $NF }' include/nlohmann/thirdparty/hedley/hedley.hpp +)" = '%{bundled_hedley_version}' ] + %install %cmake_install @@ -69,8 +74,7 @@ ln -svf %{_includedir}/doctest/doctest.h ./test/thirdparty/doctest/doctest.h %changelog * Wed Aug 18 2021 Vitaly Zaitsev - 3.10.0-1 - Updated to version 3.10.0. -- Switched to multi-header version. -- Unbundled hedley. +- Switched to multi-headers version. * Thu Jul 22 2021 Fedora Release Engineering - 3.9.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild