diff --git a/pkgs/by-name/li/libofx/c++20-allocate.patch b/pkgs/by-name/li/libofx/c++20-allocate.patch new file mode 100644 index 000000000000..6be899da985e --- /dev/null +++ b/pkgs/by-name/li/libofx/c++20-allocate.patch @@ -0,0 +1,79 @@ +From e326ba971fd40687d5e66fb2949e0d2f53e6d8fd Mon Sep 17 00:00:00 2001 +From: Ludovic Rousseau +Date: Sat, 22 Aug 2026 15:46:10 +0200 +Subject: [PATCH] Use C++20 allocate() + +https://github.com/libofx/libofx/issues/105 +--- + lib/tree.hh | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/lib/tree.hh b/lib/tree.hh +index 3b42b28f..6bc62aa9 100644 +--- a/lib/tree.hh ++++ b/lib/tree.hh +@@ -467,8 +467,8 @@ tree::~tree() + template + void tree::head_initialise_() + { +- head = alloc_.allocate(1, 0); // MSVC does not have default second argument +- feet = alloc_.allocate(1, 0); ++ head = alloc_.allocate(1); ++ feet = alloc_.allocate(1); + + head->parent = 0; + head->first_child = 0; +@@ -743,7 +743,7 @@ iter tree::append_child(iter position) + { + assert(position.node != head); + +- tree_node* tmp = alloc_.allocate(1, 0); ++ tree_node* tmp = alloc_.allocate(1); + kp::constructor(&tmp->data); + tmp->first_child = 0; + tmp->last_child = 0; +@@ -773,7 +773,7 @@ iter tree::append_child(iter position, const T& x) + // the API change. + assert(position.node != head); + +- tree_node* tmp = alloc_.allocate(1, 0); ++ tree_node* tmp = alloc_.allocate(1); + kp::constructor(&tmp->data, x); + tmp->first_child = 0; + tmp->last_child = 0; +@@ -833,7 +833,7 @@ iter tree::insert(iter position, const T& x) + position.node = feet; // Backward compatibility: when calling insert on a null node, + // insert before the feet. + } +- tree_node* tmp = alloc_.allocate(1, 0); ++ tree_node* tmp = alloc_.allocate(1); + kp::constructor(&tmp->data, x); + tmp->first_child = 0; + tmp->last_child = 0; +@@ -856,7 +856,7 @@ iter tree::insert(iter position, const T& x) + template + typename tree::sibling_iterator tree::insert(sibling_iterator position, const T& x) + { +- tree_node* tmp = alloc_.allocate(1, 0); ++ tree_node* tmp = alloc_.allocate(1); + kp::constructor(&tmp->data, x); + tmp->first_child = 0; + tmp->last_child = 0; +@@ -889,7 +889,7 @@ template + template + iter tree::insert_after(iter position, const T& x) + { +- tree_node* tmp = alloc_.allocate(1, 0); ++ tree_node* tmp = alloc_.allocate(1); + kp::constructor(&tmp->data, x); + tmp->first_child = 0; + tmp->last_child = 0; +@@ -951,7 +951,7 @@ iter tree::replace(iter position, const iterator_base& f + + // replace the node at position with head of the replacement tree at from + erase_children(position); +- tree_node* tmp = alloc_.allocate(1, 0); ++ tree_node* tmp = alloc_.allocate(1); + kp::constructor(&tmp->data, (*from)); + tmp->first_child = 0; + tmp->last_child = 0; diff --git a/pkgs/by-name/li/libofx/package.nix b/pkgs/by-name/li/libofx/package.nix index d74091756ecd..4774c6dafabf 100644 --- a/pkgs/by-name/li/libofx/package.nix +++ b/pkgs/by-name/li/libofx/package.nix @@ -24,6 +24,12 @@ stdenv.mkDerivation (finalAttrs: { sha256 = "sha256-KOQrEAt1jHrOpPQ7QbGUADe0i7sQXNH2fblPRzT0EIg="; }; + # C++20 changes the signature of std::allocator::allocate. Vendored patch + # from the approved PR to fix this. + # https://github.com/libofx/libofx/issues/105 + # https://github.com/libofx/libofx/pull/106 + patches = [ ./c++20-allocate.patch ]; + preConfigure = "./autogen.sh"; configureFlags = [ "--with-opensp-includes=${opensp}/include/OpenSP" ]; nativeBuildInputs = [