aboutsummaryrefslogtreecommitdiffhomepage
path: root/nodegit.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nodegit.nix')
-rw-r--r--nodegit.nix43
1 files changed, 43 insertions, 0 deletions
diff --git a/nodegit.nix b/nodegit.nix
new file mode 100644
index 0000000..aee9fcf
--- /dev/null
+++ b/nodegit.nix
@@ -0,0 +1,43 @@
1{ pkgs }:
2
3let
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
18in
19
20 assert pkgs.stdenv.system == "x86_64-linux";
21
22 stdenv.mkDerivation {
23 name = "nodegit-${version}-node-v51";
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 libPath = stdenv.lib.makeLibraryPath libs;
31
32 installPhase = ''
33 tar --extract --file=$src Release/nodegit.node --transform 's/Release\//linux-/'
34 lib=$out/lib/nodegit.node
35 mkdir -p $out/lib
36 mv linux-nodegit.node $lib
37 '';
38
39 preFixup = ''
40 lib=$out/lib/nodegit.node
41 patchelf --set-rpath "$libPath" "$lib"
42 '';
43 }