From 0acb7df5647231e2be5a07a8e9117d4395dee59c Mon Sep 17 00:00:00 2001 From: "W. Trevor King" <wking@tremily.us> Date: Thu, 13 Dec 2012 08:18:36 -0500 Subject: [PATCH] setup.py: Add LIBGIT2_LIB to override the library search path I build libgit2 in a `build/` subdirectory of a Git checkout, and never bother installing it. I'd like to link pygit2 against it there, but LIBGIT2 assumes libgit2.so will be in the default library search path or $LIBGIT/lib. This patch adds LIBGIT2_LIB, a new environment variable for overriding the additional library search paths. An alternative to this patch is to set LDFLAGS="-L..." explicitly before building pygit2. I've avoided that approach here minimize the difference between configuring this library path explicitly, and configuring implicitly via LIBGIT2. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 59f5bc3..9f2d518 100644 --- a/setup.py +++ b/setup.py @@ -56,7 +56,7 @@ if libgit2_path is None: libgit2_bin = os.path.join(libgit2_path, 'bin') libgit2_include = os.path.join(libgit2_path, 'include') -libgit2_lib = os.path.join(libgit2_path, 'lib') +libgit2_lib = os.getenv('LIBGIT2_LIB', os.path.join(libgit2_path, 'lib')) pygit2_exts = [os.path.join('src', 'pygit2.c')] + [ os.path.join('src', 'pygit2', entry) for entry in os.listdir('src/pygit2')