diff --git a/pkgs/development/python-modules/pygit2/default.nix b/pkgs/development/python-modules/pygit2/default.nix new file mode 100644 index 000000000000..90bfe9783918 --- /dev/null +++ b/pkgs/development/python-modules/pygit2/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, buildPythonPackage, fetchPypi, isPyPy, libgit2, six, cffi }: + +buildPythonPackage rec { + name = "${pname}-${version}"; + pname = "pygit2"; + version = "0.26.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "1cbc488ra3kg7r3qky17ms0szi3cda2d96qfkv1l9djsy9hnvw57"; + }; + + preConfigure = lib.optionalString stdenv.isDarwin '' + export DYLD_LIBRARY_PATH="${libgit2}/lib" + ''; + + propagatedBuildInputs = [ libgit2 six ] ++ lib.optional (!isPyPy) cffi; + + 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; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e4600cf162a5..98470de6b52e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15674,45 +15674,7 @@ in { }; }; - pygit2 = buildPythonPackage rec { - name = "pygit2-0.25.1"; - - src = pkgs.fetchurl { - url = "mirror://pypi/p/pygit2/${name}.tar.gz"; - sha256 = "0sja3g9mqwp5bnhdc313b2gc4z3p70nn6zzf2h8j581g0lrn0sg8"; - }; - - # Fixes a bug which can cause test failed when cffi==1.10 - prePatch = let - cffiVersionPatch = pkgs.fetchurl { - url = "https://github.com/libgit2/pygit2/commit/b88dc868423af2f760f649960112efd0e37e5335.patch"; - sha256 = "14cfrz56y2dnwlxrrss9pjhxfnyyg5856gbabzjzyx674k0qcid4"; - }; - in '' - # we need to delete part of the patch because the missing .travis.yml causes problem - sed -e '1,36d' ${cffiVersionPatch} | patch -p1 - ''; - - preConfigure = ( if stdenv.isDarwin then '' - export DYLD_LIBRARY_PATH="${pkgs.libgit2}/lib" - '' else "" ); - - propagatedBuildInputs = with self; [ pkgs.libgit2 six ] ++ optionals (!isPyPy) [ cffi ]; - - preCheck = '' - # disable tests that require networking - rm test/test_repository.py - rm test/test_credentials.py - rm test/test_submodule.py - ''; - - meta = { - homepage = https://pypi.python.org/pypi/pygit2; - description = "A set of Python bindings to the libgit2 shared library"; - license = licenses.gpl2; - platforms = platforms.all; - }; - }; + pygit2 = callPackage ../development/python-modules/pygit2 { }; Babel = buildPythonPackage (rec { name = "Babel-2.3.4";