diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix index 4981767f21f2..55443f90c6f9 100644 --- a/pkgs/applications/science/math/maxima/default.nix +++ b/pkgs/applications/science/math/maxima/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, sbcl, texinfo, perl, python, makeWrapper, rlwrap ? null, tk ? null, gnuplot ? null }: +{ stdenv, fetchurl, sbcl, texinfo, perl, python, makeWrapper, rlwrap ? null, +tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false +}: let name = "maxima"; @@ -6,9 +8,9 @@ let searchPath = stdenv.lib.makeBinPath - (stdenv.lib.filter (x: x != null) [ sbcl rlwrap tk gnuplot ]); + (stdenv.lib.filter (x: x != null) [ sbcl ecl rlwrap tk gnuplot ]); in -stdenv.mkDerivation { +stdenv.mkDerivation ({ name = "${name}-${version}"; src = fetchurl { @@ -16,7 +18,8 @@ stdenv.mkDerivation { sha256 = "1p6646rvq43hk09msyp0dk50cqpkh07mf4x0bc2fqisqmcv6b1hf"; }; - buildInputs = [sbcl 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. @@ -27,7 +30,11 @@ stdenv.mkDerivation { mkdir -p $out/share/emacs $out/share/doc ln -s ../maxima/${version}/emacs $out/share/emacs/site-lisp ln -s ../maxima/${version}/doc $out/share/doc/maxima - ''; + '' + + (stdenv.lib.optionalString ecl-fasl '' + cp src/binary-ecl/maxima.fas* "$out/lib/maxima/${version}/binary-ecl/" + '') + ; # 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: @@ -51,4 +58,8 @@ stdenv.mkDerivation { platforms = stdenv.lib.platforms.unix; maintainers = [ stdenv.lib.maintainers.peti ]; }; -} +} // (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 + ''; +})) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2ef9516b0809..6ce4deb9448c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16696,7 +16696,8 @@ in geogebra = callPackage ../applications/science/math/geogebra { }; - maxima = callPackage ../applications/science/math/maxima { }; + maxima = callPackage ../applications/science/math/maxima { ecl = null; }; + maxima-ecl = callPackage ../applications/science/math/maxima { sbcl = null; }; wxmaxima = callPackage ../applications/science/math/wxmaxima { wxGTK = wxGTK30; };