From 8cbb60e4769cdf0d85cd62a114bd4564feb48c46 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Tue, 25 Apr 2023 18:47:14 -0400 Subject: [PATCH] improve Python packaging --- python/MANIFEST.in | 4 +--- python/olm_build.py | 11 +++-------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/python/MANIFEST.in b/python/MANIFEST.in index 824b377..02a75ce 100644 --- a/python/MANIFEST.in +++ b/python/MANIFEST.in @@ -1,5 +1,3 @@ -include include/olm/olm.h -include include/olm/pk.h -include include/olm/sas.h +include include/olm/*.h include Makefile include olm_build.py diff --git a/python/olm_build.py b/python/olm_build.py index f92fc87..070c06e 100644 --- a/python/olm_build.py +++ b/python/olm_build.py @@ -31,13 +31,6 @@ link_args = ["-L../build"] if DEVELOP and DEVELOP.lower() in ["yes", "true", "1"]: link_args.append('-Wl,-rpath=../build') -# If libolm is compiled statically, we may need to link to the C++ standard -# library dynamically. This flag allows passing the required linker flag to do -# so. -CXX_LIB = os.environ.get("CXX_LIB") -if CXX_LIB: - link_args.extend(CXX_LIB.split()) - headers_build = subprocess.Popen("make headers", shell=True) headers_build.wait() @@ -52,7 +45,9 @@ ffibuilder.set_source( """, libraries=["olm"], extra_compile_args=compile_args, - extra_link_args=link_args) + extra_link_args=link_args, + source_extension=".cpp", # we need to link the C++ standard library, so use a C++ extension +) with open(os.path.join(PATH, "include/olm/error.h")) as f: ffibuilder.cdef(f.read(), override=True)