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:
parent
231d6b6a87
commit
b1261ed028
4 changed files with 55 additions and 0 deletions
23
python/src/deltachat/_build.py
Normal file
23
python/src/deltachat/_build.py
Normal 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)
|
Loading…
Add table
Add a link
Reference in a new issue