Merge pull request #160149 from SuperSandro2000/libgit2

This commit is contained in:
Sandro 2022-02-17 02:37:43 +01:00 committed by GitHub
commit 18d06230ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 97 additions and 69 deletions

View file

@ -1,4 +1,4 @@
{ fetchFromGitHub, libgit2, ...}: { fetchFromGitHub, libgit2, ... }:
libgit2.overrideAttrs (oldAttrs: { libgit2.overrideAttrs (oldAttrs: {
cmakeFlags = oldAttrs.cmakeFlags ++ [ cmakeFlags = oldAttrs.cmakeFlags ++ [
@ -8,15 +8,18 @@ libgit2.overrideAttrs (oldAttrs: {
"-DUSE_BUNDLED_ZLIB=ON" "-DUSE_BUNDLED_ZLIB=ON"
"-DUSE_GSSAPI=OFF" "-DUSE_GSSAPI=OFF"
"-DUSE_HTTPS=OFF" "-DUSE_HTTPS=OFF"
"-DUSE_HTTP_PARSER=builtin" # overwritten from libgit2 "-DUSE_HTTP_PARSER=builtin" # overwritten from libgit2
"-DUSE_NTLMCLIENT=OFF" "-DUSE_NTLMCLIENT=OFF"
"-DUSE_SSH=OFF" "-DUSE_SSH=OFF"
"-DZERO_NSEC=ON" "-DZERO_NSEC=ON"
]; ];
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "romkatv"; owner = "romkatv";
repo = "libgit2"; repo = "libgit2";
rev = "tag-0ad3d776aa86dd607dc86dcd7f77ad3ed7ebec61"; rev = "tag-0ad3d776aa86dd607dc86dcd7f77ad3ed7ebec61";
sha256 = "sha256-mXCmspM3fqI14DF9sAIMH5vGdMMjWkdDjdME4EiQuqY="; sha256 = "sha256-mXCmspM3fqI14DF9sAIMH5vGdMMjWkdDjdME4EiQuqY=";
}; };
patches = [ ];
}) })

View file

@ -14,6 +14,8 @@ let
rev = "109b4c887ffb63962c7017a66fc4a1f48becb48e"; rev = "109b4c887ffb63962c7017a66fc4a1f48becb48e";
sha256 = "sha256-w029FHpOv5K49wE1OJMOlkTe+2cv+ORYqEHxs59GDBI="; sha256 = "sha256-w029FHpOv5K49wE1OJMOlkTe+2cv+ORYqEHxs59GDBI=";
}; };
patches = [];
}); });
rubyEnv = bundlerEnv rec { rubyEnv = bundlerEnv rec {

View file

@ -1,38 +0,0 @@
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, python3
, zlib, libssh2, openssl, pcre, http-parser
, libiconv, Security
}:
stdenv.mkDerivation rec {
pname = "libgit2";
version = "1.3.0";
# keep the version in sync with python3.pkgs.pygit2 and libgit2-glib
src = fetchFromGitHub {
owner = "libgit2";
repo = "libgit2";
rev = "v${version}";
sha256 = "sha256-7atNkOBzX+nU1gtFQEaE+EF1L+eex+Ajhq2ocoJY920=";
};
cmakeFlags = [
"-DTHREADSAFE=ON"
"-DUSE_HTTP_PARSER=system"
];
nativeBuildInputs = [ cmake python3 pkg-config ];
buildInputs = [ zlib libssh2 openssl pcre http-parser ]
++ lib.optional stdenv.isDarwin Security;
propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
doCheck = false; # hangs. or very expensive?
meta = {
description = "The Git linkable library";
homepage = "https://libgit2.github.com/";
license = lib.licenses.gpl2;
platforms = with lib.platforms; all;
};
}

View file

@ -0,0 +1,58 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, pkg-config
, python3
, zlib
, libssh2
, openssl
, pcre
, http-parser
, libiconv
, Security
}:
stdenv.mkDerivation rec {
pname = "libgit2";
version = "1.4.0";
# also check the following packages for updates: python3.pkgs.pygit2 and libgit2-glib
src = fetchFromGitHub {
owner = "libgit2";
repo = "libgit2";
rev = "v${version}";
sha256 = "sha256-21t7fD/5O+HIHUDEv8MqloDmAIm9sSpJYqreCD3Co2k=";
};
patches = [
(fetchpatch {
url = "https://github.com/libgit2/libgit2/commit/8bc9eda779b2e2602fc74944aba5d39198e0642f.patch";
sha256 = "sha256-r2i4+WsrxIpSwH0g/AikBdAajBncXb1zz0uOQB0h1Jk=";
})
];
cmakeFlags = [
"-DTHREADSAFE=ON"
"-DUSE_HTTP_PARSER=system"
"-DUSE_SSH=ON"
];
nativeBuildInputs = [ cmake python3 pkg-config ];
buildInputs = [ zlib libssh2 openssl pcre http-parser ]
++ lib.optional stdenv.isDarwin Security;
propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
doCheck = false; # hangs. or very expensive?
meta = {
description = "Linkable library implementation of Git that you can use in your application";
homepage = "https://libgit2.org/";
license = lib.licenses.gpl2Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ ];
};
}

View file

@ -25,12 +25,12 @@ buildPythonPackage rec {
checkInputs = [ pytestCheckHook ]; checkInputs = [ pytestCheckHook ];
preCheck = '' disabledTestPaths = [
# disable tests that require networking # disable tests that require networking
rm test/test_repository.py "test/test_repository.py"
rm test/test_credentials.py "test/test_credentials.py"
rm test/test_submodule.py "test/test_submodule.py"
''; ];
# Tests require certificates # Tests require certificates
# https://github.com/NixOS/nixpkgs/pull/72544#issuecomment-582674047 # https://github.com/NixOS/nixpkgs/pull/72544#issuecomment-582674047
@ -44,11 +44,10 @@ buildPythonPackage rec {
# https://github.com/NixOS/nixpkgs/pull/72544#issuecomment-582681068 # https://github.com/NixOS/nixpkgs/pull/72544#issuecomment-582681068
doCheck = false; doCheck = false;
disabled = !isPy3k;
meta = with lib; { meta = with lib; {
description = "A set of Python bindings to the libgit2 shared library"; description = "A set of Python bindings to the libgit2 shared library";
homepage = "https://pypi.python.org/pypi/pygit2"; homepage = "https://pypi.python.org/pypi/pygit2";
license = licenses.gpl2; license = licenses.gpl2;
maintainers = with maintainers; [ ];
}; };
} }

View file

@ -12635,7 +12635,20 @@ with pkgs;
julia_10 = callPackage ../development/compilers/julia/1.0.nix { julia_10 = callPackage ../development/compilers/julia/1.0.nix {
gmp = gmp6; gmp = gmp6;
inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreServices; inherit (darwin.apple_sdk.frameworks) ApplicationServices CoreServices;
libgit2 = libgit2_0_27; libgit2 = libgit2.overrideAttrs (_: rec {
version = "0.27.10";
src = fetchFromGitHub {
owner = "libgit2";
repo = "libgit2";
rev = "v${version}";
sha256 = "09jz2fzv0zl5058s0g1cpnw87a2rgg8wnjwlygi18i2n9nn6m0ad";
};
patches = [];
meta.knownVulnerabilities = [
"CVE-2020-12278"
"CVE-2020-12279"
];
});
}; };
julia_15 = callPackage ../development/compilers/julia/1.5.nix { julia_15 = callPackage ../development/compilers/julia/1.5.nix {
@ -15703,7 +15716,9 @@ with pkgs;
ttyd = callPackage ../servers/ttyd { }; ttyd = callPackage ../servers/ttyd { };
turbogit = callPackage ../development/tools/turbogit { }; turbogit = callPackage ../development/tools/turbogit {
libgit2 = libgit2_1_3_0;
};
tweak = callPackage ../applications/editors/tweak { }; tweak = callPackage ../applications/editors/tweak { };
@ -16714,32 +16729,19 @@ with pkgs;
icon-lang = callPackage ../development/interpreters/icon-lang { }; icon-lang = callPackage ../development/interpreters/icon-lang { };
libgit2 = callPackage ../development/libraries/git2 { libgit2 = callPackage ../development/libraries/libgit2 {
inherit (darwin.apple_sdk.frameworks) Security; inherit (darwin.apple_sdk.frameworks) Security;
}; };
libgit2_0_27 = libgit2.overrideAttrs (_: rec { libgit2_1_3_0 = libgit2.overrideAttrs (_: rec {
version = "0.27.10"; version = "1.3.0";
src = fetchFromGitHub { src = pkgs.fetchFromGitHub {
owner = "libgit2"; owner = "libgit2";
repo = "libgit2"; repo = "libgit2";
rev = "v${version}"; rev = "v${version}";
sha256 = "09jz2fzv0zl5058s0g1cpnw87a2rgg8wnjwlygi18i2n9nn6m0ad"; sha256 = "sha256-7atNkOBzX+nU1gtFQEaE+EF1L+eex+Ajhq2ocoJY920=";
};
meta.knownVulnerabilities = [
"CVE-2020-12278"
"CVE-2020-12279"
];
});
libgit2_1_1 = libgit2.overrideAttrs (_: rec {
version = "1.1.1";
src = fetchFromGitHub {
owner = "libgit2";
repo = "libgit2";
rev = "v${version}";
sha256 = "sha256-SxceIxT0aeiiiZCeSIe6EOa+MyVpQVaiv/ZZn6fkwIc=";
}; };
patches = [];
}); });
libgit2-glib = callPackage ../development/libraries/libgit2-glib { }; libgit2-glib = callPackage ../development/libraries/libgit2-glib { };

View file

@ -6910,7 +6910,9 @@ in {
pygetwindow = callPackage ../development/python-modules/pygetwindow { }; pygetwindow = callPackage ../development/python-modules/pygetwindow { };
pygit2 = callPackage ../development/python-modules/pygit2 { }; pygit2 = callPackage ../development/python-modules/pygit2 {
libgit2 = pkgs.libgit2_1_3_0;
};
PyGithub = callPackage ../development/python-modules/pyGithub { }; PyGithub = callPackage ../development/python-modules/pyGithub { };