about summary refs log tree commit diff
path: root/pkgs/development/libraries/boost
diff options
context:
space:
mode:
authorRandy Eckenrode <randy@largeandhighquality.com>2023-05-31 16:15:28 -0400
committerRandy Eckenrode <randy@largeandhighquality.com>2023-06-29 23:32:02 -0400
commite3323ac20c3f0744f3f6128a5464652121eb8d4f (patch)
treed6d32c9b42ac8f1090daee98047d9adebd741b98 /pkgs/development/libraries/boost
parent7cb8db1c029996e57b1a9d04b75963d01d0955bc (diff)
boost{175,176,177,178,179,180}: fix build with libc++ 15+
libc++ 15 dropped support for `std::unary_function` and
`std::binary_function` in C++17 and C++20. C++17 is the default for
clang 16, but clang 15 is also affected in those language modes.

This incompatibility is fixed in Boost 1.81, but the late patch for
Boost 1.80 applies to earlier versions and allows those versions to
build with clang 16 (and clang 15 in the affected modes).
Diffstat (limited to 'pkgs/development/libraries/boost')
-rw-r--r--pkgs/development/libraries/boost/generic.nix11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 3b7aa4e464b20..09160bdcc8d28 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -109,7 +109,16 @@ stdenv.mkDerivation {
     url = "https://github.com/boostorg/math/commit/7d482f6ebc356e6ec455ccb5f51a23971bf6ce5b.patch";
     relative = "include";
     sha256 = "sha256-KlmIbixcds6GyKYt1fx5BxDIrU7msrgDdYo9Va/KJR4=";
-  });
+  })
+  ++ lib.optionals (lib.versionOlder version "1.81") [
+    # libc++ 15 dropped support for `std::unary_function` and `std::binary_function` in C++17+.
+    # C++17 is the default for clang 16, but clang 15 is also affected in that language mode.
+    # This patch is for Boost 1.80, but it also applies to earlier versions.
+    (fetchpatch {
+      url = "https://www.boost.org/patches/1_80_0/0005-config-libcpp15.patch";
+      hash = "sha256-ULFMzKphv70unvPZ3o4vSP/01/xbSM9a2TlIV67eXDQ=";
+    })
+  ];
 
   meta = with lib; {
     homepage = "http://boost.org/";