diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix index 98b75cd22d05..24063216db04 100644 --- a/pkgs/applications/science/math/singular/default.nix +++ b/pkgs/applications/science/math/singular/default.nix @@ -1,5 +1,6 @@ { stdenv, fetchurl, gmp, bison, perl, ncurses, readline, coreutils, pkgconfig , lib +, fetchpatch , autoreconfHook , file , flint @@ -36,6 +37,18 @@ stdenv.mkDerivation rec { patchShebangs . ''; + patches = [ + # NTL error handler was introduced in the library part, preventing users of + # the library from implementing their own error handling + # https://www.singular.uni-kl.de/forum/viewtopic.php?t=2769 + (fetchpatch { + name = "move_error_handler_out_of_libsingular.patch"; + # rebased version of https://github.com/Singular/Sources/commit/502cf86d0bb2a96715be6764774b64a69c1ca34c.patch + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/singular/patches/singular-ntl-error-handler.patch?h=50b9ae2fd233c30860e1cbb3e63a26f2cc10560a"; + sha256 = "0vgh4m9zn1kjl0br68n04j4nmn5i1igfn28cph0chnwf7dvr9194"; + }) + ]; + # For reference (last checked on commit 75f460d): # https://github.com/Singular/Sources/blob/spielwiese/doc/Building-Singular-from-source.md # https://github.com/Singular/Sources/blob/spielwiese/doc/external-packages-dynamic-modules.md