GNU bug report logs -
#76270
[PATCH 0/2] Add sage.
Previous Next
Reported by: Andreas Enge <andreas <at> enge.fr>
Date: Thu, 13 Feb 2025 15:19:02 UTC
Severity: normal
Tags: patch
Done: Andreas Enge <andreas <at> enge.fr>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hello,
Andreas Enge <andreas <at> enge.fr> writes:
> * gnu/packages/sagemath.scm (sage): New variable.
> * gnu/packages/patches/sage-update-eclib.patch,
> gnu/packages/patches/sage-update-pari-gp.patch: New files.
> * gnu/local.mk (dist_patch_DATA): Register patches.
Thanks for that!
> + #:phases
> + #~(modify-phases %standard-phases
> + (add-after 'unpack 'patch-source
> + (lambda _
> + (substitute* (find-files "build/bin")
> + (("sage-bootstrap-python") "python"))
> + (substitute* "src/sage/env.py"
> + (("\"ecl-config\"")
> + (string-append "\"" #$ecl "/bin/ecl-config\""))
> + (("\"ecm\"")
> + (string-append "\"" #$gmp-ecm "/bin/ecm\""))
> + (("\"maxima\"")
> + (string-append "\"" #$maxima-ecl "/bin/maxima\""))
> + (("\"MAXIMA_FAS\"")
> + (string-append "\"MAXIMA_FAS\", \"" #$maxima-ecl
> + "/lib/maxima/"
> + #$(package-version maxima-ecl)
> + "/binary-ecl/maxima.fas\""))
> + (("\"Singular\"")
> + (string-append "\"" #$singular "/bin/Singular\""))
> + (("var\\('SAGE_GAP_COMMAND', None\\)")
> + (string-append "var('SAGE_GAP_COMMAND', \""
> + #$gap "/bin/gap\")"))
> + (("join\\(SAGE_LOCAL, \"lib\", \"gap\"\\)")
> + (string-append "\"" #$gap "/lib/gap\""))
> + (("join\\(SAGE_LOCAL, \"share\", \"gap\"\\)")
> + (string-append "\"" #$gap "/share/gap\""))
> + ;; definition of SAGE_VENV, which ends up in kernel.json
> + (("os.path.abspath\\(sys.prefix\\)")
> + (string-append "\"" #$output "\"")))
> + (substitute* "src/sage/interfaces/gp.py"
> + (("command=f\"gp")
> + (string-append "command=f\"" #$pari-gp "/bin/gp")))
> + (substitute* "src/bin/sage"
> + (("exec python3")
> + (string-append "exec " #$python "/bin/python3"))
> + (("mkdir")
> + (string-append #$coreutils "/bin/mkdir"))
> + ((" sed ")
> + (string-append " " #$sed "/bin/sed ")))))
I suggest to use, for example,
(search-input-file (or native-inputs inputs) "bin/sed")
or
(string-append #$(this-package-input "sed") "/bin/sed")
instead of
(string-append " " #$sed "/bin/sed ")
so as to not break package transformations.
> + (add-before 'build 'setup
> + (lambda _
> + (setenv "SAGE_NUM_THREADS"
> + (number->string (parallel-job-count)))
> + (invoke "./bootstrap")
> + (chdir "src")))
> + (delete 'sanity-check)))) ; does not reflect reality
> + (synopsis "SageMath computer algebra system")
> + (description
> + "SageMath is a mathematics software built on top of many existing
> +packages such as NumPy, SciPy, matplotlib, Sympy, Maxima, GAP, FLINT,
> +R and others. Their combined power may be accessed through a common,
> +Python-based language or directly via interfaces or wrappers.")
Nitpick: matplotlib -> Matplotlib.
> + ;; Documentation under cc-by-sa3.0, see COPYING.txt in the distribution.
> + (license license:gpl3)
> + (home-page "https://www.sagemath.org/")))
Nitpick: the fields in this package definition are in an unusual order.
You may want to reorder them.
FWIW, I also think it makes sense to replace current Maxima with
maxima-ecl.
Regards,
--
Nicolas Goaziou
This bug report was last modified 151 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.