@@ -25,6 +25,7 @@ (define-module (gnu packages sagemath)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
#:use-module (guix build-system python)
+ #:use-module (guix build-system trivial)
#:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download)
@@ -33,6 +34,7 @@ (define-module (gnu packages sagemath)
#:use-module (gnu packages)
#:use-module (gnu packages algebra)
#:use-module (gnu packages autotools)
+ #:use-module (gnu packages base)
#:use-module (gnu packages bdw-gc)
#:use-module (gnu packages boost)
#:use-module (gnu packages compression)
@@ -595,3 +597,49 @@ (define-public tachyon
(synopsis "Multithreaded ray tracing software")
(description synopsis)
(license license:bsd-3)))
+
+(define-public sagemath-data-conway-polynomials
+ (let
+ ((install-py-origin
+ (origin
+ (method url-fetch)
+ (uri
+ "https://raw.githubusercontent.com/sagemath/sage/9.6/build/pkgs/conway_polynomials/spkg-install.py")
+ (sha256 (base32
+ "1bwnqasnyv793hxg29viing4dnliz29grkhldsirq19d509yk1fs")))))
+ (package
+ (name "sagemath-data-conway-polynomials")
+ (version "0.5")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append
+ "https://mirrors.mit.edu/sage/spkg/upstream/conway_polynomials/conway_polynomials-"
+ version ".tar.bz2"))
+ (sha256
+ (base32
+ "05zb1ly9x2bbscqv0jgc45g48xx77mfs7qdbqhn4ihmihn57iwnq"))))
+ (build-system trivial-build-system)
+ (arguments
+ (list #:modules '((guix build utils))
+ #:builder #~(begin
+ (use-modules (guix build utils))
+
+ (setenv "PATH"
+ (string-append #+(file-append bzip2 "/bin")
+ ":"
+ #+(file-append tar "/bin")
+ ":"
+ #+(file-append python "/bin")))
+ (setenv "SAGE_SHARE" (string-append #$output "/share"))
+ (setenv "PYTHONPATH" (getcwd))
+
+ (invoke "tar" "-xvf" #$source)
+ (symlink (string-append "conway_polynomials-" #$version) "src")
+ (invoke "python3" (assoc-ref %build-inputs "install-py")))))
+ (inputs `(("install-py" ,install-py-origin)))
+ (home-page
+ "https://www.math.rwth-aachen.de/~Frank.Luebeck/data/ConwayPol/index.html")
+ (synopsis "Tables of Conway polynomials over finite fields")
+ (description synopsis)
+ ;; no idea, Arch claims gpl, debian gpl2+??
+ (license #f))))