nixpkgs/pkgs/development/libraries/libgit2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.6 KiB
Nix
Raw Normal View History

{ 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
# for passthru.tests
, libgit2-glib
, python3Packages
, gitstatus
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-08-25 19:41:21 +00:00
version = "1.7.1";
# also check the following packages for updates: python3Packages.pygit2 and libgit2-glib
2013-05-10 20:12:37 +00:00
src = fetchFromGitHub {
owner = "libgit2";
repo = "libgit2";
rev = "v${version}";
2023-08-25 19:41:21 +00:00
hash = "sha256-3W0/i6Pu7I7D1zMQhmEqJVsa7PZpKOqU1+udNENSBvM=";
2013-05-10 20:12:37 +00:00
};
cmakeFlags = [
"-DUSE_HTTP_PARSER=system"
"-DUSE_SSH=ON"
2022-07-16 18:14:19 +00:00
"-DBUILD_SHARED_LIBS=${if staticBuild then "OFF" else "ON"}"
2023-11-22 22:54:51 +00:00
] ++ lib.optionals stdenv.hostPlatform.isWindows [
"-DDLLTOOL=${stdenv.cc.bintools.targetPrefix}dlltool"
# For ws2_32, refered to by a `*.pc` file
"-DCMAKE_LIBRARY_PATH=${stdenv.cc.libc}/lib"
];
2014-01-09 13:18:58 +00:00
2020-11-30 23:54:49 +00:00
nativeBuildInputs = [ cmake python3 pkg-config ];
buildInputs = [ zlib libssh2 openssl pcre http-parser ]
++ lib.optional stdenv.isDarwin Security;
2017-11-09 19:12:54 +00:00
propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
2013-05-10 20:12:37 +00:00
doCheck = false; # hangs. or very expensive?
passthru.tests = {
inherit libgit2-glib;
inherit (python3Packages) pygit2;
inherit gitstatus;
};
meta = with lib; {
description = "Linkable library implementation of Git that you can use in your application";
homepage = "https://libgit2.org/";
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
}