summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2019-06-19 16:54:09 +0200
committerAndreas Enge <andreas@enge.fr>2019-06-19 18:56:55 +0200
commit01822e3ebf24031d6438fc4e7ad3a869ea12fdf4 (patch)
tree140cd76645be44ede35c7342fb454c1a6d887d06
parent3923e9d9421f2608c900d7815896e5809b154fec (diff)
downloadguix-01822e3ebf24031d6438fc4e7ad3a869ea12fdf4.tar.gz
gnu: Add zn_poly.
* gnu/packages/sagemath.scm (zn_poly): New variable.
-rw-r--r--gnu/packages/sagemath.scm47
1 files changed, 47 insertions, 0 deletions
diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm
index 07c13582de..6cf1badb3c 100644
--- a/gnu/packages/sagemath.scm
+++ b/gnu/packages/sagemath.scm
@@ -266,3 +266,50 @@ Pynac and GiNaC is that Pynac relies on Sage to provide the operations
 on numerical types, while GiNaC depends on CLN for this purpose.")
     (license license:gpl2+)
     (home-page "http://pynac.org/")))
+
+;; Sage has become upstream of the following package.
+(define-public zn_poly
+  (package
+    (name "zn_poly")
+    (version "0.9.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url (string-append "https://gitlab.com/sagemath/"
+                                  name ".git/"))
+              (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0ra5vy585bqq7g3317iw6fp44iqgqvds3j0l1va6mswimypq4vxb"))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("python" ,python-2)))
+    (inputs
+     `(("gmp" ,gmp)))
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (replace 'configure
+           ;; The configure script chokes on --enable-fast-install.
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (invoke "./configure"
+                     (string-append "--prefix=" (assoc-ref outputs "out"))
+                     "--cflags=-O3 -fPIC")))
+         (add-before 'build 'prepare-build
+           (lambda _
+             (setenv "CC" "gcc")
+             #t))
+         (add-after 'build 'build-so
+           (lambda _
+             (invoke "make" "libzn_poly.so")))
+         (add-after 'install 'install-so
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((lib (string-append (assoc-ref outputs "out") "/lib")))
+               (install-file "libzn_poly.so" lib)))))))
+    (synopsis "Arithmetic for polynomials over Z/NZ")
+    (description "zn_poly implements the arithmetic of polynomials the
+coefficients of which are modular integers.")
+    (license (list license:gpl2 license:gpl3)) ; dual licensed
+    (home-page "https://gitlab.com/sagemath/zn_poly")))