{ stdenv, fetchurl, glibc, nodegit }:
-let
+stdenv.mkDerivation rec {
+ name = "clever-tools-${version}";
version = "0.9.3";
- libs = [ stdenv.cc.cc glibc ];
-in
+ src = fetchurl {
+ url = "https://clever-tools.cellar.services.clever-cloud.com/releases/${version}/clever-tools-${version}_linux.tar.gz";
+ sha256 = "adcae5af912dcbdc74d996b6e94767f24d16bf1bdcd5073797f999fe75b018a4";
+ };
- stdenv.mkDerivation {
- name = "clever-tools-${version}";
+ buildInputs = [ nodegit ];
- buildInputs = [ nodegit ];
+ libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc glibc ];
- src = fetchurl {
- url = "https://clever-tools.cellar.services.clever-cloud.com/releases/${version}/clever-tools-${version}_linux.tar.gz";
- sha256 = "adcae5af912dcbdc74d996b6e94767f24d16bf1bdcd5073797f999fe75b018a4";
- };
+ nodegitLibrary = stdenv.lib.makeLibraryPath [ nodegit ];
- libPath = stdenv.lib.makeLibraryPath libs;
+ installPhase = ''
+ tar --extract --file=$src linux/clever --transform 's/linux\///'
+ bin=$out/bin/clever
+ mkdir -p $out/bin
+ mv clever $bin
+ ln -s "$nodegitLibrary/nodegit.node" "$out/bin/nodegit.node"
+ '';
- nodegitLibrary = stdenv.lib.makeLibraryPath [ nodegit ];
+ dontStrip = "true";
- installPhase = ''
- tar --extract --file=$src linux/clever --transform 's/linux\///'
- bin=$out/bin/clever
- mkdir -p $out/bin
- mv clever $bin
- ln -s "$nodegitLibrary/nodegit.node" "$out/bin/nodegit.node"
- '';
+ preFixup = ''
+ bin=$out/bin/clever
+ patchelf \
+ --set-rpath "$libPath" \
+ --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+ "$bin"
+ '';
- dontStrip = "true";
-
- preFixup = ''
- bin=$out/bin/clever
- patchelf \
- --set-rpath "$libPath" \
- --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
- "$bin"
- '';
-
- }
+}
{ stdenv, fetchurl, curl, glibc, openssl }:
-let
+assert stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+ name = "nodegit-${version}-node-v51";
version = "0.20.3";
- curlWithGnutls = curl.override {
- sslSupport = false;
- gnutlsSupport = true;
+ src = fetchurl {
+ url = "https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v${version}-node-v51-linux-x64.tar.gz";
+ sha256 = "d022a88e58fa70f78b59b475fa6ecc6724d372a779b132264cf571f71bc50020";
};
- libs = [ stdenv.cc.cc curlWithGnutls glibc openssl ];
-in
-
- assert stdenv.system == "x86_64-linux";
-
- stdenv.mkDerivation {
- name = "nodegit-${version}-node-v51";
-
- src = fetchurl {
- url = "https://nodegit.s3.amazonaws.com/nodegit/nodegit/nodegit-v${version}-node-v51-linux-x64.tar.gz";
- sha256 = "d022a88e58fa70f78b59b475fa6ecc6724d372a779b132264cf571f71bc50020";
- };
-
- libPath = stdenv.lib.makeLibraryPath libs;
-
- installPhase = ''
- tar --extract --file=$src Release/nodegit.node --transform 's/Release\//linux-/'
- lib=$out/lib/nodegit.node
- mkdir -p $out/lib
- mv linux-nodegit.node $lib
- '';
-
- preFixup = ''
- lib=$out/lib/nodegit.node
- patchelf --set-rpath "$libPath" "$lib"
- '';
- }
+ libPath = stdenv.lib.makeLibraryPath [
+ stdenv.cc.cc
+ (curl.override {
+ sslSupport = false;
+ gnutlsSupport = true;
+ })
+ glibc
+ openssl
+ ];
+
+ installPhase = ''
+ tar --extract --file=$src Release/nodegit.node --transform 's/Release\//linux-/'
+ lib=$out/lib/nodegit.node
+ mkdir -p $out/lib
+ mv linux-nodegit.node $lib
+ '';
+
+ preFixup = ''
+ lib=$out/lib/nodegit.node
+ patchelf --set-rpath "$libPath" "$lib"
+ '';
+}