From b9b4e09d6d60e2fe1b7f76ab4b39c37587eecbbd Mon Sep 17 00:00:00 2001 From: George Huebner Date: Thu, 18 Jul 2024 19:43:11 -0500 Subject: [PATCH] gfan: fix to pass sage doctests on clang This issue does not present at build time, but only in sage doctests. See https://www.github.com/sagemath/sage/issues/25118 --- pkgs/applications/science/math/gfan/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/gfan/default.nix b/pkgs/applications/science/math/gfan/default.nix index ee1fce783d26..531a30e3f857 100644 --- a/pkgs/applications/science/math/gfan/default.nix +++ b/pkgs/applications/science/math/gfan/default.nix @@ -1,4 +1,4 @@ -{lib, stdenv, fetchurl, gmp, mpir, cddlib}: +{lib, stdenv, fetchpatch, fetchurl, gmp, mpir, cddlib}: stdenv.mkDerivation rec { pname = "gfan"; version = "0.6.2"; @@ -10,6 +10,12 @@ stdenv.mkDerivation rec { patches = [ ./gfan-0.6.2-cddlib-prefix.patch + ] ++ lib.optionals (stdenv.cc.isClang) [ + (fetchpatch { + name = "clang-fix-miscompilation.patch"; + url = "https://raw.githubusercontent.com/sagemath/sage/eea1f59394a5066e9acd8ae39a90302820914ee3/build/pkgs/gfan/patches/nodel.patch"; + sha256 = "sha256-RrncSgFyrBIk/Bwe3accxiJ2rpOSJKQ84cV/uBvQsDc="; + }) ]; postPatch = lib.optionalString stdenv.cc.isClang ''