nettle.scm 3.1 KB

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