From 09bad324a9dc233cdb2a3f7a51a9649e5be4eda5 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Fri, 27 Oct 2023 09:03:51 -0400 Subject: [PATCH] aria2: fix build with clang 16 Cherry-pick a commit from upstream, which removes usage of `std::unary_function` and `std::binary_function`. These were dropped in C++17, which is the default with clang 16. --- pkgs/tools/networking/aria2/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/aria2/default.nix b/pkgs/tools/networking/aria2/default.nix index 6c972bb23971..6e9d7f826170 100644 --- a/pkgs/tools/networking/aria2/default.nix +++ b/pkgs/tools/networking/aria2/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook +{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, autoreconfHook , gnutls, c-ares, libxml2, sqlite, zlib, libssh2 , cppunit, sphinx , Security @@ -15,6 +15,15 @@ stdenv.mkDerivation rec { sha256 = "sha256-ErjFfSJDIgZq0qy0Zn5uZ9bZS2AtJq4FuBVuUuQgPTI="; }; + patches = [ + # Fixes build errors clang 16 because `std::unary_function` and `std::binary_function` + # were removed in C++17, which is the default with clang 16. + (fetchpatch { + url = "https://github.com/aria2/aria2/commit/8956c58d126a4e57e114f69ba6a5961724b7a817.patch"; + hash = "sha256-bwcR0YHlkxUdz1AKHq1m2bYI9vDVMv4x3WPsR8QEHtk="; + }) + ]; + strictDeps = true; nativeBuildInputs = [ pkg-config autoreconfHook sphinx ];