@@ -1,4 +1,6 @@
1−{ stdenv, fetchurl, sbcl, texinfo, perl, python, makeWrapper, rlwrap ? null, tk ? null, gnuplot ? null }:
1+{ stdenv, fetchurl, sbcl, texinfo, perl, python, makeWrapper, rlwrap ? null,
2+tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false
3+}:
24
35let
46 name = "maxima";
@@ -6,9 +8,9 @@ let
68
79 searchPath =
810 stdenv.lib.makeBinPath
9− (stdenv.lib.filter (x: x != null) [ sbcl rlwrap tk gnuplot ]);
11+ (stdenv.lib.filter (x: x != null) [ sbcl ecl rlwrap tk gnuplot ]);
1012in
11−stdenv.mkDerivation {
13+stdenv.mkDerivation ({
1214 name = "${name}-${version}";
1315
1416 src = fetchurl {
@@ -16,7 +18,8 @@ stdenv.mkDerivation {
1618 sha256 = "1p6646rvq43hk09msyp0dk50cqpkh07mf4x0bc2fqisqmcv6b1hf";
1719 };
1820
19− buildInputs = [sbcl texinfo perl python makeWrapper];
21+ buildInputs = stdenv.lib.filter (x: x != null)
22+ [sbcl ecl texinfo perl python makeWrapper];
2023
2124 postInstall = ''
2225 # Make sure that maxima can find its runtime dependencies.
@@ -27,7 +30,11 @@ stdenv.mkDerivation {
2730 mkdir -p $out/share/emacs $out/share/doc
2831 ln -s ../maxima/${version}/emacs $out/share/emacs/site-lisp
2932 ln -s ../maxima/${version}/doc $out/share/doc/maxima
30− '';
33+ ''
34+ + (stdenv.lib.optionalString ecl-fasl ''
35+ cp src/binary-ecl/maxima.fas* "$out/lib/maxima/${version}/binary-ecl/"
36+ '')
37+ ;
3138
3239 # Failures in the regression test suite won't abort the build process. We run
3340 # the suite only so that potential errors show up in the build log. See also:
@@ -51,4 +58,8 @@ stdenv.mkDerivation {
5158 platforms = stdenv.lib.platforms.unix;
5259 maintainers = [ stdenv.lib.maintainers.peti ];
5360 };
54−}
61+} // (stdenv.lib.optionalAttrs ecl-fasl {
62+ preConfigure = ''
63+ 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
64+ '';
65+}))