aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--clever-tools/default.nix46
-rw-r--r--default.nix47
-rw-r--r--nodegit/default.nix (renamed from nodegit.nix)0
3 files changed, 48 insertions, 45 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 }
diff --git a/default.nix b/default.nix
index 9374e08..094b3b0 100644
--- a/default.nix
+++ b/default.nix
@@ -1,46 +1,3 @@
1{ pkgs ? import <nixpkgs> {} }: 1with import <nixpkgs> {};
2 2
3with pkgs; 3callPackage ./clever-tools {}
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-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 }
diff --git a/nodegit.nix b/nodegit/default.nix
index aee9fcf..aee9fcf 100644
--- a/nodegit.nix
+++ b/nodegit/default.nix