summary refs log tree commit diff
path: root/pkgs/development/libraries/git2/default.nix
blob: c0659a79fd34364b4f0e0bdfd2a13427d3610c2d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ stdenv, fetchFromGitHub, pkgconfig, cmake
, zlib, python, libssh2, openssl, curl, http-parser
, libiconv, Security
}:

stdenv.mkDerivation (rec {
  name = "libgit2-${version}";
  version = "0.26.0";
  # keep the version in sync with pythonPackages.pygit2 and gnome3.libgit2-glib

  src = fetchFromGitHub {
    owner = "libgit2";
    repo = "libgit2";
    rev = "v${version}";
    sha256 = "0zrrmfkfhd2xb4879z5khjb6xsdklrm01f1lscrs2ks68v25fk78";
  };

  cmakeFlags = [ "-DTHREADSAFE=ON" ];

  nativeBuildInputs = [ cmake python pkgconfig ];

  buildInputs = [ zlib libssh2 openssl http-parser curl ]
    ++ stdenv.lib.optional stdenv.isDarwin Security;

  propagatedBuildInputs = stdenv.lib.optional (!stdenv.isLinux) [ libiconv ];

  enableParallelBuilding = true;

  meta = with stdenv.lib; {
    description = "The Git linkable library";
    homepage = https://libgit2.github.com/;
    license = licenses.gpl2;
    platforms = with platforms; all;
  };
} // stdenv.lib.optionalAttrs (!stdenv.isLinux) {
})