diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2025-05-01 19:27:44 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2025-05-01 19:27:44 +0000 |
| commit | 99508030007cffa33f44655bba49715cde00a9ad (patch) | |
| tree | 545e4bf81f133337d4a522336b427db2bb35cfc7 /dev-cpp | |
| parent | 6d17ffe6fd178e58cb953180f12660eda8f1ed17 (diff) | |
| download | baldeagleos-repo-99508030007cffa33f44655bba49715cde00a9ad.tar.gz baldeagleos-repo-99508030007cffa33f44655bba49715cde00a9ad.tar.xz baldeagleos-repo-99508030007cffa33f44655bba49715cde00a9ad.zip | |
Adding metadata
Diffstat (limited to 'dev-cpp')
| -rw-r--r-- | dev-cpp/nlohmann_json/files/nlohmann_json-3.12.0-fallback-missing-char8_t.patch | 141 | ||||
| -rw-r--r-- | dev-cpp/nlohmann_json/nlohmann_json-3.12.0-r1.ebuild (renamed from dev-cpp/nlohmann_json/nlohmann_json-3.12.0.ebuild) | 2 | ||||
| -rw-r--r-- | dev-cpp/websocketpp/Manifest | 1 | ||||
| -rw-r--r-- | dev-cpp/websocketpp/files/websocketpp-0.8.2-c++20-compat.patch | 94 | ||||
| -rw-r--r-- | dev-cpp/websocketpp/websocketpp-0.8.2-r1.ebuild | 56 |
5 files changed, 294 insertions, 0 deletions
diff --git a/dev-cpp/nlohmann_json/files/nlohmann_json-3.12.0-fallback-missing-char8_t.patch b/dev-cpp/nlohmann_json/files/nlohmann_json-3.12.0-fallback-missing-char8_t.patch new file mode 100644 index 000000000000..afb1491e10af --- /dev/null +++ b/dev-cpp/nlohmann_json/files/nlohmann_json-3.12.0-fallback-missing-char8_t.patch @@ -0,0 +1,141 @@ +From 756ca22ec5b0d89b5d107b4c30891d1293650c87 Mon Sep 17 00:00:00 2001 +From: Sergiu Deitsch <sergiud@users.noreply.github.com> +Date: Wed, 23 Apr 2025 18:36:41 +0200 +Subject: [PATCH] Provide fallback for missing `char8_t` support (#4736) + +--- + .../nlohmann/detail/conversions/from_json.hpp | 5 +++- + .../nlohmann/detail/conversions/to_json.hpp | 21 ++++++++++----- + single_include/nlohmann/json.hpp | 26 +++++++++++++------ + tests/src/unit-deserialization.cpp | 5 ++-- + 4 files changed, 39 insertions(+), 18 deletions(-) + +diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp +index 797f714dfa..3a24a6f4d2 100644 +--- a/include/nlohmann/detail/conversions/from_json.hpp ++++ b/include/nlohmann/detail/conversions/from_json.hpp +@@ -539,7 +539,10 @@ inline void from_json(const BasicJsonType& j, std_fs::path& p) + JSON_THROW(type_error::create(302, concat("type must be string, but is ", j.type_name()), &j)); + } + const auto& s = *j.template get_ptr<const typename BasicJsonType::string_t*>(); +-#ifdef JSON_HAS_CPP_20 ++ // Checking for C++20 standard or later can be insufficient in case the ++ // library support for char8_t is either incomplete or was disabled ++ // altogether. Use the __cpp_lib_char8_t feature test instead. ++#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201907L) + p = std_fs::path(std::u8string_view(reinterpret_cast<const char8_t*>(s.data()), s.size())); + #else + p = std_fs::u8path(s); // accepts UTF-8 encoded std::string in C++17, deprecated in C++20 +diff --git a/include/nlohmann/detail/conversions/to_json.hpp b/include/nlohmann/detail/conversions/to_json.hpp +index f8413850d5..8b910dd161 100644 +--- a/include/nlohmann/detail/conversions/to_json.hpp ++++ b/include/nlohmann/detail/conversions/to_json.hpp +@@ -15,7 +15,8 @@ + + #include <algorithm> // copy + #include <iterator> // begin, end +-#include <string> // string ++#include <memory> // allocator_traits ++#include <string> // basic_string, char_traits + #include <tuple> // tuple, get + #include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type + #include <utility> // move, forward, declval, pair +@@ -440,15 +441,21 @@ inline void to_json(BasicJsonType& j, const T& t) + } + + #if JSON_HAS_FILESYSTEM || JSON_HAS_EXPERIMENTAL_FILESYSTEM ++#if defined(__cpp_lib_char8_t) ++template<typename BasicJsonType, typename Tr, typename Allocator> ++inline void to_json(BasicJsonType& j, const std::basic_string<char8_t, Tr, Allocator>& s) ++{ ++ using OtherAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<char>; ++ j = std::basic_string<char, std::char_traits<char>, OtherAllocator>(s.begin(), s.end(), s.get_allocator()); ++} ++#endif ++ + template<typename BasicJsonType> + inline void to_json(BasicJsonType& j, const std_fs::path& p) + { +-#ifdef JSON_HAS_CPP_20 +- const std::u8string s = p.u8string(); +- j = std::string(s.begin(), s.end()); +-#else +- j = p.u8string(); // returns std::string in C++17 +-#endif ++ // Returns either a std::string or a std::u8string depending whether library ++ // support for char8_t is enabled. ++ j = p.u8string(); + } + #endif + +diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp +index 13b07c0fbc..93e5983cf1 100644 +--- a/single_include/nlohmann/json.hpp ++++ b/single_include/nlohmann/json.hpp +@@ -5324,7 +5324,10 @@ inline void from_json(const BasicJsonType& j, std_fs::path& p) + JSON_THROW(type_error::create(302, concat("type must be string, but is ", j.type_name()), &j)); + } + const auto& s = *j.template get_ptr<const typename BasicJsonType::string_t*>(); +-#ifdef JSON_HAS_CPP_20 ++ // Checking for C++20 standard or later can be insufficient in case the ++ // library support for char8_t is either incomplete or was disabled ++ // altogether. Use the __cpp_lib_char8_t feature test instead. ++#if defined(__cpp_lib_char8_t) && (__cpp_lib_char8_t >= 201907L) + p = std_fs::path(std::u8string_view(reinterpret_cast<const char8_t*>(s.data()), s.size())); + #else + p = std_fs::u8path(s); // accepts UTF-8 encoded std::string in C++17, deprecated in C++20 +@@ -5379,7 +5382,8 @@ NLOHMANN_JSON_NAMESPACE_END + + #include <algorithm> // copy + #include <iterator> // begin, end +-#include <string> // string ++#include <memory> // allocator_traits ++#include <string> // basic_string, char_traits + #include <tuple> // tuple, get + #include <type_traits> // is_same, is_constructible, is_floating_point, is_enum, underlying_type + #include <utility> // move, forward, declval, pair +@@ -6086,15 +6090,21 @@ inline void to_json(BasicJsonType& j, const T& t) + } + + #if JSON_HAS_FILESYSTEM || JSON_HAS_EXPERIMENTAL_FILESYSTEM ++#if defined(__cpp_lib_char8_t) ++template<typename BasicJsonType, typename Tr, typename Allocator> ++inline void to_json(BasicJsonType& j, const std::basic_string<char8_t, Tr, Allocator>& s) ++{ ++ using OtherAllocator = typename std::allocator_traits<Allocator>::template rebind_alloc<char>; ++ j = std::basic_string<char, std::char_traits<char>, OtherAllocator>(s.begin(), s.end(), s.get_allocator()); ++} ++#endif ++ + template<typename BasicJsonType> + inline void to_json(BasicJsonType& j, const std_fs::path& p) + { +-#ifdef JSON_HAS_CPP_20 +- const std::u8string s = p.u8string(); +- j = std::string(s.begin(), s.end()); +-#else +- j = p.u8string(); // returns std::string in C++17 +-#endif ++ // Returns either a std::string or a std::u8string depending whether library ++ // support for char8_t is enabled. ++ j = p.u8string(); + } + #endif + +diff --git a/tests/src/unit-deserialization.cpp b/tests/src/unit-deserialization.cpp +index 84a970a183..5c450c23d3 100644 +--- a/tests/src/unit-deserialization.cpp ++++ b/tests/src/unit-deserialization.cpp +@@ -1134,9 +1134,10 @@ TEST_CASE("deserialization") + } + } + +-// select the types to test - char8_t is only available in C++20 ++// select the types to test - char8_t is only available since C++20 if and only ++// if __cpp_char8_t is defined. + #define TYPE_LIST(...) __VA_ARGS__ +-#ifdef JSON_HAS_CPP_20 ++#if defined(__cpp_char8_t) && (__cpp_char8_t >= 201811L) + #define ASCII_TYPES TYPE_LIST(char, wchar_t, char16_t, char32_t, char8_t) + #else + #define ASCII_TYPES TYPE_LIST(char, wchar_t, char16_t, char32_t) diff --git a/dev-cpp/nlohmann_json/nlohmann_json-3.12.0.ebuild b/dev-cpp/nlohmann_json/nlohmann_json-3.12.0-r1.ebuild index 75276652d6fc..70f098895022 100644 --- a/dev-cpp/nlohmann_json/nlohmann_json-3.12.0.ebuild +++ b/dev-cpp/nlohmann_json/nlohmann_json-3.12.0-r1.ebuild @@ -28,6 +28,8 @@ RESTRICT="!test? ( test )" DOCS=( ChangeLog.md README.md ) +PATCHES=( "${FILESDIR}/${PN}-3.12.0-fallback-missing-char8_t.patch" ) + src_prepare() { if use test ; then ln -s "${WORKDIR}"/json_test_data-${TEST_VERSION} "${S}"/json_test_data || die diff --git a/dev-cpp/websocketpp/Manifest b/dev-cpp/websocketpp/Manifest index 059355f89226..180d626c386e 100644 --- a/dev-cpp/websocketpp/Manifest +++ b/dev-cpp/websocketpp/Manifest @@ -1 +1,2 @@ +DIST websocketpp-0.8.2-boost-1.87-compat.patch.xz 17316 BLAKE2B 11f43ba92b9e8c10c7833fa2a423cfc0ca6d66721db388c6f08003a1141669bed0aec790a41964ddd9399eb18c627e01054b7c0247cbedfca7111869e4909ddf SHA512 21ee3e279722c3761328475b437ce57e38455df83ef9e291802520047164c7cb879430b541623212e320d1a55b10d17b77fe97b73d1846069a240032b7b82db7 DIST websocketpp-0.8.2.tar.gz 701364 BLAKE2B dacee33832f493d465afe208f9edea1393414a22c8db8f8c86b8f913521d0d8d68b95673a2e82b7479acfbab1ac541eda2d713a55d5de387b3879461d5884df7 SHA512 b2afc63edb69ce81a3a6c06b3d857b3e8820f0e22300ac32bb20ab30ff07bd58bd5ada3e526ed8ab52de934e0e3a26cad2118b0e68ecf3e5e9e8d7101348fd06 diff --git a/dev-cpp/websocketpp/files/websocketpp-0.8.2-c++20-compat.patch b/dev-cpp/websocketpp/files/websocketpp-0.8.2-c++20-compat.patch new file mode 100644 index 000000000000..2989acd4a0bd --- /dev/null +++ b/dev-cpp/websocketpp/files/websocketpp-0.8.2-c++20-compat.patch @@ -0,0 +1,94 @@ +From 3197a520eb4c1e4754860441918a5930160373eb Mon Sep 17 00:00:00 2001 +From: Peter Thorson <git@zaphoyd.com> +Date: Tue, 29 Jun 2021 09:13:12 -0500 +Subject: [PATCH] [core] Remove the use of simple template ids as they have + been removed in c++20. + https://timsong-cpp.github.io/cppwp/n4861/diff.cpp17.class#2 references #991 + +--- a/websocketpp/endpoint.hpp ++++ b/websocketpp/endpoint.hpp +@@ -111,7 +111,7 @@ class endpoint : public config::transport_type, public config::endpoint_base { + + + /// Destructor +- ~endpoint<connection,config>() {} ++ ~endpoint() {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy constructor because endpoints are not copyable +--- a/websocketpp/logger/basic.hpp ++++ b/websocketpp/logger/basic.hpp +@@ -58,33 +58,33 @@ namespace log { + template <typename concurrency, typename names> + class basic { + public: +- basic<concurrency,names>(channel_type_hint::value h = ++ basic(channel_type_hint::value h = + channel_type_hint::access) + : m_static_channels(0xffffffff) + , m_dynamic_channels(0) + , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} + +- basic<concurrency,names>(std::ostream * out) ++ basic(std::ostream * out) + : m_static_channels(0xffffffff) + , m_dynamic_channels(0) + , m_out(out) {} + +- basic<concurrency,names>(level c, channel_type_hint::value h = ++ basic(level c, channel_type_hint::value h = + channel_type_hint::access) + : m_static_channels(c) + , m_dynamic_channels(0) + , m_out(h == channel_type_hint::error ? &std::cerr : &std::cout) {} + +- basic<concurrency,names>(level c, std::ostream * out) ++ basic(level c, std::ostream * out) + : m_static_channels(c) + , m_dynamic_channels(0) + , m_out(out) {} + + /// Destructor +- ~basic<concurrency,names>() {} ++ ~basic() {} + + /// Copy constructor +- basic<concurrency,names>(basic<concurrency,names> const & other) ++ basic(basic<concurrency,names> const & other) + : m_static_channels(other.m_static_channels) + , m_dynamic_channels(other.m_dynamic_channels) + , m_out(other.m_out) +@@ -97,7 +97,7 @@ class basic { + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ + /// Move constructor +- basic<concurrency,names>(basic<concurrency,names> && other) ++ basic(basic<concurrency,names> && other) + : m_static_channels(other.m_static_channels) + , m_dynamic_channels(other.m_dynamic_channels) + , m_out(other.m_out) +--- a/websocketpp/roles/server_endpoint.hpp ++++ b/websocketpp/roles/server_endpoint.hpp +@@ -75,11 +75,11 @@ class server : public endpoint<connection<config>,config> { + } + + /// Destructor +- ~server<config>() {} ++ ~server() {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no copy constructor because endpoints are not copyable +- server<config>(server<config> &) = delete; ++ server(server<config> &) = delete; + + // no copy assignment operator because endpoints are not copyable + server<config> & operator=(server<config> const &) = delete; +@@ -87,7 +87,7 @@ class server : public endpoint<connection<config>,config> { + + #ifdef _WEBSOCKETPP_MOVE_SEMANTICS_ + /// Move constructor +- server<config>(server<config> && o) : endpoint<connection<config>,config>(std::move(o)) {} ++ server(server<config> && o) : endpoint<connection<config>,config>(std::move(o)) {} + + #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ + // no move assignment operator because of const member variables diff --git a/dev-cpp/websocketpp/websocketpp-0.8.2-r1.ebuild b/dev-cpp/websocketpp/websocketpp-0.8.2-r1.ebuild new file mode 100644 index 000000000000..34177441a2c2 --- /dev/null +++ b/dev-cpp/websocketpp/websocketpp-0.8.2-r1.ebuild @@ -0,0 +1,56 @@ +# Copyright 1999-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake + +DESCRIPTION="C++/Boost Asio based websocket client/server library" +HOMEPAGE="https://www.zaphoyd.com/websocketpp" +SRC_URI=" + https://github.com/zaphoyd/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz + https://dev.gentoo.org/~sbraz/${P}-boost-1.87-compat.patch.xz +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~sparc ~x86" +IUSE="examples test" +RESTRICT="!test? ( test )" + +DEPEND="test? ( dev-libs/boost )" +RDEPEND="dev-libs/boost" + +PATCHES=( + "${FILESDIR}"/${PN}-0.7.0-cmake-install.patch + # disable tests that are timing sensitive + # https://bugzilla.redhat.com/show_bug.cgi?id=1461069 + "${FILESDIR}"/${PN}-0.8.1-disable-test_transport-test_transport_asio_timers.patch + # https://github.com/zaphoyd/websocketpp/commit/36b73da8958927f975b3d01a062aa6c0e149d97f + "${FILESDIR}"/${P}-fix-boost_find_component.patch + # https://github.com/zaphoyd/websocketpp/commit/2c355d9ef0f3ed73fa96d0c6c31293086df36d74 + "${FILESDIR}"/${P}-fix-clang.patch + # C++20 support from https://github.com/zaphoyd/websocketpp/commit/3197a520eb4c1e4754860441918a5930160373eb + # Fixes https://github.com/zaphoyd/websocketpp/issues/991 / https://bugs.gentoo.org/939739 + "${FILESDIR}/${P}-c++20-compat.patch" + # From https://github.com/zaphoyd/websocketpp/pull/1164 + "${WORKDIR}/${P}-boost-1.87-compat.patch" +) + +src_configure() { + local mycmakeargs=( + -DENABLE_CPP11=ON + -DBUILD_TESTS="$(usex test)" + ) + + cmake_src_configure +} + +src_install() { + cmake_src_install + + if use examples; then + dodoc -r examples + docompress -x /usr/share/doc/${PF}/examples + fi +} |
