aboutsummaryrefslogtreecommitdiffhomepage
path: root/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix48
1 files changed, 48 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..65c872a
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,48 @@
1{ pkgs ? import <nixpkgs> {} }:
2
3with pkgs;
4
5let
6 version = "0.9.3";
7
8 nodegit = import ./nodegit.nix { inherit pkgs; };
9
10 libs = [ stdenv.cc.cc glibc ];
11
12in
13
14 stdenv.mkDerivation {
15 name = "clever-cli-${version}";
16
17 buildInputs = [ nodegit nodejs-6_x ];
18
19 src = fetchurl {
20 url = "https://clever-tools.cellar.services.clever-cloud.com/releases/${version}/clever-tools-${version}_linux.tar.gz";
21 sha256 = "adcae5af912dcbdc74d996b6e94767f24d16bf1bdcd5073797f999fe75b018a4";
22 };
23
24 buildPhase = ":";
25
26 libPath = stdenv.lib.makeLibraryPath libs;
27
28 nodegitLibrary = stdenv.lib.makeLibraryPath [ nodegit ];
29
30 installPhase = ''
31 tar --extract --file=$src linux/clever --transform 's/linux\///'
32 bin=$out/bin/clever
33 mkdir -p $out/bin
34 mv clever $bin
35 ln -s "$nodegitLibrary/nodegit.node" "$out/bin/nodegit.node"
36 '';
37
38 dontStrip = "true";
39
40 preFixup = ''
41 bin=$out/bin/clever
42 patchelf \
43 --set-rpath "$libPath" \
44 --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
45 "$bin"
46 '';
47
48 }