summary refs log tree commit diff
path: root/gnu/packages/crypto.scm
diff options
context:
space:
mode:
authorMathieu Othacehe <othacehe@gnu.org>2021-10-18 14:33:09 +0000
committerMathieu Othacehe <othacehe@gnu.org>2021-10-18 14:37:26 +0000
commite486b2b674badc80627b11077b7df2ac1cab92d8 (patch)
tree5909547a69c4b185b878c8f0fe8152f1c01fef04 /gnu/packages/crypto.scm
parent0df1eb029efe5ebe3f02e36fa650cae4aaba89ec (diff)
parent88badc074a5dbebf80115918cf6c0009075154d2 (diff)
downloadguix-e486b2b674badc80627b11077b7df2ac1cab92d8.tar.gz
Merge remote-tracking branch 'signed/master' into core-updates
Diffstat (limited to 'gnu/packages/crypto.scm')
-rw-r--r--gnu/packages/crypto.scm35
1 files changed, 35 insertions, 0 deletions
diff --git a/gnu/packages/crypto.scm b/gnu/packages/crypto.scm
index 08e53cf81e..79086a9620 100644
--- a/gnu/packages/crypto.scm
+++ b/gnu/packages/crypto.scm
@@ -72,6 +72,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
   #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages python-check)
   #:use-module (gnu packages readline)
   #:use-module (gnu packages search)
   #:use-module (gnu packages serialization)
@@ -92,6 +93,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system perl)
+  #:use-module (guix build-system python)
   #:use-module (guix utils)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26))
@@ -1281,6 +1283,39 @@ API.")
     (home-page "https://matrix.org/docs/projects/other/olm/")
     (license license:asl2.0)))
 
+(define-public python-olm
+  (package
+    ;; python-olm is part of libolm and must be updated at the same time.
+    (inherit libolm)
+    (name "python-olm")
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'chdir
+           (lambda _
+             (chdir "python")))
+         (add-before 'build 'set-preprocessor
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "CPP" "gcc -E")))
+         (replace 'check
+           (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "pytest")))))))
+    (inputs `(("libolm" ,libolm)))
+    (propagated-inputs
+     `(("python-cffi" ,python-cffi)
+       ("python-future" ,python-future)))
+    (native-inputs
+     `(("python-pytest" ,python-pytest)
+       ("python-pytest-benchmark" ,python-pytest-benchmark)
+       ("python-aspectlib" ,python-aspectlib)))
+    (synopsis "Python bindings for libolm")
+    (description "The libolm library implements the Double Ratchet
+cryptographic ratchet.  It is written in C and C++11, and exposed as a C
+API.  This package contains its Python bindings.")))
+
 (define-public hash-extender
   (let ((commit "cb8aaee49f93e9c0d2f03eb3cafb429c9eed723d")
         (revision "2"))