From 2aad86ea8418e27029c42d7d455cda6f92d61b36 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Thu, 17 Jun 2021 11:55:16 -0400 Subject: [PATCH] fix Python build --- python/Makefile | 9 ++++++--- python/dummy/olm/error.h | 0 python/olm_build.py | 3 +++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 python/dummy/olm/error.h diff --git a/python/Makefile b/python/Makefile index 6bba9cd..d70aba5 100644 --- a/python/Makefile +++ b/python/Makefile @@ -1,7 +1,7 @@ all: olm-python2 olm-python3 OLM_HEADERS = ../include/olm/olm.h ../include/olm/inbound_group_session.h \ - ../include/olm/outbound_group_session.h \ + ../include/olm/outbound_group_session.h include/olm/olm.h: $(OLM_HEADERS) mkdir -p include/olm @@ -10,12 +10,15 @@ include/olm/olm.h: $(OLM_HEADERS) echo 'void *memset(void *s, int c, size_t n);' >> include/olm/olm.h include/olm/pk.h: include/olm/olm.h ../include/olm/pk.h - $(CPP) -I dummy -I ../include -o include/olm/pk.h ../include/olm/pk.h + $(CPP) -I dummy -I ../include -o include/olm/pk.h ../include/olm/pk.h include/olm/sas.h: include/olm/olm.h ../include/olm/sas.h $(CPP) -I dummy -I ../include -o include/olm/sas.h ../include/olm/sas.h -headers: include/olm/olm.h include/olm/pk.h include/olm/sas.h +include/olm/error.h: include/olm/olm.h ../include/olm/error.h + $(CPP) -I dummy -I ../include -o include/olm/error.h ../include/olm/error.h + +headers: include/olm/olm.h include/olm/pk.h include/olm/sas.h include/olm/error.h olm-python2: headers DEVELOP=$(DEVELOP) python2 setup.py build diff --git a/python/dummy/olm/error.h b/python/dummy/olm/error.h new file mode 100644 index 0000000..e69de29 diff --git a/python/olm_build.py b/python/olm_build.py index 0606337..38053e0 100644 --- a/python/olm_build.py +++ b/python/olm_build.py @@ -49,6 +49,9 @@ ffibuilder.set_source( extra_compile_args=compile_args, extra_link_args=link_args) +with open(os.path.join(PATH, "include/olm/error.h")) as f: + ffibuilder.cdef(f.read(), override=True) + with open(os.path.join(PATH, "include/olm/olm.h")) as f: ffibuilder.cdef(f.read(), override=True)