guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/02: gnu: Add tiny-bignum.


From: guix-commits
Subject: 01/02: gnu: Add tiny-bignum.
Date: Tue, 8 Dec 2020 04:28:45 -0500 (EST)

cbaines pushed a commit to branch master
in repository guix.

commit b5c51ae0864e395f692fd78aa723109856914fff
Author: Ryan Prior <rprior@protonmail.com>
AuthorDate: Tue Dec 1 01:44:59 2020 +0000

    gnu: Add tiny-bignum.
    
    * gnu/packages/maths.scm (tiny-bignum): New variable.
    
    Signed-off-by: Christopher Baines <mail@cbaines.net>
---
 gnu/packages/maths.scm | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index 7d841af..47cc821 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -4987,6 +4987,58 @@ be fed to @command{tcalc} through the command line.")
   (home-page "https://sites.google.com/site/mohammedisam2000/tcalc";)
   (license license:gpl3+)))
 
+(define-public tiny-bignum
+  (let ((commit "1d7a1f9b8e77316187a6b3eae8e68d60a6f9a4d4"))
+    (package
+     (name "tiny-bignum")
+     (version (git-version "0" "0" commit))
+     (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+              (url "https://github.com/kokke/tiny-bignum-c";)
+              (commit commit)))
+        (file-name (git-file-name "tiny-bignum" commit))
+        (sha256
+         (base32 "0vj71qlhlaa7d92bfar1kwqv6582dqrby8x3kdw0yzh82k2023g6"))))
+     (build-system gnu-build-system)
+     (arguments
+      `(#:phases
+        (modify-phases %standard-phases
+          (delete 'configure)
+          (add-after 'unpack 'patch-tests
+            (lambda _
+              (substitute* "scripts/test_rand.py"
+                (("\t") "  ")
+                (("\" % (\\w+)" _ symbol) (string-append "\" % int(" symbol 
")")))
+              #t))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "make" "test"))
+              #t))
+          (replace 'install
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let ((share (string-append (assoc-ref outputs "out") "/share"))
+                    (doc (string-append (assoc-ref outputs "out") "/doc")))
+                (mkdir-p share)
+                (install-file "bn.c" share)
+                (install-file "bn.h" share)
+                (mkdir-p doc)
+                (install-file "LICENSE" doc)
+                (install-file "README.md" doc))
+              #t)))))
+     (native-inputs
+      `(("python" ,python-wrapper)))
+     (home-page "https://github.com/kokke/tiny-bignum-c";)
+     (synopsis "Small portable multiple-precision unsigned integer arithmetic 
in C")
+     (description
+      "This library provides portable Arbitrary-precision unsigned integer
+arithmetic in C, for calculating with large numbers.  Basic arithmetic (+, -,
+*, /, %) and bitwise operations (&, |, ^. <<, >>) plus increments, decrements
+and comparisons are supported.")
+     (license license:unlicense))))
+
 (define-public sundials
   (package
     (name "sundials")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]