1{ stdenv, lib, buildPythonPackage, fetchPypi, isPyPy, libgit2, six, cffi }:
2
3buildPythonPackage rec {
4 pname = "pygit2";
5 version = "0.26.4";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "a8a0ecce4aadac2675afa5bcda0f698bfe39ec61ac1e15b9264704d1b41bb390";
10 };
11
12 preConfigure = lib.optionalString stdenv.isDarwin ''
13 export DYLD_LIBRARY_PATH="${libgit2}/lib"
14 '';
15
16 propagatedBuildInputs = [ libgit2 six ] ++ lib.optional (!isPyPy) cffi;
17
18 preCheck = ''
19 # disable tests that require networking
20 rm test/test_repository.py
21 rm test/test_credentials.py
22 rm test/test_submodule.py
23 '';
24
25 meta = with lib; {
26 description = "A set of Python bindings to the libgit2 shared library";
27 homepage = https://pypi.python.org/pypi/pygit2;
28 license = licenses.gpl2;
29 };
30}