[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#56729] [RFC PATCH 10/10] gnu: Add sagemath.
From: |
vicvbcun |
Subject: |
[bug#56729] [RFC PATCH 10/10] gnu: Add sagemath. |
Date: |
Sat, 23 Jul 2022 22:52:04 +0200 |
* gnu/packages/sagemath.scm (sagemath): New variable.
---
Notes:
- I'm not sure about native inputs vs. inputs here.
- There is a broken symlink in share/jupyter/kernels/sagemath/doc is
currently a broken symlink. We should probably remove it and add it
into the documentation output.
- bin/ is currently full of random stuff, we probably only need a few
things.
gnu/packages/sagemath.scm | 106 ++++++++++++++++++++++++++++++++++++++
1 file changed, 106 insertions(+)
diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm
index 335d98d9f4..f84440db93 100644
--- a/gnu/packages/sagemath.scm
+++ b/gnu/packages/sagemath.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2022 vicvbcun <guix@ikherbers.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -25,6 +26,7 @@ (define-module (gnu packages sagemath)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
#:use-module (guix download)
+ #:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix packages)
#:use-module (guix utils)
@@ -34,6 +36,8 @@ (define-module (gnu packages sagemath)
#:use-module (gnu packages bdw-gc)
#:use-module (gnu packages boost)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages gd)
+ #:use-module (gnu packages graph)
#:use-module (gnu packages image)
#:use-module (gnu packages lisp)
#:use-module (gnu packages maths)
@@ -41,6 +45,7 @@ (define-module (gnu packages sagemath)
#:use-module (gnu packages pkg-config)
#:use-module (gnu packages popt)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-build)
#:use-module (gnu packages python-xyz))
@@ -400,3 +405,104 @@ (define-public python-pplpy
"This Python module pplpy provides a wrapper to the C++ Parma Polyhedra
Library (PPL).")
(license license:gpl3)))
+
+(define-public sagemath
+ (package
+ (name "sagemath")
+ (version "9.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/sagemath/sage")
+ (commit version)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0k91l3aid09hy94ps2r6acg22bxgsprxnh1b92hma3z1mn0ii3s1"))))
+ (build-system python-build-system)
+ (arguments
+ (list #:tests? #f ; may take a long time, I'm scared
+ #:use-setuptools? #f
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'prepare-build
+ (lambda _
+ (setenv "SAGE_NUM_THREADS"
+ (number->string (parallel-job-count)))
+ (setenv "SAGE_VENV" #$output)
+ (chdir "src")))
+ (add-after 'install 'fix-logo-symlinks
+ ;; these symlinks point to /tmp/guix-build-... so we
+ ;; need to recreate them
+ (lambda _
+ (for-each
+ (lambda (file)
+ (let
+ ((source (string-append
"sage/ext_data/notebook-ipython/" file))
+ (target (string-append #$output
"/share/jupyter/kernels/sagemath/" file)))
+ (delete-file target)
+ (copy-file source target)))
+ '("logo.svg" "logo-64x64.png"))))
+ (add-after 'install 'delete-nbextensions
+ ;; broken symlink to threejs-sage which we
+ ;; don't even package
+ (lambda _
+ (delete-file-recursively (string-append #$output
"/share/jupyter/nbextensions"))))
+ (add-after 'install 'install-bin
+ ;; so far, we have only installed the
+ ;; library part of sage
+ (lambda _
+ ;; this copies way to much
+ (copy-recursively "bin" (string-append #$output
"/bin")))))))
+ (inputs (list arb
+ boost
+ brial
+ cliquer
+ ecl
+ eclib
+ edge-addition-planarity-suite
+ flint
+ gap
+ gd
+ giac
+ givaro
+ glpk
+ gmp
+ gmp-ecm
+ gsl
+ iml
+ lcalc
+ libbraiding
+ libhomfly
+ linbox
+ m4ri
+ m4rie
+ mpc
+ mpfi
+ ntl
+ openblas
+ pari-gp
+ python-cypari2
+ python-gmpy2
+ python-jinja2
+ python-jupyter-core
+ python-memory-allocator
+ python-numpy
+ python-pkgconfig
+ python-pplpy
+ python-setuptools
+ python-wheel
+ rw
+ singular
+ symmetrica
+ zlib
+ zn-poly))
+ (native-inputs (list pkg-config python-cython))
+ (home-page "https://www.sagemath.org")
+ (synopsis "Python-based computer algebra system")
+ (description
+ "SageMath is a free open-source mathematics software system licensed
under the
+GPL. It builds on top of many existing open-source packages: NumPy, SciPy,
+matplotlib, Sympy, Maxima, GAP, FLINT, R and many more. Access their combined
+power through a common, Python-based language or directly via interfaces or
+wrappers.")
+ (license license:gpl3)))
--
2.37.0
- [bug#56729] [RFC PATCH 00/10] Add sagemath., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 02/10] gnu: gap: Update to 4.11.1., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 03/10] gnu: Remove ecl-16., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 01/10] gnu: edge-addition-planarity-suite: Update to 3.0.2.0., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 07/10] gnu: eclib: Update to 20220621., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 08/10] gnu: Add python-memory-allocator., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 06/10] gnu: ntl: Update to 11.5.1., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 10/10] gnu: Add sagemath.,
vicvbcun <=
- [bug#56729] [RFC PATCH 04/10] gnu: cliquer: Update to 1.22., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 05/10] gnu: lcalc: Update to 2.0.5., vicvbcun, 2022/07/23
- [bug#56729] [RFC PATCH 09/10] gnu: Add python-pplpy., vicvbcun, 2022/07/23