Commit | Line | Data |
---|---|---|
233e7676 | 1 | ;;; GNU Guix --- Functional package management for GNU |
0be199c9 | 2 | ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org> |
42395bf5 | 3 | ;;; Copyright © 2016 Mark H Weaver <mhw@netris.org> |
3b2098d9 | 4 | ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il> |
2e659827 | 5 | ;;; |
233e7676 | 6 | ;;; This file is part of GNU Guix. |
2e659827 | 7 | ;;; |
233e7676 | 8 | ;;; GNU Guix is free software; you can redistribute it and/or modify it |
2e659827 LC |
9 | ;;; under the terms of the GNU General Public License as published by |
10 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
11 | ;;; your option) any later version. | |
12 | ;;; | |
233e7676 | 13 | ;;; GNU Guix is distributed in the hope that it will be useful, but |
2e659827 LC |
14 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | ;;; GNU General Public License for more details. | |
17 | ;;; | |
18 | ;;; You should have received a copy of the GNU General Public License | |
233e7676 | 19 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. |
2e659827 | 20 | |
1ffa7090 | 21 | (define-module (gnu packages nettle) |
2891974c | 22 | #:use-module (guix utils) |
4a44e743 | 23 | #:use-module (guix licenses) |
2e659827 LC |
24 | #:use-module (guix packages) |
25 | #:use-module (guix download) | |
26 | #:use-module (guix build-system gnu) | |
1ffa7090 LC |
27 | #:use-module (gnu packages multiprecision) |
28 | #:use-module (gnu packages m4)) | |
2e659827 | 29 | |
0be199c9 | 30 | (define-public nettle-2 |
2e659827 LC |
31 | (package |
32 | (name "nettle") | |
b17fd5e0 | 33 | (version "2.7.1") |
2a6c6795 LC |
34 | (source (origin |
35 | (method url-fetch) | |
36 | (uri (string-append "mirror://gnu/nettle/nettle-" | |
37 | version ".tar.gz")) | |
38 | (sha256 | |
39 | (base32 | |
b17fd5e0 | 40 | "0h2vap31yvi1a438d36lg1r1nllfx3y19r4rfxv7slrm6kafnwdw")))) |
2e659827 | 41 | (build-system gnu-build-system) |
64cc58b2 LC |
42 | (arguments |
43 | ;; 'sexp-conv' and other programs need to have their RUNPATH point to | |
44 | ;; $libdir, which is not the case by default. Work around it. | |
45 | '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath=" | |
46 | (assoc-ref %outputs "out") | |
b4052c96 MB |
47 | "/lib")) |
48 | #:phases (modify-phases %standard-phases | |
49 | (add-after 'install 'move-static-libraries | |
50 | (lambda* (#:key outputs #:allow-other-keys) | |
51 | (let ((out (assoc-ref outputs "out")) | |
52 | (slib (string-append (assoc-ref outputs "static") | |
53 | "/lib"))) | |
54 | (mkdir-p slib) | |
55 | (with-directory-excursion (string-append out "/lib") | |
56 | (for-each (lambda (ar) | |
57 | (rename-file ar (string-append | |
58 | slib "/" | |
59 | (basename ar)))) | |
60 | (find-files "." "\\.a$"))) | |
61 | #t)))))) | |
62 | (outputs '("out" "debug" "static")) | |
64cc58b2 | 63 | (native-inputs `(("m4" ,m4))) |
2e659827 | 64 | (propagated-inputs `(("gmp" ,gmp))) |
31bd09e5 | 65 | (home-page "https://www.lysator.liu.se/~nisse/nettle/") |
79c311b8 | 66 | (synopsis "C library for low-level cryptographic functionality") |
2e659827 | 67 | (description |
79c311b8 LC |
68 | "GNU Nettle is a low-level cryptographic library. It is designed to |
69 | fit in easily in almost any context. It can be easily included in | |
70 | cryptographic toolkits for object-oriented languages or in applications | |
71 | themselves.") | |
4a44e743 | 72 | (license gpl2+))) |
39ed6749 | 73 | |
0be199c9 | 74 | (define-public nettle |
1511e023 | 75 | ;; This version is not API-compatible with version 2. In particular, lsh |
39ed6749 | 76 | ;; cannot use it yet. So keep it separate. |
0be199c9 | 77 | (package (inherit nettle-2) |
6c6e56fe | 78 | (version "3.5.1") |
39ed6749 LC |
79 | (source (origin |
80 | (method url-fetch) | |
81 | (uri (string-append "mirror://gnu/nettle/nettle-" | |
82 | version ".tar.gz")) | |
83 | (sha256 | |
84 | (base32 | |
6c6e56fe | 85 | "06clvkdfxhlbagn4afssylmn5vrak59dlmnvy8b2xc31hycs3k3m")))) |
2891974c | 86 | (arguments |
42395bf5 MW |
87 | (substitute-keyword-arguments (package-arguments nettle-2) |
88 | ((#:configure-flags flags) | |
89 | ;; Build "fat" binaries where the right implementation is chosen | |
90 | ;; at run time based on CPU features (starting from 3.1.) | |
91 | `(cons "--enable-fat" ,flags)))))) |