sesh: 2.7.0 -> 2.8.0 (#371799)
[NixPkgs.git] / pkgs / development / python-modules / pygit2 / default.nix
blob9f0e68834fc1ddf478d9423536982effc44d2b4e
2   lib,
3   stdenv,
4   buildPythonPackage,
5   cacert,
6   cached-property,
7   cffi,
8   fetchPypi,
9   fetchpatch,
10   isPyPy,
11   libgit2,
12   pycparser,
13   pytestCheckHook,
14   pythonOlder,
15   setuptools,
18 buildPythonPackage rec {
19   pname = "pygit2";
20   version = "1.16.0";
21   pyproject = true;
23   disabled = pythonOlder "3.9";
25   src = fetchPypi {
26     inherit pname version;
27     hash = "sha256-eymmeWuqFfyJ1EOsjVF3VBHZseWwbcQNRYxWyFdrSKI=";
28   };
30   patches = [
31     # fix for GCC 14
32     (fetchpatch {
33       url = "https://github.com/libgit2/pygit2/commit/eba710e45bb40e18641c6531394bb46631e7f295.patch";
34       hash = "sha256-GFFzGVd/9+AcwicwOtBghhonijMp08svXTUZ/4/LmtI=";
35     })
36     # temp fix for Python 3.13 until next release after 1.16.0
37     (fetchpatch {
38       url = "https://github.com/libgit2/pygit2/commit/7f143e1c5beec01ec3429aa4db12435ac02977d3.patch";
39       hash = "sha256-2SiFFPWVVo9urKRu64AejjTZMoXo2r+v1OwEIF+AzNo=";
40     })
41   ];
43   preConfigure = lib.optionalString stdenv.hostPlatform.isDarwin ''
44     export DYLD_LIBRARY_PATH="${libgit2}/lib"
45   '';
47   nativeBuildInputs = [ setuptools ];
49   buildInputs = [ libgit2 ];
51   propagatedBuildInputs = [
52     cached-property
53     pycparser
54   ] ++ lib.optionals (!isPyPy) [ cffi ];
56   propagatedNativeBuildInputs = lib.optionals (!isPyPy) [ cffi ];
58   nativeCheckInputs = [ pytestCheckHook ];
60   disabledTestPaths = [
61     # Disable tests that require networking
62     "test/test_repository.py"
63     "test/test_credentials.py"
64     "test/test_submodule.py"
65   ];
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" ];
73   meta = with lib; {
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;
78     maintainers = [ ];
79   };