]> git.immae.eu Git - github/fretlink/clever-tools-nix.git/blob - nodegit.nix
Update README for good measure
[github/fretlink/clever-tools-nix.git] / nodegit.nix
1 { pkgs }:
2
3 let
4 version = "0.20.3";
5
6 stdenv = pkgs.stdenv;
7 fetchurl = pkgs.fetchurl;
8
9 curl = pkgs.curl.override {
10 sslSupport = false;
11 gnutlsSupport = true;
12 };
13 glibc = pkgs.glibc;
14 openssl = pkgs.openssl;
15
16 libs = [ stdenv.cc.cc curl glibc openssl ];
17
18 in
19
20 assert pkgs.stdenv.system == "x86_64-linux";
21
22 stdenv.mkDerivation {
23 name = "nodegit-${version}";
24
25 src = fetchurl {
26 url = "https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v${version}-node-v51-linux-x64.tar.gz";
27 sha256 = "d022a88e58fa70f78b59b475fa6ecc6724d372a779b132264cf571f71bc50020";
28 };
29
30 buildPhase = ":";
31
32 libPath = stdenv.lib.makeLibraryPath libs;
33
34 installPhase = ''
35 tar --extract --file=$src Release/nodegit.node --transform 's/Release\//linux-/'
36 lib=$out/lib/nodegit.node
37 mkdir -p $out/lib
38 mv linux-nodegit.node $lib
39 '';
40
41 preFixup = ''
42 lib=$out/lib/nodegit.node
43 patchelf --set-rpath "$libPath" "$lib"
44 '';
45 }