From: David Bremner Date: Sat, 7 Mar 2015 07:31:14 +0000 (+0100) Subject: [PATCH] python: replace hardcoding of SONAME version X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=6570674f7dcb3dbdf6cdecf6e903f2c51712d5d3;p=notmuch-archives.git [PATCH] python: replace hardcoding of SONAME version --- diff --git a/d5/1453bc46db484da7780ceb5385085ccd480947 b/d5/1453bc46db484da7780ceb5385085ccd480947 new file mode 100644 index 000000000..fb237f5d5 --- /dev/null +++ b/d5/1453bc46db484da7780ceb5385085ccd480947 @@ -0,0 +1,109 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 8AFB9431FBD + for ; Fri, 6 Mar 2015 23:32:23 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.438 +X-Spam-Level: ** +X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 + tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id WiFyjKaRInQ3 for ; + Fri, 6 Mar 2015 23:32:20 -0800 (PST) +Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net + [87.98.215.224]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 44117431FAE + for ; Fri, 6 Mar 2015 23:32:20 -0800 (PST) +Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim + 4.80) (envelope-from ) + id 1YU9Cu-00025h-Gw; Sat, 07 Mar 2015 07:31:32 +0000 +Received: (nullmailer pid 8455 invoked by uid 1000); Sat, 07 Mar 2015 + 07:31:19 -0000 +From: David Bremner +To: notmuch@notmuchmail.org +Subject: [PATCH] python: replace hardcoding of SONAME version +Date: Sat, 7 Mar 2015 08:31:14 +0100 +Message-Id: <1425713474-8344-1-git-send-email-david@tethera.net> +X-Mailer: git-send-email 2.1.4 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 07 Mar 2015 07:32:23 -0000 + +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 | 4 +++- + bindings/python/notmuch/globals.py | 5 +++-- + bindings/python/notmuch/version.py | 1 + + 3 files changed, 7 insertions(+), 3 deletions(-) + +After hitting the mismatch again while working on the count API, I +decided to try to fix it. + +diff --git a/Makefile.local b/Makefile.local +index 81ee347..6d54742 100644 +--- a/Makefile.local ++++ b/Makefile.local +@@ -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). +diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py +index 24b25d3..4c49d51 100644 +--- a/bindings/python/notmuch/globals.py ++++ b/bindings/python/notmuch/globals.py +@@ -18,15 +18,16 @@ Copyright 2010 Sebastian Spaeth + """ + + 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.") + +diff --git a/bindings/python/notmuch/version.py b/bindings/python/notmuch/version.py +index f719fdf..35744d3 100644 +--- a/bindings/python/notmuch/version.py ++++ b/bindings/python/notmuch/version.py +@@ -1,2 +1,3 @@ + # this file should be kept in sync with ../../../version + __VERSION__ = '0.19' ++SOVERSION = '4' +-- +2.1.4 +