summary refs log tree commit diff
path: root/pkgs/applications/science/math
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2018-04-11 22:53:59 +0200
committerTimo Kaufmann <timokau@zoho.com>2018-04-12 00:46:40 +0200
commiteb119b045a28c34d3d6dcd179a381bcb658c6977 (patch)
tree6ecc9cb3a368976f42eee518cfbbbd1310a8454a /pkgs/applications/science/math
parent19a6f0e02bfc2f5c605d57e7487fa84dc74981bf (diff)
downloadnixlib-eb119b045a28c34d3d6dcd179a381bcb658c6977.tar
nixlib-eb119b045a28c34d3d6dcd179a381bcb658c6977.tar.gz
nixlib-eb119b045a28c34d3d6dcd179a381bcb658c6977.tar.bz2
nixlib-eb119b045a28c34d3d6dcd179a381bcb658c6977.tar.lz
nixlib-eb119b045a28c34d3d6dcd179a381bcb658c6977.tar.xz
nixlib-eb119b045a28c34d3d6dcd179a381bcb658c6977.tar.zst
nixlib-eb119b045a28c34d3d6dcd179a381bcb658c6977.zip
maxima: add various fixes, re-add ecl support
Diffstat (limited to 'pkgs/applications/science/math')
-rw-r--r--pkgs/applications/science/math/maxima/default.nix50
1 files changed, 40 insertions, 10 deletions
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index d6d3b505e35b..c3eeddef6694 100644
--- a/pkgs/applications/science/math/maxima/default.nix
+++ b/pkgs/applications/science/math/maxima/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, sbcl, texinfo, perl, python, makeWrapper, rlwrap ? null,
-tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false
+{ stdenv, fetchurl, fetchpatch, sbcl, texinfo, perl, python, makeWrapper, rlwrap ? null
+, tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false
 }:
 
 let
@@ -11,6 +11,7 @@ let
       (stdenv.lib.filter (x: x != null) [ sbcl ecl rlwrap tk gnuplot ]);
 in
 stdenv.mkDerivation ({
+  inherit version;
   name = "${name}-${version}";
 
   src = fetchurl {
@@ -18,8 +19,9 @@ stdenv.mkDerivation ({
     sha256 = "0x0n81z0s4pl8nwpf7ivlsbvsdphm9w42250g7qdkizl0132by6s";
   };
 
-  buildInputs = stdenv.lib.filter (x: x != null)
-    [sbcl ecl texinfo perl python makeWrapper];
+  buildInputs = stdenv.lib.filter (x: x != null) [
+    sbcl ecl texinfo perl python makeWrapper
+  ];
 
   postInstall = ''
     # Make sure that maxima can find its runtime dependencies.
@@ -36,6 +38,39 @@ stdenv.mkDerivation ({
    '')
   ;
 
+  patches = [
+    # fix path to info dir (see https://trac.sagemath.org/ticket/11348)
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/infodir.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "09v64n60f7i6frzryrj0zd056lvdpms3ajky4f9p6kankhbiv21x";
+    })
+
+    # fix https://sourceforge.net/p/maxima/bugs/2596/
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/matrixexp.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "06961hn66rhjijfvyym21h39wk98sfxhp051da6gz0n9byhwc6zg";
+    })
+
+    # undo https://sourceforge.net/p/maxima/code/ci/f5e9b0f7eb122c4e48ea9df144dd57221e5ea0ca, see see https://trac.sagemath.org/ticket/13364#comment:93
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/undoing_true_false_printing_patch.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0fvi3rcjv6743sqsbgdzazy9jb6r1p1yq63zyj9fx42wd1hgf7yx";
+    })
+
+    # upstream bug https://sourceforge.net/p/maxima/bugs/2520/ (not fixed)
+    # introduced in https://trac.sagemath.org/ticket/13364
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/0001-taylor2-Avoid-blowing-the-stack-when-diff-expand-isn.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0xa0b6cr458zp7lc7qi0flv5ar0r3ivsqhjl0c3clv86di2y522d";
+    })
+  ] ++ stdenv.lib.optionals ecl-fasl [
+    # build fasl, needed for ECL support
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/maxima.system.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "18zafig8vflhkr80jq2ivk46k92dkszqlyq8cfmj0b2vcfjwwbar";
+    })
+  ];
+
   # Failures in the regression test suite won't abort the build process. We run
   # the suite only so that potential errors show up in the build log. See also:
   # http://sourceforge.net/tracker/?func=detail&aid=3365831&group_id=4933&atid=104933.
@@ -57,10 +92,5 @@ stdenv.mkDerivation ({
 
     platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.peti ];
-    broken = ecl != null;
   };
-} // (stdenv.lib.optionalAttrs ecl-fasl {
-  preConfigure = ''
-    sed -e '/c::build-program "binary-ecl\/maxima"/i(c::build-fasl "binary-ecl\/maxima.fasl" :lisp-files obj :ld-flags (let ((x (symbol-value (find-symbol "*AUTOCONF-LD-FLAGS*" (find-package "MAXIMA"))))) (if (and x (not (string= x ""))) (list x))))' -i src/maxima.system
-  '';
-}))
+})