GNU bug report logs - #41971
[WIP PATCH 0/5] Add SageMath

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Sat, 20 Jun 2020 21:29:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41971 in the body.
You can then email your comments to 41971 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Sat, 20 Jun 2020 21:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 20 Jun 2020 21:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: guix-patches <at> gnu.org
Subject: [WIP PATCH 0/5] Add SageMath
Date: Sat, 20 Jun 2020 23:28:02 +0200
This patchstack builds upon #40283 and packages (some of) SageMath.
Currently, sagelib is built successfully, but the `sage' binary is not
being installed. I'm submitting this here as I'm no longer actively
working on this for now. Some things remain to be done:

 - Install the sage command itself and make sure it runs. This will
   probably require understanding what SAGE_ROOT, SAGE_SHARE and
   SAGE_LOCAL mean.
 - Run the tests. This would be best done as another package to make
   sure all the right packages are propagated. Nix does the same [0].
 - Make sure the docs are installed.
 - Remove the cython debug info. I haven't done this yet only because
   testing it would require waiting for a long build.
 - Resolve some small TODOs.

[0]: https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/science/math/sage

Jakub Kądziołka (5):
  gnu: linbox: Fix linking of dependant packages.
  gnu: sagemath: Remove unnecessary old versions of packages
  gnu: Add ECL 16.1.3 for Sage.
  gnu: lcalc: Don't rename the include directory.
  [WIP] gnu: Add sagemath.

 gnu/local.mk                                  |   4 +
 gnu/packages/algebra.scm                      |   5 +-
 .../ecl-16-format-directive-limit.patch       |  83 +++++++
 .../ecl-16-ignore-stderr-write-error.patch    |  17 ++
 gnu/packages/patches/ecl-16-libffi.patch      |  16 ++
 .../patches/linbox-fix-pkgconfig.patch        |  23 ++
 gnu/packages/sagemath.scm                     | 203 +++++++++++++-----
 7 files changed, 291 insertions(+), 60 deletions(-)
 create mode 100644 gnu/packages/patches/ecl-16-format-directive-limit.patch
 create mode 100644 gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch
 create mode 100644 gnu/packages/patches/ecl-16-libffi.patch
 create mode 100644 gnu/packages/patches/linbox-fix-pkgconfig.patch

-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Sat, 20 Jun 2020 21:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: 41971 <at> debbugs.gnu.org
Subject: [PATCH 1/5] gnu: linbox: Fix linking of dependant packages.
Date: Sat, 20 Jun 2020 23:31:43 +0200
* gnu/packages/algebra.scm (linbox)[source]: Add a patch.
  [inputs]: Move fflas-ffpack to...
  [propagated-inputs]: ...here.
* gnu/packages/patches/linbox-fix-pkgconfig.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/algebra.scm                      |  5 ++--
 .../patches/linbox-fix-pkgconfig.patch        | 23 +++++++++++++++++++
 3 files changed, 27 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/linbox-fix-pkgconfig.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index def87a4360..41b92e3830 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1219,6 +1219,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/lierolibre-newer-libconfig.patch		\
   %D%/packages/patches/lierolibre-remove-arch-warning.patch	\
   %D%/packages/patches/lierolibre-try-building-other-arch.patch	\
+  %D%/packages/patches/linbox-fix-pkgconfig.patch		\
   %D%/packages/patches/linkchecker-tests-require-network.patch	\
   %D%/packages/patches/linphoneqt-tabbutton.patch		\
   %D%/packages/patches/linux-libre-support-for-Pinebook-Pro.patch \
diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm
index f2138bbe4e..2244b7ac94 100644
--- a/gnu/packages/algebra.scm
+++ b/gnu/packages/algebra.scm
@@ -1323,14 +1323,15 @@ algebra, such as the row echelon form.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571"))))
+                "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571"))
+              (patches (search-patches "linbox-fix-pkgconfig.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("autoconf" ,autoconf)
        ("automake" ,automake)
        ("libtool" ,libtool)
        ("pkg-config" ,pkg-config)))
-    (inputs
+    (propagated-inputs
      `(("fflas-ffpack" ,fflas-ffpack)))
     (synopsis "C++ library for linear algebra over exact rings")
     (description
diff --git a/gnu/packages/patches/linbox-fix-pkgconfig.patch b/gnu/packages/patches/linbox-fix-pkgconfig.patch
new file mode 100644
index 0000000000..c93915fb1b
--- /dev/null
+++ b/gnu/packages/patches/linbox-fix-pkgconfig.patch
@@ -0,0 +1,23 @@
+Backported from:
+
+From 426eb97ba762c7663884f57ead0909f2aa3cd6a5 Mon Sep 17 00:00:00 2001
+From: Cyril Bouvier <cyril.bouvier <at> lirmm.fr>
+Date: Thu, 17 Jan 2019 16:32:19 +0100
+Subject: [PATCH] Remove @LINBOXSAGE_LIBS@ from linbox.pc.in
+
+---
+ linbox.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/linbox.pc.in b/linbox.pc.in
+index 278f127e4..c6b8091eb 100644
+--- a/linbox.pc.in
++++ b/linbox.pc.in
+@@ -9,6 +9,6 @@ Description: Exact Linear Algebra library
+ URL: http://github.com/linbox-team/linbox
+ Version: @VERSION@
+ Requires: fflas-ffpack >= 2.4.0, givaro >= 4.1.0
+-Libs: -L${libdir} -llinbox @LINBOXSAGE_LIBS@ @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
++Libs: -L${libdir} -llinbox @NTL_LIBS@ @MPFR_LIBS@ @FPLLL_LIBS@ @IML_LIBS@ @FLINT_LIBS@ @OCL_LIBS@
+ Cflags: @DEFAULT_CFLAGS@ -DDISABLE_COMMENTATOR -I${includedir} @NTL_CFLAGS@ @MPFR_CFLAGS@ @FPLLL_CFLAGS@  @IML_CFLAGS@ @FLINT_CFLAGS@ 
+ \-------------------------------------------------------
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Sat, 20 Jun 2020 21:32:02 GMT) Full text and rfc822 format available.

Message #11 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: 41971 <at> debbugs.gnu.org
Subject: [PATCH 2/5] gnu: sagemath: Remove unnecessary old versions of packages
Date: Sat, 20 Jun 2020 23:31:50 +0200
Sage has updated givaro, fflas-ffpack and linbox since the comment was
written.

* gnu/packages/sagemath.scm (givaro, fflas-ffpack, linbox): Remove
  variables.
---
 gnu/packages/sagemath.scm | 54 ---------------------------------------
 1 file changed, 54 deletions(-)

diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm
index b96cb6b96e..34fe9e524c 100644
--- a/gnu/packages/sagemath.scm
+++ b/gnu/packages/sagemath.scm
@@ -184,60 +184,6 @@ represented as strings.")
     (license license:public-domain)
     (home-page "https://github.com/miguelmarco/libhomfly")))
 
-;; The following three packages from the Linbox group are needed in
-;; an outdated version for Sage.
-
-(define-public givaro-4.0.4
-  (package (inherit givaro)
-    (name "givaro")
-    (version "4.0.4")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/linbox-team/givaro")
-                    (commit (string-append "v" version))))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "199p8wyj5i63jbnk7j8qbdbfp5rm2lpmcxyk3mdjy9bz7ygx3hhy"))))))
-
-(define-public fflas-ffpack-2.3.2
-  (package (inherit fflas-ffpack)
-    (name "fflas-ffpack")
-    (version "2.3.2")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/linbox-team/fflas-ffpack")
-                    (commit (string-append "v" version))))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "1cqhassj2dny3gx0iywvmnpq8ca0d6m82xl5rz4mb8gaxr2kwddl"))))
-    (propagated-inputs
-     `(("givaro" ,givaro-4.0.4)))
-    ;; A test fails, but since all tests pass in the latest version,
-    ;; there is not much point in investigating.
-    (arguments
-     (substitute-keyword-arguments (package-arguments fflas-ffpack)
-       ((#:tests? _ #f) #f)))))
-
-(define-public linbox-1.5.2
-  (package (inherit linbox)
-    (version "1.5.2")
-    (name "linbox")
-    (source (origin
-              (method git-fetch)
-              (uri (git-reference
-                    (url "https://github.com/linbox-team/linbox")
-                    (commit (string-append "v" version))))
-              (file-name (git-file-name name version))
-              (sha256
-               (base32
-                "1wfivlwp30mzdy1697w7rzb8caajim50mc8h27k82yipn2qc5n4i"))))
-    (inputs
-     `(("fflas-ffpack" ,fflas-ffpack-2.3.2)))))
-
 (define-public pynac
   (package
     (name "pynac")
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Sat, 20 Jun 2020 21:33:01 GMT) Full text and rfc822 format available.

Message #14 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: 41971 <at> debbugs.gnu.org
Subject: [PATCH 3/5] gnu: Add ECL 16.1.3 for Sage.
Date: Sat, 20 Jun 2020 23:31:58 +0200
* gnu/packages/sagemath.scm (ecl-16): New variable.
* gnu/packages/patches/ecl-16-format-directive-limit.patch,
  gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch,
  gnu/packages/patches/ecl-16-libffi.patch: New files.
* gnu/local.mk (dist_patch_DATA): Register the patches.
---
 gnu/local.mk                                  |  3 +
 .../ecl-16-format-directive-limit.patch       | 83 +++++++++++++++++++
 .../ecl-16-ignore-stderr-write-error.patch    | 17 ++++
 gnu/packages/patches/ecl-16-libffi.patch      | 16 ++++
 gnu/packages/sagemath.scm                     | 23 +++++
 5 files changed, 142 insertions(+)
 create mode 100644 gnu/packages/patches/ecl-16-format-directive-limit.patch
 create mode 100644 gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch
 create mode 100644 gnu/packages/patches/ecl-16-libffi.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 41b92e3830..486e7aa8cc 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -881,6 +881,9 @@ dist_patch_DATA =						\
   %D%/packages/patches/dstat-skip-devices-without-io.patch	\
   %D%/packages/patches/dune-istl-2.7-fix-non-mpi-tests.patch	\
   %D%/packages/patches/dvd+rw-tools-add-include.patch 		\
+  %D%/packages/patches/ecl-16-format-directive-limit.patch	\
+  %D%/packages/patches/ecl-16-ignore-stderr-write-error.patch	\
+  %D%/packages/patches/ecl-16-libffi.patch			\
   %D%/packages/patches/eigen-stabilise-sparseqr-test.patch	\
   %D%/packages/patches/einstein-build.patch			\
   %D%/packages/patches/elfutils-tests-ptrace.patch		\
diff --git a/gnu/packages/patches/ecl-16-format-directive-limit.patch b/gnu/packages/patches/ecl-16-format-directive-limit.patch
new file mode 100644
index 0000000000..237db92722
--- /dev/null
+++ b/gnu/packages/patches/ecl-16-format-directive-limit.patch
@@ -0,0 +1,83 @@
+Patch backported by Sage.
+
+Fix from upstream that happens to work around
+https://trac.sagemath.org/ticket/23011
+diff --git a/src/lsp/format.lsp b/src/lsp/format.lsp
+index 77ca799..53b887c 100644
+--- a/src/lsp/format.lsp
++++ b/src/lsp/format.lsp
+@@ -307,11 +307,13 @@
+                   :start (format-directive-start struct)
+                   :end (format-directive-end struct))))
+ 
++(defconstant +format-directive-limit+ (1+ (char-code #\~)))
++
+ #+formatter
+ (defparameter *format-directive-expanders*
+-  (make-array char-code-limit :initial-element nil))
++  (make-array +format-directive-limit+ :initial-element nil))
+ (defparameter *format-directive-interpreters*
+-  (make-array char-code-limit :initial-element nil))
++  (make-array +format-directive-limit+ :initial-element nil))
+ 
+ (defparameter *default-format-error-control-string* nil)
+ (defparameter *default-format-error-offset* nil)
+@@ -550,24 +552,24 @@
+            (write-string directive stream)
+            (interpret-directive-list stream (cdr directives) orig-args args))
+           (#-ecl format-directive #+ecl vector
++           (multiple-value-bind
++                 (new-directives new-args)
++               (let* ((code (char-code (format-directive-character directive)))
++                      (function
++                        (and (< code +format-directive-limit+)
++                             (svref *format-directive-interpreters* code)))
++                      (*default-format-error-offset*
++                        (1- (format-directive-end directive))))
++                 (unless function
++                   (error 'format-error
++                          :complaint "Unknown format directive."))
+                  (multiple-value-bind
+                        (new-directives new-args)
+-                     (let ((function
+-                            (svref *format-directive-interpreters*
+-                                   (char-code (format-directive-character
+-                                               directive))))
+-                           (*default-format-error-offset*
+-                            (1- (format-directive-end directive))))
+-                       (unless function
+-                         (error 'format-error
+-                                :complaint "Unknown format directive."))
+-                       (multiple-value-bind
+-                             (new-directives new-args)
+-                           (funcall function stream directive
+-                                    (cdr directives) orig-args args)
+-                         (values new-directives new-args)))
+-                   (interpret-directive-list stream new-directives
+-                                             orig-args new-args)))))
++                     (funcall function stream directive
++                              (cdr directives) orig-args args)
++                   (values new-directives new-args)))
++             (interpret-directive-list stream new-directives
++                                       orig-args new-args)))))
+       args))
+ 
+ 
+@@ -639,11 +641,12 @@
+        (values `(write-string ,directive stream)
+                more-directives))
+       (format-directive
+-       (let ((expander
+-              (aref *format-directive-expanders*
+-                    (char-code (format-directive-character directive))))
+-             (*default-format-error-offset*
+-              (1- (format-directive-end directive))))
++       (let* ((code (char-code (format-directive-character directive)))
++              (expander
++                (and (< code +format-directive-limit+)
++                     (svref *format-directive-expanders* code)))
++              (*default-format-error-offset*
++                (1- (format-directive-end directive))))
+          (if expander
+              (funcall expander directive more-directives)
+              (error 'format-error
diff --git a/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch b/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch
new file mode 100644
index 0000000000..42d213c0e9
--- /dev/null
+++ b/gnu/packages/patches/ecl-16-ignore-stderr-write-error.patch
@@ -0,0 +1,17 @@
+Patch adapted from Sage.
+diff -Naur ecl-16.1.2.orig/src/c/file.d ecl-16.1.2/src/c/file.d
+--- ecl-16.1.2.orig/src/c/file.d	2016-05-11 13:10:51.867673867 +1200
++++ ecl-16.1.2/src/c/file.d	2016-05-11 14:44:48.121907307 +1200
+@@ -3354,8 +3354,10 @@
+   ecl_disable_interrupts();
+   do {
+     out = fwrite(c, sizeof(char), n, IO_STREAM_FILE(strm));
+-  } while (out < n && restartable_io_error(strm, "fwrite"));
+-  ecl_enable_interrupts();
++  /* Ignore write errors to stderr to avoid an infinite loop */
++  } while (out < n && (IO_STREAM_FILE(strm) != stderr) && restartable_io_error(strm, "fwrite"));
++
++  ecl_enable_interrupts();
+   return out;
+ }
+ 
diff --git a/gnu/packages/patches/ecl-16-libffi.patch b/gnu/packages/patches/ecl-16-libffi.patch
new file mode 100644
index 0000000000..fc06a07606
--- /dev/null
+++ b/gnu/packages/patches/ecl-16-libffi.patch
@@ -0,0 +1,16 @@
+Patch adapted from Sage. Allows building ECL on libffi 3.3.
+diff --git a/src/c/ffi.d b/src/c/ffi.d
+index 8861303e..8a959c23 100644
+--- a/src/c/ffi.d
++++ b/src/c/ffi.d
+@@ -133,8 +133,8 @@ static struct {
+ #elif defined(X86_WIN64)
+   {@':win64', FFI_WIN64},
+ #elif defined(X86_ANY) || defined(X86) || defined(X86_64)
+-  {@':cdecl', FFI_SYSV},
+-  {@':sysv', FFI_SYSV},
++  {@':cdecl', FFI_UNIX64},
++  {@':sysv', FFI_UNIX64},
+   {@':unix64', FFI_UNIX64},
+ #endif
+ };
diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm
index 34fe9e524c..c94020f13e 100644
--- a/gnu/packages/sagemath.scm
+++ b/gnu/packages/sagemath.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2019 Andreas Enge <andreas <at> enge.fr>
 ;;; Copyright © 2019 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
 ;;; Copyright © 2019, 2020 Tobias Geerinckx-Rice <me <at> tobias.gr>
+;;; Copyright © 2020 Jakub Kądziołka <kuba <at> kadziolka.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,7 @@
   #:use-module (gnu packages boost)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages lisp)
   #:use-module (gnu packages multiprecision)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -184,6 +186,27 @@ represented as strings.")
     (license license:public-domain)
     (home-page "https://github.com/miguelmarco/libhomfly")))
 
+;; Sage 9.1 doesn't build with ECL 20.  This won't be necessary once 9.2 is
+;; released.  See https://trac.sagemath.org/ticket/22191
+(define-public ecl-16
+  (package
+    (inherit ecl)
+    (version "16.1.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://common-lisp.net/project/ecl/static/files/release/ecl"
+             "-" version ".tgz"))
+       (sha256
+        (base32 "0m0j24w5d5a9dwwqyrg0d35c0nys16ijb4r0nyk87yp82v38b9bn"))
+       (patches (search-patches
+                  "ecl-16-libffi.patch"
+                  "ecl-16-ignore-stderr-write-error.patch"
+                  "ecl-16-format-directive-limit.patch"))))
+    ;; Current ECL uses LGPL 2.1+
+    (license license:lgpl2.0+)))
+
 (define-public pynac
   (package
     (name "pynac")
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Sat, 20 Jun 2020 21:33:02 GMT) Full text and rfc822 format available.

Message #17 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: 41971 <at> debbugs.gnu.org
Subject: [PATCH 4/5] gnu: lcalc: Don't rename the include directory.
Date: Sat, 20 Jun 2020 23:32:08 +0200
Sage no longer renames the directory, so we shouldn't either.

* gnu/packages/sagemath.scm (lcalc)[arguments]: Remove a substitution from
  the prepare-build phase.
---
 gnu/packages/sagemath.scm | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm
index c94020f13e..8c837fdaeb 100644
--- a/gnu/packages/sagemath.scm
+++ b/gnu/packages/sagemath.scm
@@ -368,10 +368,7 @@ used as internal storage type for polynomial structures.")
              (let ((out (assoc-ref outputs "out")))
                (substitute* "Makefile"
                  (("^INSTALL_DIR= /usr/local")
-                  (string-append "INSTALL_DIR=" out))
-                 ;; Sage renames the include directory, so we do it also.
-                 (("include/Lfunction")
-                  "include/libLfunction")))
+                  (string-append "INSTALL_DIR=" out))))
              #t))
          (add-before 'install 'make-output-dirs
            (lambda* (#:key outputs #:allow-other-keys)
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Sat, 20 Jun 2020 21:33:02 GMT) Full text and rfc822 format available.

Message #20 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: 41971 <at> debbugs.gnu.org
Subject: [PATCH 5/5] [WIP] gnu: Add sagemath.
Date: Sat, 20 Jun 2020 23:32:18 +0200
---
 gnu/packages/sagemath.scm | 123 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 122 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm
index 8c837fdaeb..9809f93060 100644
--- a/gnu/packages/sagemath.scm
+++ b/gnu/packages/sagemath.scm
@@ -29,16 +29,33 @@
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages algebra)
+  #:use-module (gnu packages assembly)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bdw-gc)
   #:use-module (gnu packages boost)
+  #:use-module (gnu packages cmake)
+  #:use-module (gnu packages commencement)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages gd)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages graph)
   #:use-module (gnu packages image)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages lisp)
+  #:use-module (gnu packages m4)
+  #:use-module (gnu packages maths)
   #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages networking)
+  #:use-module (gnu packages pcre)
+  #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
-  #:use-module (gnu packages python-xyz))
+  #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages readline)
+  #:use-module (gnu packages sqlite)
+  #:use-module (gnu packages tex)
+  #:use-module (gnu packages tls))
 
 
 (define-public python-cypari2
@@ -432,3 +449,107 @@ zeta function and its twists by quadratic characters.")
 a given height bound on a hyperelliptic curve in a very efficient way,
 by using an optimized quadratic sieve algorithm.")
     (license license:gpl2+)))
+
+(define-public sagemath
+  (package
+    (name "sagemath")
+    (version "9.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url "git://git.sagemath.org/sage.git/")
+              (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "1imlqa5mg7xxp6xbzzjnjjpd8k79vlx48zm0qfj7cd4bi0i809pp"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:use-setuptools? #f
+       #:tests? #f
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'prepare
+           (lambda _
+            (setenv "HOME" "/tmp")
+            (setenv "SAGE_ROOT" (getcwd))
+            (setenv "SAGE_LOCAL" (getcwd))
+            (setenv "SAGE_SHARE" (string-append (getcwd) "/share"))
+            (setenv "SAGE_NUM_THREADS" (number->string (parallel-job-count)))
+            (mkdir-p "var/lib/sage/installed")
+            (chdir "src")
+            #t)))))
+    (propagated-inputs
+     `(("python-cypari2" ,python-cypari2)
+       ("python-cysignals" ,python-cysignals)
+       ("python-cython" ,python-cython)
+       ("python-gmpy2" ,python-gmpy2)
+       ("python-jinja2" ,python-jinja2)
+       ("python-numpy" ,python-numpy)
+       ("python-pkgconfig" ,python-pkgconfig)
+       ("python-six" ,python-six)))
+    (inputs
+     `(("arb" ,arb)
+       ("boost" ,boost) ; TODO: Is this needed?
+       ("braiding" ,libbraiding)
+       ("brial" ,brial)
+       ("bzip2" ,bzip2)
+       ("cliquer" ,cliquer)
+       ("ecl" ,ecl-16)
+       ("eclib" ,eclib)
+       ("ecm" ,gmp-ecm)
+       ("ecm:libatomic-ops" ,libatomic-ops)
+       ("flint" ,flint)
+       ("gf2x" ,gf2x)
+       ("gap" ,gap)
+       ("gc" ,libgc)
+       ("gd" ,gd)
+       ("givaro" ,givaro)
+       ("glpk" ,glpk)
+       ("gmp" ,gmp)
+       ("gsl" ,gsl)
+       ("homfly" ,libhomfly)
+       ("iml" ,iml)
+       ("lcalc" ,lcalc)
+       ("libffi" ,libffi)
+       ("libpng" ,libpng)
+       ("linbox" ,linbox)
+       ("lrcalc" ,lrcalc)
+       ("m4ri" ,m4ri)
+       ("m4rie" ,m4rie)
+       ("mpc" ,mpc)
+       ("mpfi" ,mpfi)
+       ("mpfr" ,mpfr)
+       ("ncurses" ,ncurses)
+       ("ntl" ,ntl)
+       ("openssl" ,openssl)
+       ("pari" ,pari-gp)
+       ("pcre" ,pcre)
+       ("planarity" ,edge-addition-planarity-suite)
+       ("ppl" ,ppl)
+       ("pynac" ,pynac)
+       ("rw" ,rw)
+       ("ratpoints" ,ratpoints)
+       ("readline" ,readline)
+       ("singular" ,singular)
+       ("sqlite" ,sqlite)
+       ("symmetrica" ,symmetrica)
+       ("texlive" ,texlive-tiny)
+       ("zeromq" ,zeromq) ; TODO: Is this needed?
+       ("zlib" ,zlib)
+       ("zn-poly" ,zn-poly)))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("cmake" ,cmake)
+       ("gettext" ,gettext-minimal)
+       ("gfortran" ,gfortran-toolchain)
+       ("m4" ,m4)
+       ("perl" ,perl)
+       ("pkg-config" ,pkg-config)
+       ("yasm" ,yasm)))
+    (home-page "https://www.sagemath.org/")
+    (synopsis "Python-based computer algebra system")
+    (description "TODO")
+    (license license:gpl3)))
-- 
2.26.2





Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Tue, 07 Jul 2020 12:48:02 GMT) Full text and rfc822 format available.

Message #23 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Cc: 41971 <at> debbugs.gnu.org, andreas <at> enge.fr
Subject: Re: [bug#41971] [WIP PATCH 0/5] Add SageMath
Date: Tue, 07 Jul 2020 14:47:28 +0200
Hello,

Jakub Kądziołka <kuba <at> kadziolka.net> writes:

> This patchstack builds upon #40283 and packages (some of) SageMath.
> Currently, sagelib is built successfully, but the `sage' binary is not
> being installed. I'm submitting this here as I'm no longer actively
> working on this for now. Some things remain to be done:

Thanks!

Would it make sense to add the uncontroversial fourth first patches,
along with #40283, so it is easier to hack on the sagemath package
itself?

I'm also Cc'ing Andreas Enge, who showed interest in packaging Sagemath
a few months ago, and, AFAIK, was close to succeeding.

Regards,
-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Fri, 10 Jul 2020 21:07:01 GMT) Full text and rfc822 format available.

Message #26 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 41971 <at> debbugs.gnu.org, andreas <at> enge.fr, 40283-done <at> debbugs.gnu.org
Subject: Re: [bug#41971] [WIP PATCH 0/5] Add SageMath
Date: Fri, 10 Jul 2020 23:06:40 +0200
[Message part 1 (text/plain, inline)]
On Tue, Jul 07, 2020 at 02:47:28PM +0200, Nicolas Goaziou wrote:
> Hello,
> 
> Jakub Kądziołka <kuba <at> kadziolka.net> writes:
> 
> > This patchstack builds upon #40283 and packages (some of) SageMath.
> > Currently, sagelib is built successfully, but the `sage' binary is not
> > being installed. I'm submitting this here as I'm no longer actively
> > working on this for now. Some things remain to be done:
> 
> Thanks!
> 
> Would it make sense to add the uncontroversial fourth first patches,
> along with #40283, so it is easier to hack on the sagemath package
> itself?

Sure it would! I just did.

> I'm also Cc'ing Andreas Enge, who showed interest in packaging Sagemath
> a few months ago, and, AFAIK, was close to succeeding.

Thanks!

Regards,
Jakub Kądziołka
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Mon, 20 Mar 2023 14:14:02 GMT) Full text and rfc822 format available.

Message #29 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: Jakub Kądziołka <kuba <at> kadziolka.net>,
 41971 <at> debbugs.gnu.org, andreas <at> enge.fr
Subject: Re: bug#41971: [WIP PATCH 0/5] Add SageMath
Date: Mon, 20 Mar 2023 15:13:24 +0100
Hello!

Nicolas Goaziou <mail <at> nicolasgoaziou.fr> skribis:

> Jakub Kądziołka <kuba <at> kadziolka.net> writes:
>
>> This patchstack builds upon #40283 and packages (some of) SageMath.
>> Currently, sagelib is built successfully, but the `sage' binary is not
>> being installed. I'm submitting this here as I'm no longer actively
>> working on this for now. Some things remain to be done:
>
> Thanks!
>
> Would it make sense to add the uncontroversial fourth first patches,
> along with #40283, so it is easier to hack on the sagemath package
> itself?

Time has passed, but it still sounds like a nice addition.

Andreas, Nicolas: should one of you go ahead and apply part of these
patches?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Mon, 20 Mar 2023 15:02:01 GMT) Full text and rfc822 format available.

Message #32 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Enge <andreas <at> enge.fr>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Jakub Kądziołka <kuba <at> kadziolka.net>,
 41971 <at> debbugs.gnu.org, Guillaume Le Vaillant <glv <at> posteo.net>,
 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Subject: Re: bug#41971: [WIP PATCH 0/5] Add SageMath
Date: Mon, 20 Mar 2023 16:01:45 +0100
Am Mon, Mar 20, 2023 at 03:13:24PM +0100 schrieb Ludovic Courtès:
> > Would it make sense to add the uncontroversial fourth first patches,
> > along with #40283, so it is easier to hack on the sagemath package
> > itself?
> Time has passed, but it still sounds like a nice addition.

There is also
   https://issues.guix.gnu.org/56729
where I was waiting for a reply from the submitter, and/or Guillaume
concerning the Lisp version with which Maxima is compiled.

I would have to get back to both issues to see what the current status is,
but could only do so in a week or two.

Andreas





Information forwarded to guix-patches <at> gnu.org:
bug#41971; Package guix-patches. (Mon, 20 Mar 2023 18:14:02 GMT) Full text and rfc822 format available.

Message #35 received at 41971 <at> debbugs.gnu.org (full text, mbox):

From: Maja Kądziołka <kuba <at> kadziolka.net>
To: Ludovic Courtès <ludo <at> gnu.org>,
 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: 41971 <at> debbugs.gnu.org, andreas <at> enge.fr
Subject: Re: bug#41971: [WIP PATCH 0/5] Add SageMath
Date: Mon, 20 Mar 2023 19:13:49 +0100
On 20/03/2023 15:13, Ludovic Courtès wrote:
> Nicolas Goaziou <mail <at> nicolasgoaziou.fr> skribis:
>
>> Would it make sense to add the uncontroversial fourth first patches,
>> along with #40283, so it is easier to hack on the sagemath package
>> itself?
>
> Time has passed, but it still sounds like a nice addition.
>
> Andreas, Nicolas: should one of you go ahead and apply part of these
> patches?
>
> Thanks,
> Ludo’.

Wow, I wrote these patches like 2 genders and 3 distros ago :P

FWIW, they did get pushed to master when you first suggested it, at 
commit db7f74d2eb4878c0a9ed8bb33853090752277370 and friends.

Regards,
Maya :3




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Tue, 21 Mar 2023 09:41:01 GMT) Full text and rfc822 format available.

Notification sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
bug acknowledged by developer. (Tue, 21 Mar 2023 09:41:01 GMT) Full text and rfc822 format available.

Message #40 received at 41971-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Maja Kądziołka <kuba <at> kadziolka.net>
Cc: andreas <at> enge.fr, 41971-done <at> debbugs.gnu.org,
 Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Subject: Re: bug#41971: [WIP PATCH 0/5] Add SageMath
Date: Tue, 21 Mar 2023 10:40:30 +0100
Hi,

Maja Kądziołka <kuba <at> kadziolka.net> skribis:

> FWIW, they did get pushed to master when you first suggested it, at
> commit db7f74d2eb4878c0a9ed8bb33853090752277370 and friends.

Ooooh, right!  My bad.

Closing, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 18 Apr 2023 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 3 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.