@@ -0,0 +1,27 @@
1+{ stdenv, fetchurl, pkgconfig, cmake, zlib, python, libssh2, openssl, http-parser, libiconv }:
2+
3+stdenv.mkDerivation (rec {
4+ version = "0.23.2";
5+ name = "libgit2-${version}";
6+
7+ src = fetchurl {
8+ name = "${name}.tar.gz";
9+ url = "https://github.com/libgit2/libgit2/tarball/v${version}";
10+ sha256 = "1d3901bmgvdnmzrx21afi1d0llsqmca3ckj942p0i2wpdpr1kbcp";
11+ };
12+
13+ cmakeFlags = "-DTHREADSAFE=ON";
14+
15+ nativeBuildInputs = [ cmake python pkgconfig ];
16+ buildInputs = [ zlib libssh2 openssl http-parser ];
17+
18+ meta = {
19+ description = "the Git linkable library";
20+ homepage = http://libgit2.github.com/;
21+ license = stdenv.lib.licenses.gpl2;
22+ platforms = with stdenv.lib.platforms; all;
23+ };
24+} // stdenv.lib.optionalAttrs (!stdenv.isLinux) {
25+ NIX_LDFLAGS = "-liconv";
26+ propagatedBuildInputs = [ libiconv ];
27+})