1
0
Fork 0
mirror of https://github.com/deltachat/deltachat-core.git synced 2025-10-04 18:29:19 +02:00

WIP: First stop towards python bindings

This is a very rough first stab at compiling CFFI Python bindings
for deltachat-core.
This commit is contained in:
Floris Bruynooghe 2017-12-30 12:53:58 +01:00 committed by Floris Bruynooghe
parent 231d6b6a87
commit b1261ed028
4 changed files with 55 additions and 0 deletions

View file

@ -0,0 +1,23 @@
import subprocess
import tempfile
import cffi
ffibuilder = cffi.FFI()
ffibuilder.set_source(
'deltachat.capi',
"""
#include <deltachat/mrmailbox.h>
""",
libraries=['deltachat'],
)
with tempfile.NamedTemporaryFile(mode='r') as fp:
proc = subprocess.run(['gcc', '-E', '-o', fp.name, '-DPY_CFFI=1',
'../src/mrmailbox.h'])
proc.check_returncode()
ffibuilder.cdef(fp.read())
if __name__ == '__main__':
ffibuilder.compile(verbose=True)