From b8661fc4cb266618ea49f143f945e078476db6e1 Mon Sep 17 00:00:00 2001 From: Moraxyc Date: Fri, 9 May 2025 13:14:03 +0800 Subject: [PATCH] cpp-netlib: pin Boost to 1.86; LLVM to 18 on Darwin --- .../0001-Compatibility-with-boost-1.83.patch | 33 +++++++++++++++++++ pkgs/by-name/cp/cpp-netlib/package.nix | 18 +++++++--- 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 pkgs/by-name/cp/cpp-netlib/0001-Compatibility-with-boost-1.83.patch diff --git a/pkgs/by-name/cp/cpp-netlib/0001-Compatibility-with-boost-1.83.patch b/pkgs/by-name/cp/cpp-netlib/0001-Compatibility-with-boost-1.83.patch new file mode 100644 index 000000000000..2c860aaba4f7 --- /dev/null +++ b/pkgs/by-name/cp/cpp-netlib/0001-Compatibility-with-boost-1.83.patch @@ -0,0 +1,33 @@ +From 8be99f5972826c25378bccb9fbd7291623c7b2a7 Mon Sep 17 00:00:00 2001 +From: Moraxyc +Date: Fri, 9 May 2025 13:39:17 +0800 +Subject: [PATCH] Compatibility with boost 1.83 + +--- + boost/network/protocol/http/server/impl/parsers.ipp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/boost/network/protocol/http/server/impl/parsers.ipp b/boost/network/protocol/http/server/impl/parsers.ipp +index c31e60e..3272c2f 100755 +--- a/boost/network/protocol/http/server/impl/parsers.ipp ++++ b/boost/network/protocol/http/server/impl/parsers.ipp +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + + #ifdef BOOST_NETWORK_NO_LIB + #ifndef BOOST_NETWORK_INLINE +@@ -32,7 +33,7 @@ typedef std::basic_string u32_string; + template <> // + struct assign_to_container_from_value { + static void call(u32_string const& val, std::string& attr) { +- u32_to_u8_iterator begin = val.begin(), ++ boost::u32_to_u8_iterator begin = val.begin(), + end = val.end(); + for (; begin != end; ++begin) attr += *begin; + } +-- +2.48.1 + diff --git a/pkgs/by-name/cp/cpp-netlib/package.nix b/pkgs/by-name/cp/cpp-netlib/package.nix index decceeb7a845..466884fbbd33 100644 --- a/pkgs/by-name/cp/cpp-netlib/package.nix +++ b/pkgs/by-name/cp/cpp-netlib/package.nix @@ -3,11 +3,15 @@ stdenv, fetchFromGitHub, cmake, - boost181, + boost186, openssl, + llvmPackages_18, }: - -stdenv.mkDerivation rec { +let + # std::char_traits has been removed + stdenvForCppNetlib = if stdenv.hostPlatform.isDarwin then llvmPackages_18.stdenv else stdenv; +in +stdenvForCppNetlib.mkDerivation rec { pname = "cpp-netlib"; version = "0.13.0-final"; @@ -19,9 +23,15 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + patches = [ + # 'u32_to_u8_iterator' was not declared + ./0001-Compatibility-with-boost-1.83.patch + ]; + nativeBuildInputs = [ cmake ]; buildInputs = [ - boost181 + # io_service.hpp has been removed in boost 1.87+ + boost186 openssl ];