From f160d693b627a1159ed5837a4e9630100ab3f67e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 28 Nov 2018 14:54:09 +0100 Subject: python: Add PK bindings. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds bindings to the PK part of the Olm library contained in the pk.h header file. Encryption, decryption as well as pickling/unpickling of the decryption object is supported. Signed-off-by: Damir Jelić --- python/olm_build.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'python/olm_build.py') diff --git a/python/olm_build.py b/python/olm_build.py index ee836d8..d3eda79 100644 --- a/python/olm_build.py +++ b/python/olm_build.py @@ -39,6 +39,7 @@ ffibuilder.set_source( #include #include #include + #include """, libraries=["olm"], extra_compile_args=compile_args, @@ -47,5 +48,8 @@ ffibuilder.set_source( with open(os.path.join(PATH, "include/olm/olm.h")) as f: ffibuilder.cdef(f.read(), override=True) +with open(os.path.join(PATH, "include/olm/pk.h")) as f: + ffibuilder.cdef(f.read(), override=True) + if __name__ == "__main__": ffibuilder.compile(verbose=True) -- cgit v1.2.3 From 709687a7b56d6768831766459940b6f0bb078d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Wed, 28 Nov 2018 14:54:11 +0100 Subject: python: Build the build headers with setup.py. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows downstream users to install this python module with pip as well as allowing people to declare it as a dependency in their setup.py. Signed-off-by: Damir Jelić --- python/olm_build.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'python/olm_build.py') diff --git a/python/olm_build.py b/python/olm_build.py index d3eda79..97ab3b2 100644 --- a/python/olm_build.py +++ b/python/olm_build.py @@ -18,6 +18,7 @@ from __future__ import unicode_literals import os +import subprocess from cffi import FFI @@ -32,6 +33,8 @@ link_args = ["-L../build"] if DEVELOP and DEVELOP.lower() in ["yes", "true", "1"]: link_args.append('-Wl,-rpath=../build') +headers_build = subprocess.Popen("make headers", shell=True) +headers_build.wait() ffibuilder.set_source( "_libolm", -- cgit v1.2.3