%global test_data_version 3.0.0 Name: nlohmann-json Version: 3.9.1 Release: 1%{?dist} Summary: JSON for Modern C++ License: MIT URL: https://github.com/nlohmann/json Source0: https://github.com/nlohmann/json/archive/v%{version}/%{name}-%{version}.tar.gz Source1: https://github.com/nlohmann/json_test_data/archive/v%{test_data_version}/json_test_data-%{test_data_version}.tar.gz # Fix build with latest gcc and non constant SIGSTKSZ # Backport of https://github.com/nlohmann/json/pull/2687 Patch0: nlohmann-json-sigstksz.patch BuildRequires: cmake BuildRequires: gcc-c++ # Header only library %global debug_package %{nil} %description There are myriads of JSON libraries out there, and each may even have its reason to exist. Our class had these design goals: * Intuitive syntax. In languages such as Python, JSON feels like a first class data type. We used all the operator magic of modern C++ to achieve the same feeling in your code. * Trivial integration. Our whole code consists of a single header file json.hpp. That's it. No library, no subproject, no dependencies, no complex build system. The class is written in vanilla C++11. All in all, everything should require no adjustment of your compiler flags or project settings. * Serious testing. Our class is heavily unit-tested and covers 100% of the code, including all exceptional behavior. Furthermore, we checked with Valgrind and the Clang Sanitizers that there are no memory leaks. Google OSS-Fuzz additionally runs fuzz tests against all parsers 24/7, effectively executing billions of tests so far. To maintain high quality, the project is following the Core Infrastructure Initiative (CII) best practices. Other aspects were not so important to us: * Memory efficiency. Each JSON object has an overhead of one pointer (the maximal size of a union) and one enumeration element (1 byte). The default generalization uses the following C++ data types: std::string for strings, int64_t, uint64_t or double for numbers, std::map for objects, std::vector for arrays, and bool for Booleans. However, you can template the generalized class basic_json to your needs. * Speed. There are certainly faster JSON libraries out there. However, if your goal is to speed up your development by adding JSON support with a single header, then this library is the way to go. If you know how to use a std::vector or std::map, you are already set. %package devel Summary: Development files for %{name} Provides: %{name}-static = %{version}-%{release} %description devel The %{name}-devel package contains header files for developing applications that use %{name}. %prep %autosetup -p1 -a1 -n json-%{version} %build %cmake -DJSON_TestDataDirectory=$PWD/json_test_data-%{test_data_version} %cmake_build %install %cmake_install %check # Fetch tests attempt to download things %ctest --exclude-regex fetch %files %license LICENSE.MIT %doc ChangeLog.md README.md %files devel %{_includedir}/nlohmann/ %{_libdir}/cmake/nlohmann_json/ %{_libdir}/pkgconfig/nlohmann_json.pc %changelog * Thu Jun 17 2021 Orion Poplawski - Initial package