aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDamir Jelić <poljar@termina.org.uk>2018-11-28 14:54:11 +0100
committerHubert Chathi <hubert@uhoreg.ca>2019-04-08 15:04:32 -0400
commit709687a7b56d6768831766459940b6f0bb078d85 (patch)
treea40325bebc664d3a371313dae60e873f1c87f100 /python
parentf1d45c2cd330f239e41b50d6be14df7795a57c9f (diff)
python: Build the build headers with setup.py.
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ć <poljar@termina.org.uk>
Diffstat (limited to 'python')
-rw-r--r--python/Makefile6
-rw-r--r--python/olm_build.py3
2 files changed, 7 insertions, 2 deletions
diff --git a/python/Makefile b/python/Makefile
index 546de13..7f0121d 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -12,10 +12,12 @@ include/olm/olm.h: $(OLM_HEADERS)
include/olm/pk.h: include/olm/olm.h ../include/olm/pk.h
$(CPP) -I dummy -I ../include ../include/olm/pk.h -o include/olm/pk.h
-olm-python2: include/olm/olm.h include/olm/pk.h
+headers: include/olm/olm.h include/olm/pk.h
+
+olm-python2: headers
DEVELOP=$(DEVELOP) python2 setup.py build
-olm-python3: include/olm/olm.h include/olm/pk.h
+olm-python3: headers
DEVELOP=$(DEVELOP) python3 setup.py build
install: install-python2 install-python3
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",