$OpenBSD: patch-pygit2_ffi_py,v 1.1 2014/07/08 15:34:01 jasper Exp $

From b0bf223276ac3a0a522aca4d1c2e8c08636f9081 Mon Sep 17 00:00:00 2001
From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
Date: Thu, 3 Jul 2014 10:10:38 +0200
Subject: [PATCH] Tweak include/lib dir detection in ffi.py

--- pygit2/ffi.py.orig	Thu Jul  3 10:49:42 2014
+++ pygit2/ffi.py	Thu Jul  3 10:50:49 2014
@@ -112,11 +112,11 @@ with codecs.open(decl_path, 'r', 'utf-8') as header:
 
 # if LIBGIT2 exists, set build and link against that version
 libgit2_path = getenv('LIBGIT2')
-include_dirs = []
-library_dirs = []
-if libgit2_path:
-    include_dirs = [path.join(libgit2_path, 'include')]
-    library_dirs = [path.join(libgit2_path, 'lib')]
+if not libgit2_path:
+    libgit2_path = '${PREFIX}'
+
+include_dirs = [path.join(libgit2_path, 'include')]
+library_dirs = [path.join(libgit2_path, 'lib')]
 
 C = ffi.verify("#include <git2.h>", libraries=["git2"],
                include_dirs=include_dirs, library_dirs=library_dirs)
