2019-01-11 09:45:23 +00:00
|
|
|
{ stdenv, lib, buildPythonPackage, fetchPypi, fetchpatch, isPyPy, libgit2_0_27, six, cffi }:
|
2017-11-02 08:35:40 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygit2";
|
2018-10-30 22:28:07 +00:00
|
|
|
version = "0.27.2";
|
2017-11-02 08:35:40 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-10-30 22:28:07 +00:00
|
|
|
sha256 = "0d9bgxd6ch5jxz0j5cmx7c4kw933g8pgm2zxf3id1a6w9g2r7hpw";
|
2017-11-02 08:35:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = lib.optionalString stdenv.isDarwin ''
|
2019-01-11 09:45:23 +00:00
|
|
|
export DYLD_LIBRARY_PATH="${libgit2_0_27}/lib"
|
2017-11-02 08:35:40 +00:00
|
|
|
'';
|
|
|
|
|
2018-10-30 22:28:07 +00:00
|
|
|
patches = [ (fetchpatch {
|
|
|
|
name = "dont-require-old-pycparser"; # https://github.com/libgit2/pygit2/issues/819
|
|
|
|
url = https://github.com/libgit2/pygit2/commit/1eaba181577de206d3d43ec7886d0353fc0c9f2a.patch;
|
|
|
|
sha256 = "18x1fpmywhjjr4lvakwmy34zpxfqi8pqqj48g1wcib39lh3s7l4f";
|
|
|
|
}) ];
|
|
|
|
|
2019-01-11 09:45:23 +00:00
|
|
|
propagatedBuildInputs = [ libgit2_0_27 six ] ++ lib.optional (!isPyPy) cffi;
|
2017-11-02 08:35:40 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# disable tests that require networking
|
|
|
|
rm test/test_repository.py
|
|
|
|
rm test/test_credentials.py
|
|
|
|
rm test/test_submodule.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A set of Python bindings to the libgit2 shared library";
|
|
|
|
homepage = https://pypi.python.org/pypi/pygit2;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
};
|
|
|
|
}
|