diff options
Diffstat (limited to 'nodegit/default.nix')
-rw-r--r-- | nodegit/default.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/nodegit/default.nix b/nodegit/default.nix new file mode 100644 index 0000000..4bf6dd1 --- /dev/null +++ b/nodegit/default.nix | |||
@@ -0,0 +1,35 @@ | |||
1 | { stdenv, fetchurl, curl, glibc, openssl }: | ||
2 | |||
3 | assert stdenv.system == "x86_64-linux"; | ||
4 | |||
5 | stdenv.mkDerivation rec { | ||
6 | name = "nodegit-${version}-node-v51"; | ||
7 | version = "0.20.3"; | ||
8 | |||
9 | src = fetchurl { | ||
10 | url = "https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v${version}-node-v51-linux-x64.tar.gz"; | ||
11 | sha256 = "d022a88e58fa70f78b59b475fa6ecc6724d372a779b132264cf571f71bc50020"; | ||
12 | }; | ||
13 | |||
14 | libPath = stdenv.lib.makeLibraryPath [ | ||
15 | stdenv.cc.cc | ||
16 | (curl.override { | ||
17 | sslSupport = false; | ||
18 | gnutlsSupport = true; | ||
19 | }) | ||
20 | glibc | ||
21 | openssl | ||
22 | ]; | ||
23 | |||
24 | installPhase = '' | ||
25 | tar --extract --file=$src Release/nodegit.node --transform 's/Release\//linux-/' | ||
26 | lib=$out/lib/nodegit.node | ||
27 | mkdir -p $out/lib | ||
28 | mv linux-nodegit.node $lib | ||
29 | ''; | ||
30 | |||
31 | preFixup = '' | ||
32 | lib=$out/lib/nodegit.node | ||
33 | patchelf --set-rpath "$libPath" "$lib" | ||
34 | ''; | ||
35 | } | ||