2022-02-15 11:31:31 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, zlib
|
|
|
|
, libssh2
|
|
|
|
, openssl
|
|
|
|
, pcre
|
|
|
|
, http-parser
|
|
|
|
, libiconv
|
|
|
|
, Security
|
2022-07-16 18:14:19 +00:00
|
|
|
, staticBuild ? stdenv.hostPlatform.isStatic
|
2023-03-08 01:49:20 +00:00
|
|
|
# for passthru.tests
|
|
|
|
, libgit2-glib
|
|
|
|
, python3Packages
|
2017-11-09 19:12:54 +00:00
|
|
|
}:
|
2013-05-10 20:12:37 +00:00
|
|
|
|
2019-06-17 07:47:10 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libgit2";
|
2023-04-20 09:24:14 +00:00
|
|
|
version = "1.6.4";
|
2023-03-08 01:49:20 +00:00
|
|
|
# also check the following packages for updates: python3Packages.pygit2 and libgit2-glib
|
2013-05-10 20:12:37 +00:00
|
|
|
|
2017-09-14 12:58:37 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libgit2";
|
|
|
|
repo = "libgit2";
|
|
|
|
rev = "v${version}";
|
2023-04-20 09:24:14 +00:00
|
|
|
hash = "sha256-lW3mokVKsbknVj2xsxEbeZH4IdKZ0aIgGutzenS0Eh0=";
|
2013-05-10 20:12:37 +00:00
|
|
|
};
|
|
|
|
|
2020-03-09 22:01:23 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_HTTP_PARSER=system"
|
2022-02-15 11:31:31 +00:00
|
|
|
"-DUSE_SSH=ON"
|
2022-07-16 18:14:19 +00:00
|
|
|
"-DBUILD_SHARED_LIBS=${if staticBuild then "OFF" else "ON"}"
|
2020-03-09 22:01:23 +00:00
|
|
|
];
|
2014-01-09 13:18:58 +00:00
|
|
|
|
2020-11-30 23:54:49 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 pkg-config ];
|
2017-09-14 12:58:37 +00:00
|
|
|
|
2020-04-12 19:59:55 +00:00
|
|
|
buildInputs = [ zlib libssh2 openssl pcre http-parser ]
|
2021-01-21 17:00:13 +00:00
|
|
|
++ lib.optional stdenv.isDarwin Security;
|
2017-11-09 19:12:54 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
|
2013-05-10 20:12:37 +00:00
|
|
|
|
2018-04-25 03:20:18 +00:00
|
|
|
doCheck = false; # hangs. or very expensive?
|
|
|
|
|
2023-03-08 01:49:20 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit libgit2-glib;
|
|
|
|
inherit (python3Packages) pygit2;
|
|
|
|
};
|
|
|
|
|
2022-05-04 22:50:04 +00:00
|
|
|
meta = with lib; {
|
2022-02-15 11:31:31 +00:00
|
|
|
description = "Linkable library implementation of Git that you can use in your application";
|
|
|
|
homepage = "https://libgit2.org/";
|
2022-05-04 22:50:04 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2013-05-10 20:12:37 +00:00
|
|
|
};
|
2019-06-17 07:47:10 +00:00
|
|
|
}
|