mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 02:48:08 +01:00
python-cffi: fix out-of-tree build
The main idea is to replace the hack of copying version.txt into the bindings source with a generated _notmuch_config.py file. This will mean that the bindings only build after configuring and building notmuch itself. Given those constraints, "pip install ." should work.
This commit is contained in:
parent
95f0c59fe9
commit
f17d75b83c
5 changed files with 13 additions and 6 deletions
|
@ -54,7 +54,6 @@ update-versions:
|
||||||
sed -i -e "s/^__VERSION__[[:blank:]]*=.*$$/__VERSION__ = \'${VERSION}\'/" \
|
sed -i -e "s/^__VERSION__[[:blank:]]*=.*$$/__VERSION__ = \'${VERSION}\'/" \
|
||||||
-e "s/^SOVERSION[[:blank:]]*=.*$$/SOVERSION = \'${LIBNOTMUCH_VERSION_MAJOR}\'/" \
|
-e "s/^SOVERSION[[:blank:]]*=.*$$/SOVERSION = \'${LIBNOTMUCH_VERSION_MAJOR}\'/" \
|
||||||
${PV_FILE}
|
${PV_FILE}
|
||||||
cp version.txt bindings/python-cffi
|
|
||||||
|
|
||||||
# We invoke make recursively only to force ordering of our phony
|
# We invoke make recursively only to force ordering of our phony
|
||||||
# targets in the case of parallel invocation of make (-j).
|
# targets in the case of parallel invocation of make (-j).
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import cffi
|
import cffi
|
||||||
|
from _notmuch_config import *
|
||||||
|
|
||||||
ffibuilder = cffi.FFI()
|
ffibuilder = cffi.FFI()
|
||||||
ffibuilder.set_source(
|
ffibuilder.set_source(
|
||||||
|
@ -16,8 +16,8 @@ ffibuilder.set_source(
|
||||||
#ERROR libnotmuch version < 5.1 not supported
|
#ERROR libnotmuch version < 5.1 not supported
|
||||||
#endif
|
#endif
|
||||||
""",
|
""",
|
||||||
include_dirs=['../../lib'],
|
include_dirs=[NOTMUCH_INCLUDE_DIR],
|
||||||
library_dirs=['../../lib'],
|
library_dirs=[NOTMUCH_LIB_DIR],
|
||||||
libraries=['notmuch'],
|
libraries=['notmuch'],
|
||||||
)
|
)
|
||||||
ffibuilder.cdef(
|
ffibuilder.cdef(
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import setuptools
|
import setuptools
|
||||||
|
from _notmuch_config import *
|
||||||
|
|
||||||
with open('version.txt') as fp:
|
with open(NOTMUCH_VERSION_FILE) as fp:
|
||||||
VERSION = fp.read().strip()
|
VERSION = fp.read().strip()
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
0.34.1
|
|
8
configure
vendored
8
configure
vendored
|
@ -1579,6 +1579,14 @@ EOF
|
||||||
printf "rsti_dir = '%s'\n" "$(cd emacs && pwd -P)"
|
printf "rsti_dir = '%s'\n" "$(cd emacs && pwd -P)"
|
||||||
} > sphinx.config
|
} > sphinx.config
|
||||||
|
|
||||||
|
cat > bindings/python-cffi/_notmuch_config.py <<EOF
|
||||||
|
# _notmuch_config.py was automatically generated by the configure
|
||||||
|
# script in the root of the notmuch source tree.
|
||||||
|
NOTMUCH_VERSION_FILE='${NOTMUCH_SRCDIR}/version.txt'
|
||||||
|
NOTMUCH_INCLUDE_DIR='${NOTMUCH_SRCDIR}/lib'
|
||||||
|
NOTMUCH_LIB_DIR='${NOTMUCH_SRCDIR}/lib'
|
||||||
|
EOF
|
||||||
|
|
||||||
# Finally, after everything configured, inform the user how to continue.
|
# Finally, after everything configured, inform the user how to continue.
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue