commit:     58b3cfe23855e57e2f0aa7eda999803ad56b5a42
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Fri Aug 15 22:15:47 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Sep  4 20:48:36 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58b3cfe2

dev-cpp/jsoncons: new package, add 1.3.2

Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Part-of: https://github.com/gentoo/gentoo/pull/43482
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-cpp/jsoncons/Manifest                          |  1 +
 dev-cpp/jsoncons/files/jsoncons-1.3.2-cmake4.patch | 62 ++++++++++++++++++++++
 .../jsoncons/files/jsoncons-1.3.2-namespace.patch  | 45 ++++++++++++++++
 .../files/jsoncons-1.3.2-uninitialized.patch       | 14 +++++
 .../jsoncons/files/jsoncons-1.3.2-usrshare.patch   | 14 +++++
 dev-cpp/jsoncons/jsoncons-1.3.2.ebuild             | 34 ++++++++++++
 dev-cpp/jsoncons/metadata.xml                      | 17 ++++++
 7 files changed, 187 insertions(+)

diff --git a/dev-cpp/jsoncons/Manifest b/dev-cpp/jsoncons/Manifest
new file mode 100644
index 000000000000..2b7ed988f76d
--- /dev/null
+++ b/dev-cpp/jsoncons/Manifest
@@ -0,0 +1 @@
+DIST jsoncons-1.3.2.tar.gz 1504068 BLAKE2B 
acc4b41edc0a6de5c6f3c43786aa5574d27c4693288bc8f561b45bca9be4338ba63eaa6cfa2c0fc6771e8c98e9a33ffc6e81983cc3edc5973f93521e2dcb5902
 SHA512 
763e56ed7469d81e44e04ec029806fa08026cb3c33caf1264a24068007226e26ea38922840d7e4b2e7529f99564c1fb6bca48f84a4a3f383733d37af8d13cc99

diff --git a/dev-cpp/jsoncons/files/jsoncons-1.3.2-cmake4.patch 
b/dev-cpp/jsoncons/files/jsoncons-1.3.2-cmake4.patch
new file mode 100644
index 000000000000..fe89ed0ecd2d
--- /dev/null
+++ b/dev-cpp/jsoncons/files/jsoncons-1.3.2-cmake4.patch
@@ -0,0 +1,62 @@
+https://github.com/danielaparker/jsoncons/commit/d396ec86ea20b9805ba483d6c3dc20994824e823
+From: "Markus Kitsinger (SwooshyCueb)" <[email protected]>
+Date: Tue, 22 Apr 2025 10:58:00 -0500
+Subject: [PATCH] Update CMake policy usage to 3.14
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 3.5)
++cmake_minimum_required(VERSION 3.5...3.14)
+ 
+ project(jsoncons CXX)
+ 
+@@ -60,7 +60,7 @@ configure_package_config_file(cmake/Config.cmake
+ 
+ # jsoncons is header-only and does not depend on the architecture.
+ 
+-if (${CMAKE_VERSION} VERSION_LESS "3.14.0")
++if (CMAKE_VERSION VERSION_LESS "3.14.0")
+    
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
+                                     VERSION ${${PROJECT_NAME}_VERSION}
+                                     COMPATIBILITY AnyNewerVersion)
+--- a/examples/build/cmake/CMakeLists.txt
++++ b/examples/build/cmake/CMakeLists.txt
+@@ -3,7 +3,7 @@
+ # jsoncons examples CMake file
+ #
+ 
+-cmake_minimum_required (VERSION 2.8)
++cmake_minimum_required(VERSION 3.5...3.14)
+ 
+ # load global config
+ include (../../build/cmake/Config.cmake)
+@@ -27,7 +27,7 @@ foreach(example_file ${Example_sources})
+     # Create an executable with the example name and file
+     add_executable(${example_name} ${example_file})
+ 
+-    if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND ${CMAKE_CXX_COMPILER_ID} 
STREQUAL "Clang")
++    if ((CMAKE_SYSTEM_NAME STREQUAL "Linux") AND (CMAKE_CXX_COMPILER_ID 
STREQUAL "Clang"))
+       # special link option on Linux because llvm stl rely on GNU stl
+       target_link_libraries(${example_name} -Wl,-lstdc++)
+     endif()
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -50,7 +50,7 @@ set(JSONCONS_THIRD_PARTY_INCLUDE_DIR 
${JSONCONS_TESTS_DIR}/thirdparty)
+ set(CATCH_INCLUDE_DIR ${JSONCONS_THIRD_PARTY_INCLUDE_DIR}/catch)
+ add_library(catch INTERFACE)
+ 
+-if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
++if (CMAKE_VERSION VERSION_LESS "3.8.0")
+     target_compile_features(catch INTERFACE cxx_range_for)  # for C++11 - 
flags
+ else()
+     target_compile_features(catch INTERFACE cxx_std_11)
+@@ -198,7 +198,7 @@ add_executable(unit_tests
+                corelib/src/testmain.cpp
+ )              
+ 
+-if (${CMAKE_VERSION} VERSION_LESS "3.8.0")
++if (CMAKE_VERSION VERSION_LESS "3.8.0")
+     target_compile_features(unit_tests INTERFACE cxx_range_for)  # for C++11 
- flags
+ else()
+     target_compile_features(unit_tests INTERFACE cxx_std_11)

diff --git a/dev-cpp/jsoncons/files/jsoncons-1.3.2-namespace.patch 
b/dev-cpp/jsoncons/files/jsoncons-1.3.2-namespace.patch
new file mode 100644
index 000000000000..cc7e4fc26b27
--- /dev/null
+++ b/dev-cpp/jsoncons/files/jsoncons-1.3.2-namespace.patch
@@ -0,0 +1,45 @@
+https://github.com/danielaparker/jsoncons/pull/629
+
+Export cmake as jsoncons::jsoncons
+    
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -45,6 +45,7 @@ install(TARGETS jsoncons
+ 
+ # Makes the project importable from the build directory
+ export(EXPORT ${PROJECT_NAME}-targets
++       NAMESPACE jsoncons::
+        FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake")
+ 
+ install(DIRECTORY ${JSONCONS_INCLUDE_DIR}/jsoncons
+@@ -75,5 +76,6 @@ install(FILES 
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
+         DESTINATION ${JSONCONS_CMAKECONFIG_INSTALL_DIR})
+ install(EXPORT ${PROJECT_NAME}-targets
+         FILE ${PROJECT_NAME}Targets.cmake
++        NAMESPACE jsoncons::
+         DESTINATION ${JSONCONS_CMAKECONFIG_INSTALL_DIR})
+ 
+--- a/cmake/Config.cmake
++++ b/cmake/Config.cmake
+@@ -1,5 +1,8 @@
+ # jsoncons cmake module
+-# This module sets the following variables in your project::
++#
++# This module adds target jsoncons::jsoncons
++#
++# It also sets the following variables in your project:
+ #
+ #   jsoncons_FOUND - true if jsoncons found on the system
+ #   jsoncons_INCLUDE_DIRS - the directory containing jsoncons headers
+@@ -7,7 +10,9 @@
+ 
+ @PACKAGE_INIT@
+ 
+-if(NOT TARGET @PROJECT_NAME@)
++if(NOT TARGET @PROJECT_NAME@::@PROJECT_NAME@)
+   include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
+-  get_target_property(@PROJECT_NAME@_INCLUDE_DIRS jsoncons 
INTERFACE_INCLUDE_DIRECTORIES)
++  get_target_property(@PROJECT_NAME@_INCLUDE_DIRS jsoncons::jsoncons 
INTERFACE_INCLUDE_DIRECTORIES)
++  # For compatibility with older versions
++  add_library(@PROJECT_NAME@ ALIAS @PROJECT_NAME@::@PROJECT_NAME@)
+ endif()

diff --git a/dev-cpp/jsoncons/files/jsoncons-1.3.2-uninitialized.patch 
b/dev-cpp/jsoncons/files/jsoncons-1.3.2-uninitialized.patch
new file mode 100644
index 000000000000..936d9eec8e3d
--- /dev/null
+++ b/dev-cpp/jsoncons/files/jsoncons-1.3.2-uninitialized.patch
@@ -0,0 +1,14 @@
+Fix error: ā€˜c’ may be used uninitialized [-Werror=maybe-uninitialized]
+https://github.com/danielaparker/jsoncons/pull/628
+
+--- a/include/jsoncons/source.hpp
++++ b/include/jsoncons/source.hpp
+@@ -767,7 +767,7 @@ namespace jsoncons {
+                 std::size_t actual = 0;
+                 while (actual < n)
+                 {
+-                    typename Source::value_type c;
++                    typename Source::value_type c{};
+                     if (source.read(&c,1) != 1)
+                     {
+                         break;

diff --git a/dev-cpp/jsoncons/files/jsoncons-1.3.2-usrshare.patch 
b/dev-cpp/jsoncons/files/jsoncons-1.3.2-usrshare.patch
new file mode 100644
index 000000000000..a933f1f5b018
--- /dev/null
+++ b/dev-cpp/jsoncons/files/jsoncons-1.3.2-usrshare.patch
@@ -0,0 +1,14 @@
+https://github.com/danielaparker/jsoncons/pull/629
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -51,8 +51,7 @@ install(DIRECTORY ${JSONCONS_INCLUDE_DIR}/jsoncons
+                   ${JSONCONS_INCLUDE_DIR}/jsoncons_ext
+         DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+-# GNUInstallDirs "DATADIR" wrong here; CMake search path wants "share".
+-set(JSONCONS_CMAKECONFIG_INSTALL_DIR 
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" CACHE STRING "install path for 
jsonconsConfig.cmake")
++set(JSONCONS_CMAKECONFIG_INSTALL_DIR 
"${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}" CACHE STRING "install path for 
jsonconsConfig.cmake")
+ 
+ configure_package_config_file(cmake/Config.cmake
+                               
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"

diff --git a/dev-cpp/jsoncons/jsoncons-1.3.2.ebuild 
b/dev-cpp/jsoncons/jsoncons-1.3.2.ebuild
new file mode 100644
index 000000000000..e1270e10679b
--- /dev/null
+++ b/dev-cpp/jsoncons/jsoncons-1.3.2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="C++ header-only library for JSON and JSON-like data formats"
+HOMEPAGE="https://danielaparker.github.io/jsoncons/ 
https://github.com/danielaparker/jsoncons";
+SRC_URI="https://github.com/danielaparker/jsoncons/archive/refs/tags/v${PV}.tar.gz
 -> ${P}.tar.gz"
+
+LICENSE="Boost-1.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+       "${FILESDIR}/${P}"-uninitialized.patch
+       "${FILESDIR}/${P}"-cmake4.patch
+       "${FILESDIR}/${P}"-usrshare.patch
+       "${FILESDIR}/${P}"-namespace.patch
+)
+
+DOCS=( doc )
+
+# uses modified version of catch.hpp, doesn't work with upstream catch2
+
+src_configure() {
+       local mycmakeargs=(
+               -DJSONCONS_BUILD_TESTS=$(usex test)
+       )
+       cmake_src_configure
+}

diff --git a/dev-cpp/jsoncons/metadata.xml b/dev-cpp/jsoncons/metadata.xml
new file mode 100644
index 000000000000..2b2e5e862ec5
--- /dev/null
+++ b/dev-cpp/jsoncons/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person" proxied="yes">
+               <email>[email protected]</email>
+               <name>Alexey Sokolov</name>
+       </maintainer>
+       <maintainer type="project" proxied="proxy">
+               <email>[email protected]</email>
+               <name>Proxy Maintainers</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">danielaparker/jsoncons</remote-id>
+               
<bugs-to>https://github.com/danielaparker/jsoncons/issues</bugs-to>
+               <doc>https://danielaparker.github.io/jsoncons/</doc>
+       </upstream>
+</pkgmetadata>

Reply via email to