]> git.notmuchmail.org Git - notmuch/commitdiff
python: replace hardcoding of SONAME version
authorDavid Bremner <david@tethera.net>
Sat, 7 Mar 2015 07:31:14 +0000 (08:31 +0100)
committerDavid Bremner <david@tethera.net>
Sun, 8 Mar 2015 07:30:36 +0000 (08:30 +0100)
Failing to update this string in globals.py causes failures when the
SONAME changes.  In order to hopefully reduce the number of such
errors, automate the process of setting the SONAME in the python
bindings.

Makefile.local
bindings/python/notmuch/globals.py
bindings/python/notmuch/version.py

index 81ee34774386dd8e4de2b6b472896056b434ee83..6d54742334a238cb2fb08e65e9ff0ed09416fe13 100644 (file)
@@ -107,7 +107,9 @@ dist: $(TAR_FILE)
 .PHONY: update-versions
 
 update-versions:
-       sed -i "s/^__VERSION__[[:blank:]]*=.*$$/__VERSION__ = \'${VERSION}\'/" $(PV_FILE)
+       sed -i -e "s/^__VERSION__[[:blank:]]*=.*$$/__VERSION__ = \'${VERSION}\'/" \
+           -e "s/^SOVERSION[[:blank:]]*=.*$$/SOVERSION = \'${LIBNOTMUCH_VERSION_MAJOR}\'/" \
+           ${PV_FILE}
 
 # We invoke make recursively only to force ordering of our phony
 # targets in the case of parallel invocation of make (-j).
index 24b25d3641efef72ead08be70245821cdbffa557..4c49d51dd8c06c4c0d89eee6ea0aa1d60230f6e7 100644 (file)
@@ -18,15 +18,16 @@ Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>
 """
 
 from ctypes import CDLL, Structure, POINTER
+from version import SOVERSION
 
 #-----------------------------------------------------------------------------
 #package-global instance of the notmuch library
 try:
     from os import uname
     if uname()[0] == 'Darwin':
-        nmlib = CDLL("libnotmuch.4.dylib")
+        nmlib = CDLL("libnotmuch.{0:s}.dylib".format(SOVERSION))
     else:
-        nmlib = CDLL("libnotmuch.so.4")
+        nmlib = CDLL("libnotmuch.so.{0:s}".format(SOVERSION))
 except:
     raise ImportError("Could not find shared 'notmuch' library.")
 
index f719fdf46d853cdadf1d664220146b33f8520c71..35744d34c36fbaf26b3b6e98a41a24697894e255 100644 (file)
@@ -1,2 +1,3 @@
 # this file should be kept in sync with ../../../version
 __VERSION__ = '0.19'
+SOVERSION = '4'