1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
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.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages nettle)
20 #:use-module (guix utils)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages multiprecision)
26 #:use-module (gnu packages m4))
28 (define-public nettle-2
34 (uri (string-append "mirror://gnu/nettle/nettle-"
38 "0h2vap31yvi1a438d36lg1r1nllfx3y19r4rfxv7slrm6kafnwdw"))))
39 (build-system gnu-build-system)
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")
46 (outputs '("out" "debug"))
47 (native-inputs `(("m4" ,m4)))
48 (propagated-inputs `(("gmp" ,gmp)))
49 (home-page "http://www.lysator.liu.se/~nisse/nettle/")
50 (synopsis "C library for low-level cryptographic functionality")
52 "GNU Nettle is a low-level cryptographic library. It is designed to
53 fit in easily in almost any context. It can be easily included in
54 cryptographic toolkits for object-oriented languages or in applications
59 ;; This version is not API-compatible with version 2. In particular, lsh
60 ;; cannot use it yet. So keep it separate.
61 (package (inherit nettle-2)
65 (uri (string-append "mirror://gnu/nettle/nettle-"
69 "0k1x57zviysvi91lkk66cg8v819vywm5g5yqs22wppfqcifx5m2z"))))
72 (modify-phases %standard-phases
74 'configure 'disable-ifunc-init-method
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 */"))
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)))))))