about summary refs log tree commit diff
path: root/pkgs/applications/science/math
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/math')
-rw-r--r--pkgs/applications/science/math/R/default.nix7
-rw-r--r--pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch13
-rw-r--r--pkgs/applications/science/math/sage/sage-src.nix3
3 files changed, 22 insertions, 1 deletions
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index a791f9a57727..bc0f7ed88316 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -4,6 +4,9 @@
 , curl, Cocoa, Foundation, libobjc, libcxx, tzdata, fetchpatch
 , withRecommendedPackages ? true
 , enableStrictBarrier ? false
+# R as of writing does not support outputting both .so and .a files; it outputs:
+#     --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
+, static ? false
 , javaSupport ? (!stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isAarch64)
 }:
 
@@ -33,6 +36,8 @@ stdenv.mkDerivation rec {
     substituteInPlace configure --replace "-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
   '';
 
+  dontDisableStatic = static;
+
   preConfigure = ''
     configureFlagsArray=(
       --disable-lto
@@ -47,7 +52,7 @@ stdenv.mkDerivation rec {
       --with-libtiff
       --with-ICU
       ${stdenv.lib.optionalString enableStrictBarrier "--enable-strict-barrier"}
-      --enable-R-shlib
+      ${if static then "--enable-R-static-lib" else "--enable-R-shlib"}
       AR=$(type -p ar)
       AWK=$(type -p gawk)
       CC=$(type -p cc)
diff --git a/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch b/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch
new file mode 100644
index 000000000000..5c1073e13e96
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch
@@ -0,0 +1,13 @@
+diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py
+index bd6b76ab82..f8340a8c66 100644
+--- a/src/sage/tests/cmdline.py
++++ b/src/sage/tests/cmdline.py
+@@ -872,7 +872,7 @@ def test_executable(args, input="", timeout=100.0, **kwds):
+         sage: with open(input, 'w') as F:
+         ....:     _ = F.write(s)
+         sage: test_executable(["sage", "--rst2sws", input, output]) # py2
+-        ('', '', 0)
++        ('', '...', 0)
+         sage: import tarfile # py2
+         sage: f = tarfile.open(output, 'r') # py2
+         sage: print(f.extractfile('sage_worksheet/worksheet.html').read()) # py2
diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix
index dc9c9b5c874f..c7a3da68b15e 100644
--- a/pkgs/applications/science/math/sage/sage-src.nix
+++ b/pkgs/applications/science/math/sage/sage-src.nix
@@ -104,6 +104,9 @@ stdenv.mkDerivation rec {
       url = "https://git.sagemath.org/sage.git/patch?id=d27dc479a5772d59e4bc85d805b6ffd595284f1d";
       sha256 = "1nf1s9y7n30lhlbdnam7sghgaq9nasmv96415gl5jlcf7a3hlxk3";
     })
+
+    # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests
+    ./patches/ignore-cmp-deprecation.patch
   ];
 
   patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;