gnu: haunt: Wrap 'haunt' command so that it finds its modules.
[jackhill/guix/guix.git] / gnu / packages / nettle.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
0be199c9 2;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
2e659827 3;;;
233e7676 4;;; This file is part of GNU Guix.
2e659827 5;;;
233e7676 6;;; GNU Guix is free software; you can redistribute it and/or modify it
2e659827
LC
7;;; under the terms of the GNU General Public License as published by
8;;; the Free Software Foundation; either version 3 of the License, or (at
9;;; your option) any later version.
10;;;
233e7676 11;;; GNU Guix is distributed in the hope that it will be useful, but
2e659827
LC
12;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
233e7676 17;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
2e659827 18
1ffa7090 19(define-module (gnu packages nettle)
2891974c 20 #:use-module (guix utils)
4a44e743 21 #:use-module (guix licenses)
2e659827
LC
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
1ffa7090
LC
25 #:use-module (gnu packages multiprecision)
26 #:use-module (gnu packages m4))
2e659827 27
0be199c9 28(define-public nettle-2
2e659827
LC
29 (package
30 (name "nettle")
b17fd5e0 31 (version "2.7.1")
2a6c6795
LC
32 (source (origin
33 (method url-fetch)
34 (uri (string-append "mirror://gnu/nettle/nettle-"
35 version ".tar.gz"))
36 (sha256
37 (base32
b17fd5e0 38 "0h2vap31yvi1a438d36lg1r1nllfx3y19r4rfxv7slrm6kafnwdw"))))
2e659827 39 (build-system gnu-build-system)
64cc58b2
LC
40 (arguments
41 ;; 'sexp-conv' and other programs need to have their RUNPATH point to
42 ;; $libdir, which is not the case by default. Work around it.
43 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
44 (assoc-ref %outputs "out")
45 "/lib"))))
8cba6fc9 46 (outputs '("out" "debug"))
64cc58b2 47 (native-inputs `(("m4" ,m4)))
2e659827 48 (propagated-inputs `(("gmp" ,gmp)))
2a6c6795 49 (home-page "http://www.lysator.liu.se/~nisse/nettle/")
79c311b8 50 (synopsis "C library for low-level cryptographic functionality")
2e659827 51 (description
79c311b8
LC
52 "GNU Nettle is a low-level cryptographic library. It is designed to
53fit in easily in almost any context. It can be easily included in
54cryptographic toolkits for object-oriented languages or in applications
55themselves.")
4a44e743 56 (license gpl2+)))
39ed6749 57
0be199c9 58(define-public nettle
1511e023 59 ;; This version is not API-compatible with version 2. In particular, lsh
39ed6749 60 ;; cannot use it yet. So keep it separate.
0be199c9 61 (package (inherit nettle-2)
1511e023 62 (version "3.1.1")
39ed6749
LC
63 (source (origin
64 (method url-fetch)
65 (uri (string-append "mirror://gnu/nettle/nettle-"
66 version ".tar.gz"))
67 (sha256
68 (base32
1511e023 69 "0k1x57zviysvi91lkk66cg8v819vywm5g5yqs22wppfqcifx5m2z"))))
2891974c 70 (arguments
1c080cb6
MW
71 `(#:phases
72 (modify-phases %standard-phases
73 (add-after
74 'configure 'disable-ifunc-init-method
75 (lambda _
76 ;; Work around problems with the ifunc initialization method in
77 ;; nettle. For details, see
78 ;; <http://lists.lysator.liu.se/pipermail/nettle-bugs/2015/003389.html>
79 ;; and <https://sourceware.org/ml/libc-help/2015-06/msg00010.html>.
80 (substitute* "config.h"
81 (("#define HAVE_LINK_IFUNC 1")
82 "/* #undef HAVE_LINK_IFUNC */"))
83 #t)))
84 ,@(substitute-keyword-arguments (package-arguments nettle-2)
85 ((#:configure-flags flags)
86 ;; Build "fat" binaries where the right implementation is chosen
87 ;; at run time based on CPU features (starting from 3.1.)
88 `(cons "--enable-fat" ,flags)))))))