maxima, sage: Simplify lisp-compiler arguments namings

Make clearer the difference between `maxima` and `maxima-ecl` top-level
attributes. Use the `lisp-compiler` as a passthru for all of sage's
expressions. Add the `pname` attribute for `ecl` for compatibility with
other lisp implementations.
This commit is contained in:
Doron Behar 2021-11-29 14:43:39 +02:00
parent 8d17f4babf
commit 57ab62314b
9 changed files with 32 additions and 41 deletions

View File

@ -10,17 +10,13 @@
, rlwrap ? null
, tk ? null
, gnuplot ? null
, ecl ? null
, ecl-fasl ? false
, sbcl
, lisp-compiler
}:
let
lisp-compiler = if ecl-fasl then ecl else sbcl;
searchPath =
lib.makeBinPath
(lib.filter (x: x != null) [ lisp-compiler rlwrap tk gnuplot ]);
# Allow to remove some executables from the $PATH of the wrapped binary
searchPath = lib.makeBinPath
(lib.filter (x: x != null) [ lisp-compiler rlwrap tk gnuplot ]);
in
stdenv.mkDerivation rec {
pname = "maxima";
@ -59,7 +55,7 @@ stdenv.mkDerivation rec {
ln -s ../maxima/${version}/emacs $out/share/emacs/site-lisp
ln -s ../maxima/${version}/doc $out/share/doc/maxima
''
+ (lib.optionalString ecl-fasl ''
+ (lib.optionalString (lisp-compiler.pname == "ecl") ''
cp src/binary-ecl/maxima.fas* "$out/lib/maxima/${version}/binary-ecl/"
'')
;
@ -83,7 +79,7 @@ stdenv.mkDerivation rec {
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/undoing_true_false_printing_patch.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
sha256 = "0fvi3rcjv6743sqsbgdzazy9jb6r1p1yq63zyj9fx42wd1hgf7yx";
})
] ++ lib.optionals ecl-fasl [
] ++ lib.optionals (lisp-compiler.pname == "ecl") [
# build fasl, needed for ECL support
(fetchpatch {
url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/maxima.system.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
@ -108,7 +104,7 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
passthru = {
ecl = ecl;
inherit lisp-compiler;
};
meta = with lib; {

View File

@ -15,7 +15,7 @@ let
sagelib = self.callPackage ./sagelib.nix {
inherit flint arb;
inherit sage-src env-locations pynac singular;
ecl = maxima-ecl.ecl;
inherit (maxima) lisp-compiler;
linbox = pkgs.linbox.override { withSage = true; };
pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
};
@ -48,9 +48,8 @@ let
# the files its looking fore are located. Also see `sage-env`.
env-locations = callPackage ./env-locations.nix {
inherit pari_data;
inherit singular maxima-ecl;
inherit singular maxima;
inherit three;
ecl = maxima-ecl.ecl;
cysignals = python3.pkgs.cysignals;
mathjax = nodePackages.mathjax;
};
@ -61,22 +60,21 @@ let
sagelib = python3.pkgs.sagelib;
sage_docbuild = python3.pkgs.sage_docbuild;
inherit env-locations;
inherit python3 singular palp flint pynac pythonEnv maxima-ecl;
ecl = maxima-ecl.ecl;
inherit python3 singular palp flint pynac pythonEnv maxima;
pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
};
# The documentation for sage, building it takes a lot of ram.
sagedoc = callPackage ./sagedoc.nix {
inherit sage-with-env;
inherit python3 maxima-ecl;
inherit python3 maxima;
};
# 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 sage-env;
inherit pynac singular maxima-ecl;
inherit pynac singular maxima;
inherit three;
pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
};
@ -118,8 +116,8 @@ let
singular = pkgs.singular.override { inherit flint; };
maxima-ecl = pkgs.maxima-ecl.override {
ecl = pkgs.ecl.override {
maxima = pkgs.maxima.override {
lisp-compiler = pkgs.ecl.override {
# "echo syntax error | ecl > /dev/full 2>&1" segfaults in
# ECL. We apply a patch to fix it (write_error.patch), but it
# only works if threads are disabled. sage 9.2 tests this

View File

@ -2,13 +2,12 @@
, pari_data
, pari
, singular
, maxima-ecl
, maxima
, conway_polynomials
, graphs
, elliptic_curves
, polytopes_db
, gap
, ecl
, combinatorial_designs
, jmol
, mathjax
@ -30,14 +29,14 @@ writeTextFile rec {
export SINGULAR_SO='${singular}/lib/libSingular.so'
export GAP_SO='${gap}/lib/libgap.so'
export SINGULAR_EXECUTABLE='${singular}/bin/Singular'
export MAXIMA_FAS='${maxima-ecl}/lib/maxima/${maxima-ecl.version}/binary-ecl/maxima.fas'
export MAXIMA_PREFIX="${maxima-ecl}"
export MAXIMA_FAS='${maxima}/lib/maxima/${maxima.version}/binary-ecl/maxima.fas'
export MAXIMA_PREFIX="${maxima}"
export CONWAY_POLYNOMIALS_DATA_DIR='${conway_polynomials}/share/conway_polynomials'
export GRAPHS_DATA_DIR='${graphs}/share/graphs'
export ELLCURVE_DATA_DIR='${elliptic_curves}/share/ellcurves'
export POLYTOPE_DATA_DIR='${polytopes_db}/share/reflexive_polytopes'
export GAP_ROOT_DIR='${gap}/share/gap/build-dir'
export ECLDIR='${ecl}/lib/ecl-${ecl.version}/'
export ECLDIR='${maxima.lisp-compiler}/lib/${maxima.lisp-compiler.pname}-${maxima.lisp-compiler.version}/'
export COMBINATORIAL_DESIGN_DATA_DIR="${combinatorial_designs}/share/combinatorial_designs"
export CREMONA_MINI_DATA_DIR="${elliptic_curves}/share/cremona"
export JMOL_DIR="${jmol}/share/jmol" # point to the directory that contains JmolData.jar

View File

@ -15,8 +15,7 @@
, pkg-config
, pari
, gap
, ecl
, maxima-ecl
, maxima
, singular
, fflas-ffpack
, givaro
@ -77,8 +76,8 @@ let
pkg-config
pari
gap
ecl
maxima-ecl
maxima.lisp-compiler
maxima
singular
giac
palp

View File

@ -9,7 +9,7 @@
, singular
, gap
, giac
, maxima-ecl
, maxima
, pari
, gmp
, gfan
@ -42,7 +42,7 @@ let
pari
gmp
gfan
maxima-ecl
maxima
eclib
flintqs
ntl

View File

@ -1,7 +1,7 @@
{ stdenv
, sage-with-env
, python3
, maxima-ecl
, maxima
, tachyon
, jmol
, cddlib
@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
buildInputs = [
sage-with-env.env.lib
python3
maxima-ecl
maxima
tachyon
jmol
cddlib

View File

@ -10,7 +10,7 @@
, cypari2
, cysignals
, cython
, ecl
, lisp-compiler
, eclib
, ecm
, flint
@ -74,7 +74,7 @@ buildPythonPackage rec {
jupyter_core
pkg-config
pip # needed to query installed packages
ecl
lisp-compiler
];
buildInputs = [
@ -92,7 +92,7 @@ buildPythonPackage rec {
arb
brial
cliquer
ecl
lisp-compiler
eclib
ecm
fflas-ffpack

View File

@ -28,7 +28,8 @@ let
];
in
stdenv.mkDerivation {
inherit (s) name version;
inherit (s) version;
pname = s.baseName;
inherit nativeBuildInputs propagatedBuildInputs;
src = fetchurl {

View File

@ -31880,12 +31880,10 @@ with pkgs;
};
maxima = callPackage ../applications/science/math/maxima {
ecl = null;
lisp-compiler = sbcl;
};
maxima-ecl = maxima.override {
inherit ecl;
ecl-fasl = true;
sbcl = null;
lisp-compiler = ecl;
};
mxnet = callPackage ../applications/science/math/mxnet {