From 25fb57e937e54849721d8bc3b8b89cfa08346078 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Sat, 11 Jul 2026 19:52:32 -0400 Subject: [PATCH 1/2] sage: disable ntl threading on all platforms Configure ntl dependency with NTL_THREADS=off, following how official sage builds configure it: https://github.com/sagemath/sage/blob/80e56eaeb7089cfc5e4e0cc495ba8da43ee0a573/build/pkgs/ntl/spkg-install.in#L102 --- pkgs/by-name/sa/sage/package.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/by-name/sa/sage/package.nix b/pkgs/by-name/sa/sage/package.nix index bc4223cea5af..44300857e8de 100644 --- a/pkgs/by-name/sa/sage/package.nix +++ b/pkgs/by-name/sa/sage/package.nix @@ -12,12 +12,19 @@ let inherit (pkgs) symlinkJoin callPackage mathjax; + ntl = pkgs.ntl.overrideAttrs (old: { + configureFlags = (old.configureFlags or [ ]) ++ [ + "NTL_THREADS=off" + ]; + }); + python3 = pkgs.python3 // { pkgs = pkgs.python3.pkgs.overrideScope ( self: super: { # `sagelib`, i.e. all of sage except some wrappers and runtime dependencies sagelib = self.callPackage ./sagelib.nix { inherit flint; + inherit ntl; inherit sage-src env-locations singular; inherit (maxima) lisp-compiler; linbox = pkgs.linbox; @@ -80,6 +87,7 @@ let singular palp flint + ntl pythonEnv maxima ; @@ -94,6 +102,7 @@ let # sagelib with added wrappers and a dependency on sage-tests to make sure thet tests were run. sage-with-env = callPackage ./sage-with-env.nix { inherit python3 pythonEnv; + inherit ntl; inherit sage-env; inherit singular maxima; inherit three; From 8a9d8cf6d0072dbd57ccf99785645fd3f5b44aa7 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Fri, 17 Jul 2026 21:42:04 -0400 Subject: [PATCH 2/2] sage: scope the ntl threads disablement to darwin --- pkgs/by-name/sa/sage/package.nix | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/sa/sage/package.nix b/pkgs/by-name/sa/sage/package.nix index 44300857e8de..54d5323a1712 100644 --- a/pkgs/by-name/sa/sage/package.nix +++ b/pkgs/by-name/sa/sage/package.nix @@ -1,5 +1,6 @@ { pkgs, + stdenv, withDoc ? false, requireSageTests ? true, extraPythonPackages ? ps: [ ], @@ -12,11 +13,16 @@ let inherit (pkgs) symlinkJoin callPackage mathjax; - ntl = pkgs.ntl.overrideAttrs (old: { - configureFlags = (old.configureFlags or [ ]) ++ [ - "NTL_THREADS=off" - ]; - }); + ntl = ( + if stdenv.hostPlatform.isDarwin then + (pkgs.ntl.overrideAttrs (old: { + configureFlags = (old.configureFlags or [ ]) ++ [ + "NTL_THREADS=off" + ]; + })) + else + pkgs.ntl + ); python3 = pkgs.python3 // { pkgs = pkgs.python3.pkgs.overrideScope (