18 buildPythonPackage rec {
23 disabled = pythonOlder "3.9";
26 inherit pname version;
27 hash = "sha256-eymmeWuqFfyJ1EOsjVF3VBHZseWwbcQNRYxWyFdrSKI=";
33 url = "https://github.com/libgit2/pygit2/commit/eba710e45bb40e18641c6531394bb46631e7f295.patch";
34 hash = "sha256-GFFzGVd/9+AcwicwOtBghhonijMp08svXTUZ/4/LmtI=";
36 # temp fix for Python 3.13 until next release after 1.16.0
38 url = "https://github.com/libgit2/pygit2/commit/7f143e1c5beec01ec3429aa4db12435ac02977d3.patch";
39 hash = "sha256-2SiFFPWVVo9urKRu64AejjTZMoXo2r+v1OwEIF+AzNo=";
43 preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
44 export DYLD_LIBRARY_PATH="${libgit2}/lib"
47 nativeBuildInputs = [ setuptools ];
49 buildInputs = [ libgit2 ];
51 propagatedBuildInputs = [
54 ] ++ lib.optionals (!isPyPy) [ cffi ];
56 propagatedNativeBuildInputs = lib.optionals (!isPyPy) [ cffi ];
58 nativeCheckInputs = [ pytestCheckHook ];
61 # Disable tests that require networking
62 "test/test_repository.py"
63 "test/test_credentials.py"
64 "test/test_submodule.py"
67 # Tests require certificates
68 # https://github.com/NixOS/nixpkgs/pull/72544#issuecomment-582674047
69 SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
71 pythonImportsCheck = [ "pygit2" ];
74 description = "Set of Python bindings to the libgit2 shared library";
75 homepage = "https://github.com/libgit2/pygit2";
76 changelog = "https://github.com/libgit2/pygit2/blob/v${version}/CHANGELOG.md";
77 license = licenses.gpl2Only;