diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-01-17 11:11:27 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-01-17 16:48:28 +0100 |
commit | 3f58832474a4b270e136544016a401ef773ac065 (patch) | |
tree | c617160250c3040ca964c1b72ab5957cd872b82f /ffi/lang | |
parent | 38b4108cc1eac851ac17932c5c33623dd535bebb (diff) |
openpgp-ffi: New crate.
- This creates a new crate, 'sequoia-openpgp-ffi', and moves a
handful of functions from 'sequoia-ffi' to it.
- The 'sequoia-ffi' crate is a superset of the 'sequoia-openpgp-ffi'
crate. This is accomplished by some include! magic.
- My first attempt involved having 'sequoia-ffi' depend on
'sequoia-openpgp-ffi', so that the former just re-exports the
symbols. However, that turned out to be unreliable, and might be
not what we want, because it could also duplicate parts of Rust's
standard library.
- Fixes #144.
Diffstat (limited to 'ffi/lang')
-rw-r--r-- | ffi/lang/python/Makefile | 2 | ||||
-rw-r--r-- | ffi/lang/python/sequoia/sequoia_build.py | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/ffi/lang/python/Makefile b/ffi/lang/python/Makefile index e73d3bd0..78a9481e 100644 --- a/ffi/lang/python/Makefile +++ b/ffi/lang/python/Makefile @@ -3,7 +3,7 @@ # Configuration. PREFIX ?= /usr/local DESTDIR ?= -CFLAGS += -I../../include +CFLAGS += -I../../include -I../../../openpgp-ffi/include # Tools. PYTHON ?= python3 diff --git a/ffi/lang/python/sequoia/sequoia_build.py b/ffi/lang/python/sequoia/sequoia_build.py index 07dd5bb6..ea0ad9df 100644 --- a/ffi/lang/python/sequoia/sequoia_build.py +++ b/ffi/lang/python/sequoia/sequoia_build.py @@ -2,14 +2,16 @@ from os.path import join, dirname from cffi import FFI, error from itertools import chain -inc = join(dirname(__file__), '../../../include/sequoia') +sq_inc = join(dirname(__file__), '../../../include/sequoia') +pgp_inc = join(dirname(__file__), '../../../../openpgp-ffi/include/sequoia') defs = "".join(l - for l in chain(open(join(inc, "error.h")).readlines(), - open(join(inc, "core.h")).readlines(), - open(join(inc, "openpgp/crypto.h")).readlines(), - open(join(inc, "openpgp.h")).readlines(), - open(join(inc, "net.h")).readlines(), - open(join(inc, "store.h")).readlines()) + for l in chain(open(join(pgp_inc, "openpgp/error.h")).readlines(), + open(join(pgp_inc, "io.h")).readlines(), + open(join(pgp_inc, "openpgp/crypto.h")).readlines(), + open(join(pgp_inc, "openpgp.h")).readlines(), + open(join(sq_inc, "core.h")).readlines(), + open(join(sq_inc, "net.h")).readlines(), + open(join(sq_inc, "store.h")).readlines()) if not l.startswith('#')) defs = defs.replace("INT_MAX", "{}".format(1<<31)) |