aboutsummaryrefslogtreecommitdiffhomepage
path: root/clever-tools
diff options
context:
space:
mode:
authorHussein Ait Lahcen <hussein.aitlahcen@gmail.com>2018-06-21 10:44:11 +0200
committerHussein Ait Lahcen <hussein.aitlahcen@gmail.com>2018-06-21 10:44:11 +0200
commit96ea4f91951010ef9c560c13122a6f8ebfac2816 (patch)
treef5be7f586f4e674af16aab2294ce1d2f8d57e7c1 /clever-tools
parentb02cae1acd4abde5cef50aa039226ac98dc27adf (diff)
downloadclever-tools-nix-96ea4f91951010ef9c560c13122a6f8ebfac2816.tar.gz
clever-tools-nix-96ea4f91951010ef9c560c13122a6f8ebfac2816.tar.zst
clever-tools-nix-96ea4f91951010ef9c560c13122a6f8ebfac2816.zip
refact: 1-1 folder-package
Diffstat (limited to 'clever-tools')
-rw-r--r--clever-tools/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/clever-tools/default.nix b/clever-tools/default.nix
new file mode 100644
index 0000000..8032014
--- /dev/null
+++ b/clever-tools/default.nix
@@ -0,0 +1,46 @@
1{ pkgs ? import <nixpkgs> {} }:
2
3with pkgs;
4
5let
6 version = "0.9.3";
7
8 nodegit = import ../nodegit/default.nix { inherit pkgs; };
9
10 libs = [ stdenv.cc.cc glibc ];
11
12in
13
14 stdenv.mkDerivation {
15 name = "clever-tools-${version}";
16
17 buildInputs = [ nodegit ];
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 libPath = stdenv.lib.makeLibraryPath libs;
25
26 nodegitLibrary = stdenv.lib.makeLibraryPath [ nodegit ];
27
28 installPhase = ''
29 tar --extract --file=$src linux/clever --transform 's/linux\///'
30 bin=$out/bin/clever
31 mkdir -p $out/bin
32 mv clever $bin
33 ln -s "$nodegitLibrary/nodegit.node" "$out/bin/nodegit.node"
34 '';
35
36 dontStrip = "true";
37
38 preFixup = ''
39 bin=$out/bin/clever
40 patchelf \
41 --set-rpath "$libPath" \
42 --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
43 "$bin"
44 '';
45
46 }