aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-04-23 00:19:50 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-05-11 11:54:41 +0200
commit40c6e4544833f71b914ebc27e219f67683db8550 (patch)
treed432d20ef8d9c483c180b1a80247d4a4e2c6a42b /gnu
parent2eccb41493c8970e1379134bd97aebc22239d1d5 (diff)
downloadguix-40c6e4544833f71b914ebc27e219f67683db8550.tar
guix-40c6e4544833f71b914ebc27e219f67683db8550.tar.gz
gnu: Add python-libnacl.
* gnu/packages/python-crypto.scm (python-libnacl): New variable.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-crypto.scm35
1 files changed, 35 insertions, 0 deletions
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index b19364a843..aa1c110f1b 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -864,3 +864,38 @@ through the Engine interface.")
none of them have everything that I'd like, so here's one more. It uses
hashlib.scrypt on Python 3.6 and OpenSSL 1.1.")
(license license:isc)))
+
+(define-public python-libnacl
+ (package
+ (name "python-libnacl")
+ (version "1.6.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "libnacl" version))
+ (sha256
+ (base32
+ "0nv7n8nfswkhl614x5mllrkvaslraa0053q11iylb337cy43vb4v"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'locate-libsodium
+ (lambda* (#:key inputs #:allow-other-keys)
+ (substitute* "libnacl/__init__.py"
+ (("(return ctypes.cdll.LoadLibrary\\(')libsodium.so('\\))"
+ _ pre post)
+ (let ((libsodium (string-append (assoc-ref inputs "libsodium")
+ "/lib/libsodium.so")))
+ (string-append pre libsodium post)))))))))
+ (native-inputs
+ `(("python-pyhamcrest" ,python-pyhamcrest)))
+ (inputs
+ `(("libsodium" ,libsodium)))
+ (home-page "https://libnacl.readthedocs.org/")
+ (synopsis "Python bindings for libsodium based on ctypes")
+ (description "@code{libnacl} is used to gain direct access to the
+functions exposed by @code{NaCl} library via @code{libsodium}. It has
+been constructed to maintain extensive documentation on how to use
+@code{NaCl} as well as being completely portable.")
+ (license license:asl2.0)))