summaryrefslogtreecommitdiff
path: root/gnu/packages/multiprecision.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-12-03 19:15:17 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-12-03 19:15:17 +0100
commit99f63f011df2aab38e98d7ee4608a8c70bf74c4d (patch)
tree3f224028f30c60f2ed7b9846365ad926192fc7e9 /gnu/packages/multiprecision.scm
parente9a8b603337802a77ff2d68f0d30dc0e67721e3a (diff)
parent4f03aa23e805bd653de774e1d74ed2f50826899b (diff)
downloadguix-patches-99f63f011df2aab38e98d7ee4608a8c70bf74c4d.tar
guix-patches-99f63f011df2aab38e98d7ee4608a8c70bf74c4d.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'gnu/packages/multiprecision.scm')
-rw-r--r--gnu/packages/multiprecision.scm68
1 files changed, 67 insertions, 1 deletions
diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index e185a98359..71e1efcd8c 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -26,6 +26,7 @@
(define-module (gnu packages multiprecision)
#:use-module (guix licenses)
#:use-module (gnu packages)
+ #:use-module (gnu packages autotools)
#:use-module (gnu packages m4)
#:use-module (gnu packages gcc)
#:use-module (guix packages)
@@ -108,7 +109,7 @@ algebra.")
library for performing multiple-precision, floating-point computations with
correct rounding.")
(license lgpl3+)
- (home-page "http://www.mpfr.org/")))
+ (home-page "https://www.mpfr.org/")))
(define-public mpc
(package
@@ -225,3 +226,68 @@ minor changes to the source code. In most cases only a few type statements
and (for Fortran-90 programs) read/write statements need to be changed. PSLQ
and numerical quadrature programs are included.")
(license bsd-3)))
+
+(define-public tomsfastmath
+ (package
+ (name "tomsfastmath")
+ (version "0.13.0")
+ (synopsis "Large integer arithmetic library")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/libtom/tomsfastmath/"
+ "releases/download/v" version "/"
+ "tfm-" (version-major+minor version) ".tar.bz2"))
+ (sha256
+ (base32
+ "01rlsvp6lskk2a0gfdi24ak5h8vdwi6kqbvbwjnmb92r0zrfdvwd"))
+ (patches (search-patches "tomsfastmath-constness.patch"))))
+ (build-system gnu-build-system)
+ (native-inputs
+ `(("libtool" ,libtool)))
+ (arguments
+ `(#:make-flags (list "-f" "makefile.shared"
+ (string-append "LIBPATH=" %output "/lib")
+ (string-append "INCPATH=" %output "/include")
+ "GROUP=root" "USER=root"
+ "CC=gcc")
+ #:phases
+ (modify-phases %standard-phases
+ (delete 'configure) ;no configuration
+ (replace 'check
+ (lambda* (#:key make-flags #:allow-other-keys)
+ (and (zero? (apply system* "make"
+ "stest" "test_standalone"
+ make-flags))
+ (zero? (system* "./stest"))
+ (zero? (system* "./test")))))
+ (add-before 'install 'install-nogroup
+ (lambda _
+ ;; Let permissions inherit from the current process
+ (substitute* "makefile.shared"
+ (("-g \\$\\(GROUP\\) -o \\$\\(USER\\)") ""))
+ #t))
+ (add-after 'install 'install-doc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((docdir (string-append (assoc-ref outputs "out")
+ "/share/doc/tomsfastmath")))
+ (install-file "doc/tfm.pdf" docdir)
+ #t)))
+ (add-after 'install 'install-pc
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out"))
+ (pc-dir (string-append out "/lib/pkgconfig")))
+ (call-with-output-file "tomsfastmath.pc"
+ (lambda (port)
+ (format port "~
+Name: TomsFastMath
+Description: ~a
+Version: ~a
+Libs: -L~a/lib -ltfm~%"
+ ,synopsis ,version out)))
+ (install-file "tomsfastmath.pc" pc-dir)
+ #t))))))
+ (home-page "http://www.libtom.org/TomsFastMath/")
+ (description "TomsFastMath is a large integer library written in portable
+ISO C. It is a port of LibTomMath with optional support for inline assembler
+multiplies.")
+ (license public-domain)))