gnu: gnupg: Add version 2.1.2.
[jackhill/guix/guix.git] / gnu / packages / multiprecision.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;;
5 ;;; This file is part of GNU Guix.
6 ;;;
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
11 ;;;
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
16 ;;;
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19
20 (define-module (gnu packages multiprecision)
21 #:use-module (guix licenses)
22 #:use-module (gnu packages)
23 #:use-module (gnu packages m4)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix utils)
27 #:use-module (guix build-system gnu))
28
29 (define-public gmp
30 (package
31 (name "gmp")
32 (version "6.0.0a")
33 (source (origin
34 (method url-fetch)
35 (uri
36 (string-append "mirror://gnu/gmp/gmp-"
37 version ".tar.xz"))
38 (sha256
39 (base32
40 "0r5pp27cy7ch3dg5v0rsny8bib1zfvrza6027g2mp5f6v8pd6mli"))
41 (patches (list (search-patch "gmp-arm-asm-nothumb.patch")))))
42 (build-system gnu-build-system)
43 (native-inputs `(("m4" ,m4)))
44 (outputs '("out" "debug"))
45 (arguments `(#:configure-flags
46 '(;; Build a "fat binary", with routines for several
47 ;; sub-architectures.
48 "--enable-fat"
49 "--enable-cxx"
50
51 ;; FIXME: gmp-6.0.0a's config.guess fails on
52 ;; multi-core armhf systems.
53 ,@(if (%current-target-system)
54 '()
55 (let ((triplet
56 (nix-system->gnu-triplet (%current-system))))
57 (list (string-append "--build=" triplet)))))))
58 (synopsis "Multiple-precision arithmetic library")
59 (description
60 "GMP is a library for arbitrary precision arithmetic, operating on
61 signed integers, rational numbers and floating point numbers. The precision
62 is only limited by the available memory. The library is highly optimized,
63 with a design focus on execution speed. It is aimed at use in, for example,
64 cryptography and computational algebra.")
65 (license lgpl3+)
66 (home-page "http://gmplib.org/")))
67
68 (define-public mpfr
69 (package
70 (name "mpfr")
71 (version "3.1.2")
72 (source (origin
73 (method url-fetch)
74 (uri (string-append "mirror://gnu/mpfr/mpfr-" version
75 ".tar.xz"))
76 (sha256 (base32
77 "0fs501qi8l523gs3cpy4jjcnvwxggyfbklcys80wq236xx3hz79r"))))
78 (build-system gnu-build-system)
79 (outputs '("out" "debug"))
80 (propagated-inputs `(("gmp" ,gmp))) ; <mpfr.h> refers to <gmp.h>
81 (synopsis "C library for arbitrary precision floating-point arithmetic")
82 (description
83 "GNU MPFR is a C library for performing multiple-precision,
84 floating-point computations with correct rounding.")
85 (license lgpl3+)
86 (home-page "http://www.mpfr.org/")))
87
88 (define-public mpc
89 (package
90 (name "mpc")
91 (version "1.0.2")
92 (source (origin
93 (method url-fetch)
94 (uri (string-append
95 "mirror://gnu/mpc/mpc-" version ".tar.gz"))
96 (sha256 (base32
97 "1264h3ivldw5idph63x35dqqdzqqbxrm5vlir0xyx727i96zaqdm"))))
98 (build-system gnu-build-system)
99 (outputs '("out" "debug"))
100 (propagated-inputs `(("gmp" ,gmp) ; <mpc.h> refers to both
101 ("mpfr" ,mpfr)))
102 (synopsis "C library for arbitrary precision complex arithmetic")
103 (description
104 "GNU MPC is a C library for performing arithmetic on complex numbers.
105 It supports arbitrarily high precision and it correctly rounds the results.")
106 (license lgpl3+)
107 (home-page "http://mpc.multiprecision.org/")))