Subject: [PATCH v2 1/2] gnu: maxima: Compile with ecl instead of sbcl.

From: Andreas Enge <[email-masked]>
Date: Thu, 13 Feb 2025 20:59:47 +0100

Hello,

thanks a lot, Nicolas, for this quick review!

The comment on changing the style using this-package-input is a good
remark, I was not aware of it. I also tried to adapt the style according
to your other suggestions (but am not totally sure about the canonical
order of the fields of a package).

Here is a new version with a maxima package modified to use ecl, instead
of a separate package.

In the meantime, I have also changed (on master) the names of the data
packages according to our package guidelines. In the end it does not
matter that much because I think that the packages are not needed or
even usable outside of sage, so they can be hidden by using define
instead of define-public. I have done so for conway-polynomials, which I
have added to sage. Now the command "conway_polynomial (2, 5)" returns a
value instead of an error. Just adding them makes no difference for the
other data packages, however, so I have refrained from adding them for
the moment.

I have also added python-fpylll. To check that it makes a difference, I
have used the following sage code, given to me by a participant of the
workshop I am attending right now:
from sage.features.all import all_features
for feature in all_features():
    print (feature, end="\t")
    try:
        feature.require()
        print ("yes")
    except:
        print ("no")

It prints a long list of features, among which there is now
Feature('fpylll')	yes
with "yes" instead of "no" previously.

The two commits are also on the branch wip-sage2.

Andreas

[PATCH v2 1/2] gnu: maxima: Compile with ecl instead of sbcl.

This is needed by sage and does not change the maxima functionality.

* gnu/packages/maths.scm (maxima)[inputs]: Replace sbcl by ecl.
[arguments]<configure-flags>: Adapt to use ecl. Drop unneeded flags.
<phases>{check}: Adapt to use ecl.
{install-lib}: Add phase to install the file maxima.fas.

Change-Id: I71a14d064e67aa34fdd7f6eb8499dfbd1dea11b9
---
 gnu/packages/maths.scm | 35 +++++++++++++++++++----------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 4a1637b952..08c9201b0c 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020, 2023, 2024 Andreas Enge <[email-masked]>
+;;; Copyright © 2013, 2014, 2015, 2016, 2019, 2020, 2023, 2024, 2025 Andreas Enge <[email-masked]>
 ;;; Copyright © 2013 Nikita Karetnikov <[email-masked]>
 ;;; Copyright © 2014, 2016, 2017 John Darrington <[email-masked]>
 ;;; Copyright © 2014-2022 Eric Bavier <[email-masked]>
@@ -5417,8 +5417,8 @@ (define-public maxima
     (build-system gnu-build-system)
     (inputs
      (list bash-minimal
+           ecl
            gnuplot                       ;for plots
-           sbcl
            sed
            tk))                          ;Tcl/Tk is used by 'xmaxima'
     (native-inputs
@@ -5426,11 +5426,7 @@ (define-public maxima
     (arguments
      (list
       #:configure-flags
-      #~(list "--enable-sbcl"
-              (string-append "--with-sbcl=" #$sbcl "/bin/sbcl")
-              (string-append "--with-posix-shell=" #$bash-minimal "/bin/sh")
-              (string-append "--with-wish=" #$tk "/bin/wish"
-                             #$(version-major+minor (package-version tk))))
+      #~(list "--enable-ecl")
       ;; By default Maxima attempts to write temporary files to
       ;; '/tmp/nix-build-maxima-*', which won't exist at run time.
       ;; Work around that.
@@ -5457,21 +5453,28 @@ (define-public maxima
             (lambda _
               (chmod "src/maxima" #o555)))
           (replace 'check
+            ;; This is derived from the testing code in the "debian/rules" file
+            ;; of Debian's Maxima package.
+            ;; If Maxima can successfully run this, the binary to be installed
+            ;; should be fine.
             (lambda _
-              ;; This is derived from the testing code in the "debian/rules" file
-              ;; of Debian's Maxima package.
-              ;; If Maxima can successfully run this, the binary to be installed
-              ;; should be fine.
               (invoke "sh" "-c"
                       (string-append
-                       "./maxima-local "
-                       "--lisp=sbcl "
-                       "--batch-string=\"run_testsuite();\" "
-                       "| grep -q \"No unexpected errors found\""))))
+                        "./maxima-local "
+                        "--lisp=ecl "
+                        "--batch-string=\"run_testsuite();\" "
+                        "| grep -q \"No unexpected errors found\""))))
+          (add-after 'install 'install-lib
+           (lambda _
+             (let ((lib (string-append
+                          #$output "/lib/maxima/"
+                          #$(package-version this-package)
+                          "/binary-ecl")))
+                  (install-file "src/binary-ecl/maxima.fas" lib))))
           ;; 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.
-          (add-after 'install 'post-install
+          (add-after 'install-lib 'post-install
             (lambda* (#:key outputs inputs #:allow-other-keys)
               (let* ((gnuplot (assoc-ref inputs "gnuplot"))
                      (out (assoc-ref outputs "out"))

base-commit: af6d567c2e5acc0c14ad5b84efbfeb94351a9553
-- 
2.48.1