--- /dev/null
+Return-Path: <jlmuir@imca.aps.anl.gov>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id A1087431FD2\r
+ for <notmuch@notmuchmail.org>; Thu, 26 Feb 2015 10:20:18 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 2.438\r
+X-Spam-Level: **\r
+X-Spam-Status: No, score=2.438 tagged_above=-999 required=5\r
+ tests=[DNS_FROM_AHBL_RHSBL=2.438] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id Sl91gRz7xQdG for <notmuch@notmuchmail.org>;\r
+ Thu, 26 Feb 2015 10:20:15 -0800 (PST)\r
+Received: from tuna.imca.aps.anl.gov (tuna.imca.aps.anl.gov [164.54.200.33])\r
+ by olra.theworths.org (Postfix) with ESMTP id 768DC431FBF\r
+ for <notmuch@notmuchmail.org>; Thu, 26 Feb 2015 10:20:15 -0800 (PST)\r
+Received: from bass.imca.aps.anl.gov (bass.imca.aps.anl.gov [164.54.200.38])\r
+ by tuna.imca.aps.anl.gov (Postfix) with SMTP id 26A8920063\r
+ for <notmuch@notmuchmail.org>; Thu, 26 Feb 2015 12:14:23 -0600 (CST)\r
+Received: (qmail 2849 invoked by uid 502); 26 Feb 2015 18:14:23 -0000\r
+Date: Thu, 26 Feb 2015 12:14:23 -0600\r
+From: "J. Lewis Muir" <jlmuir@imca-cat.org>\r
+To: David Bremner <david@tethera.net>\r
+Subject: Re: [PATCH] lib: make notmuch shared library install_name be full\r
+ path on Mac OS X\r
+Message-ID: <20150226181423.GA2822@bass.imca.aps.anl.gov>\r
+References: <1409541227-38895-1-git-send-email-jlmuir@imca-cat.org>\r
+ <87twyao35q.fsf@maritornes.cs.unb.ca>\r
+Mime-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+In-Reply-To: <87twyao35q.fsf@maritornes.cs.unb.ca>\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 26 Feb 2015 18:20:18 -0000\r
+\r
+On 2/25/15 1:34 AM, David Bremner wrote:\r
+> Unfortunately we did not receive any feedback from Mac users in the\r
+> meantime. It would be nice to know that your patch won't break the\r
+> existing macports and brew packages. I suppose that those work\r
+> because they install the libraries into a well known location.\r
+\r
+Hi, David.\r
+\r
+I just tried installing to /usr/local (now on OS X Yosemite 10.10.2),\r
+and you're right about that; it appears that because it's a standard\r
+location, it works without my patch. Looking at the dyld(1) man page,\r
+it says the following for the DYLD_FALLBACK_LIBRARY_PATH environment\r
+variable (and I think the fact that /usr/local/lib is in the default\r
+list is the reason why it works without the patch):\r
+\r
+ This is a colon separated list of directories that contain\r
+ libraries. It is used as the default location for libraries\r
+ not found in their install path. By default, it is set to\r
+ $(HOME)/lib:/usr/local/lib:/lib:/usr/lib.\r
+\r
+However, if I install to /opt, it does *not* work without my patch. So,\r
+I'm still confident that the patch is correct and needed.\r
+\r
+The reason it works in Homebrew is twofold. One, assuming Homebrew\r
+installs packages to /usr/local, the dynamic linker finds the notmuch\r
+library in /usr/local/lib because it's in the default list of locations\r
+that the dynamic linker looks for libraries. Two, Homebrew globally\r
+corrects all install names in dynamically shared libraries and binaries\r
+for all packages. So, even if the package is broken, Homebrew corrects\r
+it automatically, and no one ever knows.\r
+\r
+The reason it works in MacPorts is because they apply a patch that's the\r
+same as what I submitted! See:\r
+\r
+ https://trac.macports.org/browser/trunk/dports/mail/notmuch/files/patch-lib-Makefile.local.diff\r
+\r
+For any OS X notmuch developer willing to test this, here are\r
+the five commands to run to reproduce the problem (note: another\r
+libnotmuch*.dylib must *not* be in /usr/local/lib where it would\r
+be found automatically by the dynamic linker; similarly, no DYLD_*\r
+environment variables should be set for this test; obviously, change the\r
+CFLAGS and LDFLAGS environment variables in the ./configure command to\r
+point to where the libraries are that notmuch needs):\r
+\r
+===\r
+$ git clone git://notmuchmail.org/git/notmuch\r
+$ CFLAGS='-I/pkg/include' LDFLAGS='-L/pkg/lib' ./configure --prefix=/opt --without-emacs\r
+$ make\r
+$ make install\r
+$ /opt/bin/notmuch --version\r
+===\r
+\r
+When I run the just-installed notmuch in that last command, it produces\r
+the following output:\r
+\r
+===\r
+dyld: Library not loaded: libnotmuch.4.dylib\r
+ Referenced from: /opt/bin/notmuch\r
+ Reason: image not found\r
+Trace/BPT trap: 5 (core dumped)\r
+===\r
+\r
+Regards,\r
+\r
+Lewis\r