From bd907828adfcb5779de5310d2a84307a5835c01b Mon Sep 17 00:00:00 2001 From: Andreas Wendleder Date: Tue, 3 Feb 2026 08:28:10 +0100 Subject: [PATCH] libngspice: fix build on Darwin with Clang Apply patch to remove redundant is_compound specialization in cppduals. This resolves a compilation error on macOS where the specialization conflicts with the standard library's type traits. --- pkgs/by-name/li/libngspice/package.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/by-name/li/libngspice/package.nix b/pkgs/by-name/li/libngspice/package.nix index 88a053851a55..8ea656c325cc 100644 --- a/pkgs/by-name/li/libngspice/package.nix +++ b/pkgs/by-name/li/libngspice/package.nix @@ -21,6 +21,24 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-8arYq6woKKe3HaZkEd6OQGUk518wZuRnVUOcSQRC1zQ="; }; + patches = [ + (builtins.toFile "fix-cppduals.patch" '' + --- a/src/include/cppduals/duals/dual + +++ b/src/include/cppduals/duals/dual + @@ -485,10 +485,6 @@ struct is_arithmetic> : is_arithmetic {}; + + #endif // CPPDUALS_ENABLE_IS_ARITHMETIC + + -/// Duals are compound types. + -template + -struct is_compound> : true_type {}; + - + // Modification of std::numeric_limits<> per + // C++03 17.4.3.1/1, and C++11 18.3.2.3/1. + template + '') + ]; + nativeBuildInputs = [ flex bison