sed -i -e "s/^__VERSION__[[:blank:]]*=.*$$/__VERSION__ = \'${VERSION}\'/" \
-e "s/^SOVERSION[[:blank:]]*=.*$$/SOVERSION = \'${LIBNOTMUCH_VERSION_MAJOR}\'/" \
${PV_FILE}
- cp version.txt bindings/python-cffi
# We invoke make recursively only to force ordering of our phony
# targets in the case of parallel invocation of make (-j).
import cffi
-
+from _notmuch_config import *
ffibuilder = cffi.FFI()
ffibuilder.set_source(
#ERROR libnotmuch version < 5.1 not supported
#endif
""",
- include_dirs=['../../lib'],
- library_dirs=['../../lib'],
+ include_dirs=[NOTMUCH_INCLUDE_DIR],
+ library_dirs=[NOTMUCH_LIB_DIR],
libraries=['notmuch'],
)
ffibuilder.cdef(
import setuptools
+from _notmuch_config import *
-with open('version.txt') as fp:
+with open(NOTMUCH_VERSION_FILE) as fp:
VERSION = fp.read().strip()
setuptools.setup(
printf "rsti_dir = '%s'\n" "$(cd emacs && pwd -P)"
} > 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.
cat <<EOF