]> git.immae.eu Git - github/fretlink/clever-tools-nix.git/commitdiff
refact: least fixed point
authorHussein Ait Lahcen <hussein.aitlahcen@gmail.com>
Thu, 21 Jun 2018 08:50:37 +0000 (10:50 +0200)
committerHussein Ait Lahcen <hussein.aitlahcen@gmail.com>
Thu, 21 Jun 2018 09:07:02 +0000 (11:07 +0200)
clever-tools/default.nix
nodegit/default.nix

index 497e91118c96a9ba1f9b3fc7567a9e74d523c886..6c729a51bdacfbae45695c3ff4dc5e890eb04da3 100644 (file)
@@ -1,41 +1,36 @@
 { 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"
-    '';
-
-  }
+}
index 83d734a9ab16583579e63818c59cbcc5a5e863c7..4bf6dd10ce34b2bb2e72b01af25512f00830cb01 100644 (file)
@@ -1,37 +1,35 @@
 { 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"
+  '';
+}