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