diff mbox

[bug#56729,RFC,00/10] Add sagemath.

Message ID YvJj5cXfFQs5RpR3@localhost
State New
Headers show

Commit Message

vicvbcun Aug. 9, 2022, 1:40 p.m. UTC
On 2022-08-09T12:47:27+0200, Andreas Enge wrote:
> thanks for the update! I just pushed an update of maxima (and wxmaxima), but
> without your addition of ecl. Is there a good reason for this? In any case,
> this should be done in a separate commit, since it is not required for the
> update. For the record, I also tried to compile with gcl, but this still
> failed.
SageMath requires the FASL library? (I only know scheme) `maxima.fas'.
But it is only built when using ecl (See upstream here [0]). I don't
know if we need both sbcl and ecl. Arch uses both and puts the
lib/.../binary-* directories in separate packages[1], so maybe we could
use different outputs? Anyway, I have attached an rebased commit that
adds ecl.

> > > Concerning sagemath itself, below is my very old version of an attempt at
> > > packaging the library. Some things look reassuringly similar, my handling
> > > of the number of cores is less nice, but I do delete the bundled packages.
> > The `upstream' directory only seems to exist in the published tarball.
> > So this should be no problem if we build from git.
> 
> Ah, interesting. Which one should we do? I personally tend to prefer tarballs
> (as the official distribution mechanism of the project). Recently there has
> been a preference in the Guix project for git repositories when autotools
> are involved, as they make it possible to recreate the configure scripts
> from their source. But since this is not the case here, the argument does
> not hold.
The sage tarball is 1.35 GiB while the repository is only about 440 MiB.
That seems quite convincing on its own.

[0]:
https://sourceforge.net/p/maxima/patches/80/
[1]:
https://github.com/archlinux/svntogit-packages/blob/packages/maxima/trunk/PKGBUILD
From cb877ee5091d801e08654ac55adaab1b5edfec91 Mon Sep 17 00:00:00 2001
Message-Id: <cb877ee5091d801e08654ac55adaab1b5edfec91.1660051561.git.guix@ikherbers.com>
From: vicvbcun <guix@ikherbers.com>
Date: Sat, 6 Aug 2022 18:00:19 +0200
Subject: [PATCH] gnu: maxima: Build with ecl and install maxima.fas.

The eventual sagemath package requires maxima.fas, which is only build with
ecl.

* gnu/packages/maths.scm (maxima)[inputs]: Add ecl.
[configure-flags]: Build with ecl.
[install]: Install maxima.fas.
---
 gnu/packages/maths.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


base-commit: 0d9eef0a06ffcb6a0f66d272ea036597b521ffb6

Comments

Andreas Enge Aug. 12, 2022, 8:50 a.m. UTC | #1
Hello,

I now pushed your updates to packages.

Concerning the new additions, please try to add a description that is a bit
longer than the synopsys and consists of complete sentences (which can be
a challenge if the project homepage is too scarce, I can lend a hand).

And it would be better to add the packages to different modules; many of
them are added now with the aim of getting Sage, but are independent.
So I would add primecount and gfan to algebra, palp to maths,
python-lrcalc, python-primecountpy and python-pplpy to the same module as
their "base packages", and python-memory-allocator probably to
python-xyz. I would suggest to keep in sagemath.scm only the packages for
which Sage has become upstream, such as flintqs.

For tachyon, you use a patch and a phase; would only the latter not be
enough? At worst by using substitute* on the Makefile? See the recent
discussion on patches vs. phases.

I did not yet have a look at the sagemath-... packages. And for
pari-galdata, I wonder if there is not a better way so that it can also
be used by the pari-gp package. The problem with pari-gp is that it
cannot handle a search path with multiple directories, but that all data
files need to be put into the same place. And all data files add up
to about 200MB. One solution would be to add by default only the smaller
data files galpol (10MB), nftables (8MB), galdata (52kB!) and nflistdata
(4MNB). Actually, galdata is so small that we might just add it by default
to pari-gp. It is not a perfect solution, but would improve the package
at almost no cost, and apparently be useful for Sage.

Andreas
Andreas Enge Aug. 12, 2022, 8:58 a.m. UTC | #2
Am Tue, Aug 09, 2022 at 03:40:53PM +0200 schrieb vicvbcun:
> SageMath requires the FASL library? (I only know scheme) `maxima.fas'.
> But it is only built when using ecl (See upstream here [0]). I don't
> know if we need both sbcl and ecl. Arch uses both and puts the
> lib/.../binary-* directories in separate packages[1], so maybe we could
> use different outputs? Anyway, I have attached an rebased commit that
> adds ecl.

Okay, thanks!

I do not use maxima (so it would be nice to get input from someone who
does). To me it looks as if the different base lisps are more or less
exchangeable for the goal of getting a running binary. So maybe it would
be enough to build only the ecl version?

The latest change was to switch from gcl to sbcl, in a commit by Guillaume,
since maxima stopped building with the former; how about switching to ecl?

Andreas
diff mbox

Patch

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index e32a71100e..b250649a45 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4357,6 +4357,7 @@  (define-public maxima
     (build-system gnu-build-system)
     (inputs
      `(("bash" ,bash-minimal)
+       ("ecl" ,ecl)
        ("gnuplot" ,gnuplot)                       ;for plots
        ("sbcl" ,sbcl)
        ("sed" ,sed)
@@ -4365,7 +4366,8 @@  (define-public maxima
      (list texinfo perl python))
     (arguments
      `(#:configure-flags
-       ,#~(list "--enable-sbcl"
+       ,#~(list "--enable-sbcl" "--enable-ecl"
+                (string-append "--with-ecl=" #$ecl "/bin/ecl")
                 (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
                 (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
                 (string-append "--with-wish=" #$tk "/bin/wish"
@@ -4409,6 +4411,10 @@  (define-public maxima
                       "--lisp=sbcl "
                       "--batch-string=\"run_testsuite();\" "
                       "| grep -q \"No unexpected errors found\""))))
+         (add-after 'install 'install-fas
+           (lambda* (#:key outputs #:allow-other-keys)
+             (install-file "src/binary-ecl/maxima.fas"
+                               (string-append (assoc-ref outputs "out") "/lib/maxima/" ,version "/binary-ecl"))))
          ;; Make sure the doc and emacs files are found in the
          ;; standard location.  Also configure maxima to find gnuplot
          ;; without having it on the PATH.