Merge remote-tracking branch 'origin/master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / nettle.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2016 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 nettle)
21 #:use-module (guix utils)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (gnu packages multiprecision)
27 #:use-module (gnu packages m4))
28
29 (define-public nettle-2
30 (package
31 (name "nettle")
32 (version "2.7.1")
33 (source (origin
34 (method url-fetch)
35 (uri (string-append "mirror://gnu/nettle/nettle-"
36 version ".tar.gz"))
37 (sha256
38 (base32
39 "0h2vap31yvi1a438d36lg1r1nllfx3y19r4rfxv7slrm6kafnwdw"))))
40 (build-system gnu-build-system)
41 (arguments
42 ;; 'sexp-conv' and other programs need to have their RUNPATH point to
43 ;; $libdir, which is not the case by default. Work around it.
44 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
45 (assoc-ref %outputs "out")
46 "/lib"))))
47 (outputs '("out" "debug"))
48 (native-inputs `(("m4" ,m4)))
49 (propagated-inputs `(("gmp" ,gmp)))
50 (home-page "https://www.lysator.liu.se/~nisse/nettle/")
51 (synopsis "C library for low-level cryptographic functionality")
52 (description
53 "GNU Nettle is a low-level cryptographic library. It is designed to
54 fit in easily in almost any context. It can be easily included in
55 cryptographic toolkits for object-oriented languages or in applications
56 themselves.")
57 (license gpl2+)))
58
59 (define-public nettle
60 ;; This version is not API-compatible with version 2. In particular, lsh
61 ;; cannot use it yet. So keep it separate.
62 (package (inherit nettle-2)
63 (version "3.3")
64 (source (origin
65 (method url-fetch)
66 (uri (string-append "mirror://gnu/nettle/nettle-"
67 version ".tar.gz"))
68 (sha256
69 (base32
70 "07mif3af077763vc35s1x8vzhzlgqcgxh67c1xr13jnhslkjd526"))))
71 (arguments
72 (substitute-keyword-arguments (package-arguments nettle-2)
73 ((#:configure-flags flags)
74 ;; Build "fat" binaries where the right implementation is chosen
75 ;; at run time based on CPU features (starting from 3.1.)
76 `(cons "--enable-fat" ,flags))))))