gnu: Remove python2-pyaudio.
[jackhill/guix/guix.git] / gnu / packages / multiprecision.scm
index b3a5ec5..6c0d163 100644 (file)
@@ -6,7 +6,8 @@
 ;;; Copyright © 2016, 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2018 Eric Bavier <bavier@member.fsf.org>
-;;; Copyright © 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2018, 2019, 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -38,7 +39,7 @@
 (define-public gmp
   (package
    (name "gmp")
-   (version "6.2.0")
+   (version "6.2.1")
    (source (origin
             (method url-fetch)
             (uri
                             version ".tar.xz"))
             (sha256
              (base32
-              "09hmg8k63mbfrx1x3yy6y1yzbbq85kw5avbibhcgrg9z3ganr3i5"))
+              "1wml97fdmpcynsbw9yl77rj29qibfp652d0w3222zlfx5j8jjj7x"))
             (patches (search-patches "gmp-faulty-test.patch"))))
    (build-system gnu-build-system)
-   (native-inputs `(("m4" ,m4)))
+   (native-inputs (list m4))
    (outputs '("out" "debug"))
    (arguments
     `(#:parallel-tests? #f ; mpz/reuse fails otherwise
@@ -113,16 +114,16 @@ It is aimed at use in, for example, cryptography and computational algebra.")
 (define-public mpfr
   (package
    (name "mpfr")
-   (version "4.0.2")
+   (version "4.1.0")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/mpfr/mpfr-" version
                                 ".tar.xz"))
             (sha256 (base32
-                     "12m3amcavhpqygc499s3fzqlb8f2j2rr7fkqsm10xbjfc04fffqx"))))
+                     "0zwaanakrqjf84lfr5hfsdr7hncwv9wj0mchlr7cmxigfgqs760c"))))
    (build-system gnu-build-system)
    (outputs '("out" "debug"))
-   (propagated-inputs `(("gmp" ,gmp)))            ; <mpfr.h> refers to <gmp.h>
+   (propagated-inputs (list gmp))            ; <mpfr.h> refers to <gmp.h>
    (synopsis "C library for arbitrary-precision floating-point arithmetic")
    (description
     "GNU@tie{}@acronym{MPFR, Multiple Precision Floating-Point Reliably} is a C
@@ -134,18 +135,18 @@ correct rounding.")
 (define-public mpc
   (package
    (name "mpc")
-   (version "1.1.0")
+   (version "1.2.1")
    (source (origin
             (method url-fetch)
             (uri (string-append
                   "mirror://gnu/mpc/mpc-" version ".tar.gz"))
             (sha256
               (base32
-                "0biwnhjm3rx3hc0rfpvyniky4lpzsvdcwhmcn7f0h4iw2hwcb1b9"))))
+                "0n846hqfqvmsmim7qdlms0qr86f1hck19p12nq3g3z2x74n3sl0p"))))
    (build-system gnu-build-system)
    (outputs '("out" "debug"))
-   (propagated-inputs `(("gmp" ,gmp)              ; <mpc.h> refers to both
-                        ("mpfr" ,mpfr)))
+   (propagated-inputs (list gmp ; <mpc.h> refers to both
+                            mpfr))
    (synopsis "C library for arbitrary-precision complex arithmetic")
    (description
     "GNU@tie{}@acronym{MPC, Multiple Precision Complex library} is a C library
@@ -175,8 +176,8 @@ precision and correctly rounds the results.")
        ("libtool" ,libtool)
        ("texinfo" ,texinfo)))
     (propagated-inputs
-     `(("gmp" ,gmp)                     ; <mpfi.h> refers to both
-       ("mpfr" ,mpfr)))
+     (list gmp ; <mpfi.h> refers to both
+           mpfr))
     (home-page "https://gforge.inria.fr/projects/mpfi/")
     (synopsis "C library for arbitrary-precision interval arithmetic")
     (description
@@ -203,8 +204,8 @@ multiple-precision arithmetic.")
        (sha256
         (base32 "1cdmvb4hsa161rfdjqyhd9sb3fcr43p3a6nsj7cb4kn9f94qmjpj"))))
     (build-system gnu-build-system)
-    (propagated-inputs `(("gmp" ,gmp)   ; <mpfi.h> refers to both
-                         ("mpfr" ,mpfr)))
+    (propagated-inputs (list gmp ; <mpfi.h> refers to both
+                             mpfr))
     (arguments
      `(#:parallel-build? #f))
     (synopsis "C++ package for real arithmetic based on the Real-RAM concept")
@@ -221,19 +222,20 @@ error.  Additionally, iRRAM uses the concept of multi-valued functions.")
 (define-public qd
   (package
     (name "qd")
-    (version "2.3.22")
+    (version "2.3.23")
     (source
      (origin
        (method url-fetch)
        (uri (string-append "https://crd-legacy.lbl.gov/~dhbailey/mpdist/qd-"
                            version ".tar.gz"))
        (sha256
-        (base32 "1lq609rsp6zpg7zda75lyxzzk1fabzp4jn88j7xfk84mdgjgzh9h"))))
+        (base32 "09pfd77rmy370hy7qdqw84z21y9zpl3fcwzf93rhiv0kwhfg9smk"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("gfortran" ,gfortran)))
+     (list gfortran))
     (arguments
      `(#:configure-flags `("--disable-enable_fma" ;weird :/
+                           "--disable-static"
                            "--enable-shared"
                            ,,@(if (string-prefix? "aarch64"
                                                   (or (%current-target-system)
@@ -256,6 +258,29 @@ and (for Fortran-90 programs) read/write statements need to be changed.  PSLQ
 and numerical quadrature programs are included.")
     (license bsd-3)))
 
+(define-public cln
+  (package
+    (name "cln")
+    (version "1.3.6")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://www.ginac.de/CLN/cln-"
+                           version ".tar.bz2"))
+       (sha256
+        (base32 "0jlq9l4hphk7qqlgqj9ihjp4m3rwjbhk6q4v00lsbgbri07574pl"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:configure-flags (list "--disable-static")))
+    (inputs
+     (list gmp))
+    (home-page "https://www.ginac.de/CLN/")
+    (synopsis "Library for arbitrary precision computations")
+    (description "CLN is a C++ library for efficient computations with all
+kinds of numbers in arbitrary precision.  It provides a rich set of number
+classes and elementary, logical and transcendental functions.")
+    (license gpl2+)))
+
 (define-public tomsfastmath
   (package
     (name "tomsfastmath")
@@ -271,7 +296,7 @@ and numerical quadrature programs are included.")
                 "0f0pmiaskh89sp0q933pafxb914shpaj5ad8sb5rzk1wv8d7mja7"))))
     (build-system gnu-build-system)
     (native-inputs
-     `(("libtool" ,libtool)))
+     (list libtool))
     (arguments
      `(#:make-flags (list "-f" "makefile.shared"
                           (string-append "LIBPATH=" %output "/lib")
@@ -320,6 +345,82 @@ ISO C.  It is a port of LibTomMath with optional support for inline assembler
 multiplies.")
     (license public-domain)))
 
+(define-public libtomcrypt
+  (package
+    (name "libtomcrypt")
+    (version "1.18.2")
+    (outputs '("out" "static"))
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append "https://github.com/libtom/libtomcrypt"
+                            "/releases/download/v" version
+                            "/crypt-" version ".tar.xz"))
+        (sha256
+         (base32
+          "113vfrgapyv72lalhd3nkw7jnks8az0gcb5wqn9hj19nhcxlrbcn"))
+        (modules '((guix build utils)))
+        (snippet
+         '(begin
+            ;; Patch CVE-2019-17362
+            ;; https://github.com/libtom/libtomcrypt/commit/25c26a3b7a9ad8192ccc923e15cf62bf0108ef94
+            (substitute* "src/pk/asn1/der/utf8/der_decode_utf8_string.c"
+              (("z > 4") "z == 1 || z > 4"))
+            #t))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'configure) ; no configure
+         (add-after 'unpack 'prepare-build
+           (lambda _
+             ;; We want the shared library by default so force it to be the
+             ;; default makefile target.
+             (delete-file "makefile")
+             (symlink "makefile.shared" "makefile")
+             ;; We link to libtommath, so we need to add it to the pc file
+             (substitute* "libtomcrypt.pc.in"
+               (("-ltomcrypt") "-ltomcrypt -ltommath"))
+             #t))
+         (add-after 'build 'build-static
+           (lambda* (#:key make-flags #:allow-other-keys)
+             (apply invoke "make" "-f" "makefile.unix" make-flags)))
+         (replace 'check
+           (lambda* (#:key test-target make-flags #:allow-other-keys)
+             (apply invoke "make" "-f" "makefile.unix" test-target make-flags)
+             (invoke "./test")))
+         (add-after 'install 'install-static-library
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let ((out (assoc-ref outputs "out"))
+                   (static (assoc-ref outputs "static")))
+               (mkdir-p (string-append static "/lib"))
+               (mkdir-p (string-append static "/include"))
+               (rename-file (string-append out "/lib/libtomcrypt.a")
+                            (string-append static "/lib/libtomcrypt.a"))
+               (copy-recursively (string-append out "/include")
+                                 (string-append static "/include"))
+               #t))))
+       #:test-target "test"
+       #:make-flags
+       (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+             "CFLAGS += -DLTM_DESC -DUSE_LTM"
+             (string-append "EXTRALIBS="
+                            (search-input-file %build-inputs
+                                               "/lib/libtommath.so"))
+             (string-append "CC=" ,(cc-for-target)))))
+    (native-inputs
+     (list libtool))
+    (inputs
+     (list libtommath))
+    (home-page "https://www.libtom.net/LibTomCrypt/")
+    (synopsis "Cryptographic toolkit")
+    (description "LibTomCrypt is a fairly comprehensive, modular and portable
+cryptographic toolkit that provides developers with a vast array of well known
+published block ciphers, one-way hash functions, chaining modes, pseudo-random
+number generators, public key cryptography and a plethora of other routines.")
+    (properties `((lint-hidden-cve . ("CVE-2019-17362"))))
+    (license unlicense)))
+
 (define-public libtommath
   (package
     (name "libtommath")
@@ -363,7 +464,7 @@ multiplies.")
        #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
                           "CC=gcc")))
     (native-inputs
-     `(("libtool" ,libtool)))
+     (list libtool))
     (home-page "https://www.libtom.net/LibTomMath/")
     (synopsis "Portable number theoretic multiple-precision integer library")
     (description "LibTomMath is a portable number theoretic multiple-precision