2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, zlib, libssh2, openssl, pcre, http-parser
|
|
|
|
, libiconv, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "libgit2";
|
2021-08-05 21:33:18 +00:00
|
|
|
version = "1.1.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
# keep the version in sync with python3.pkgs.pygit2 and libgit2-glib
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "libgit2";
|
|
|
|
repo = "libgit2";
|
|
|
|
rev = "v${version}";
|
2021-08-05 21:33:18 +00:00
|
|
|
sha256 = "sha256-SxceIxT0aeiiiZCeSIe6EOa+MyVpQVaiv/ZZn6fkwIc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DTHREADSAFE=ON"
|
|
|
|
"-DUSE_HTTP_PARSER=system"
|
|
|
|
];
|
|
|
|
|
2020-12-07 07:45:13 +00:00
|
|
|
nativeBuildInputs = [ cmake python3 pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [ zlib libssh2 openssl pcre http-parser ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin Security;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = false; # hangs. or very expensive?
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "The Git linkable library";
|
|
|
|
homepage = "https://libgit2.github.com/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
platforms = with lib.platforms; all;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|