aboutsummaryrefslogtreecommitdiffhomepage
path: root/clever-tools
diff options
context:
space:
mode:
authorHussein Ait Lahcen <hussein.aitlahcen@gmail.com>2018-06-21 10:50:37 +0200
committerHussein Ait Lahcen <hussein.aitlahcen@gmail.com>2018-06-21 11:07:02 +0200
commite13be120a535969d8975be993fb9e35c780094e2 (patch)
tree0065a2983eaad742f3499cbce538964c86185590 /clever-tools
parent8be0d90992efd13b71166cd32d0fc6f10a6ed600 (diff)
downloadclever-tools-nix-e13be120a535969d8975be993fb9e35c780094e2.tar.gz
clever-tools-nix-e13be120a535969d8975be993fb9e35c780094e2.tar.zst
clever-tools-nix-e13be120a535969d8975be993fb9e35c780094e2.zip
refact: least fixed point
Diffstat (limited to 'clever-tools')
-rw-r--r--clever-tools/default.nix55
1 files changed, 25 insertions, 30 deletions
diff --git a/clever-tools/default.nix b/clever-tools/default.nix
index 497e911..6c729a5 100644
--- a/clever-tools/default.nix
+++ b/clever-tools/default.nix
@@ -1,41 +1,36 @@
1{ stdenv, fetchurl, glibc, nodegit }: 1{ stdenv, fetchurl, glibc, nodegit }:
2 2
3let 3stdenv.mkDerivation rec {
4 name = "clever-tools-${version}";
4 version = "0.9.3"; 5 version = "0.9.3";
5 6
6 libs = [ stdenv.cc.cc glibc ]; 7 src = fetchurl {
7in 8 url = "https://clever-tools.cellar.services.clever-cloud.com/releases/${version}/clever-tools-${version}_linux.tar.gz";
9 sha256 = "adcae5af912dcbdc74d996b6e94767f24d16bf1bdcd5073797f999fe75b018a4";
10 };
8 11
9 stdenv.mkDerivation { 12 buildInputs = [ nodegit ];
10 name = "clever-tools-${version}";
11 13
12 buildInputs = [ nodegit ]; 14 libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc glibc ];
13 15
14 src = fetchurl { 16 nodegitLibrary = stdenv.lib.makeLibraryPath [ nodegit ];
15 url = "https://clever-tools.cellar.services.clever-cloud.com/releases/${version}/clever-tools-${version}_linux.tar.gz";
16 sha256 = "adcae5af912dcbdc74d996b6e94767f24d16bf1bdcd5073797f999fe75b018a4";
17 };
18 17
19 libPath = stdenv.lib.makeLibraryPath libs; 18 installPhase = ''
19 tar --extract --file=$src linux/clever --transform 's/linux\///'
20 bin=$out/bin/clever
21 mkdir -p $out/bin
22 mv clever $bin
23 ln -s "$nodegitLibrary/nodegit.node" "$out/bin/nodegit.node"
24 '';
20 25
21 nodegitLibrary = stdenv.lib.makeLibraryPath [ nodegit ]; 26 dontStrip = "true";
22 27
23 installPhase = '' 28 preFixup = ''
24 tar --extract --file=$src linux/clever --transform 's/linux\///' 29 bin=$out/bin/clever
25 bin=$out/bin/clever 30 patchelf \
26 mkdir -p $out/bin 31 --set-rpath "$libPath" \
27 mv clever $bin 32 --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
28 ln -s "$nodegitLibrary/nodegit.node" "$out/bin/nodegit.node" 33 "$bin"
29 ''; 34 '';
30 35
31 dontStrip = "true"; 36}
32
33 preFixup = ''
34 bin=$out/bin/clever
35 patchelf \
36 --set-rpath "$libPath" \
37 --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
38 "$bin"
39 '';
40
41 }