summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexey Shmalko <rasen.dubi@gmail.com>2017-02-01 21:29:22 +0200
committerGitHub <noreply@github.com>2017-02-01 21:29:22 +0200
commit7f3f30b78275593ab060055a85a7cdbc8bc15a20 (patch)
tree0fee494ac98039ef9a844708f4c9f9270e7d9e95
parentac10c19746ceaec1459548cf2ba9585b4c905f2f (diff)
parentfda3edda4b538ee5fc7d9b5c392c9863fa0d5ab5 (diff)
downloadnixpkgs-7f3f30b78275593ab060055a85a7cdbc8bc15a20.tar
nixpkgs-7f3f30b78275593ab060055a85a7cdbc8bc15a20.tar.gz
nixpkgs-7f3f30b78275593ab060055a85a7cdbc8bc15a20.tar.bz2
nixpkgs-7f3f30b78275593ab060055a85a7cdbc8bc15a20.tar.lz
nixpkgs-7f3f30b78275593ab060055a85a7cdbc8bc15a20.tar.xz
nixpkgs-7f3f30b78275593ab060055a85a7cdbc8bc15a20.tar.zst
nixpkgs-7f3f30b78275593ab060055a85a7cdbc8bc15a20.zip
Merge pull request #22341 from peterhoeg/f/heroku
heroku: 3.43.12 -> 3.43.16
-rw-r--r--pkgs/development/tools/heroku/default.nix94
1 files changed, 38 insertions, 56 deletions
diff --git a/pkgs/development/tools/heroku/default.nix b/pkgs/development/tools/heroku/default.nix
index e78c7a7ff9a..f9c43ee841b 100644
--- a/pkgs/development/tools/heroku/default.nix
+++ b/pkgs/development/tools/heroku/default.nix
@@ -1,74 +1,56 @@
-{ stdenv, fetchurl, bash, buildFHSUserEnv, makeWrapper, writeTextFile
+{ stdenv, lib, fetchurl, makeWrapper, buildGoPackage, fetchFromGitHub
 , nodejs-6_x, postgresql, ruby }:
 
 with stdenv.lib;
 
 let
-  version = "3.43.12";
-  bin_ver = "5.4.7-8dc2c80";
+  cli = buildGoPackage rec {
+    name = "cli-${version}";
+    version = "5.6.14";
 
-  arch = {
-    "x86_64-linux" = "linux-amd64";
-  }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
+    goPackagePath = "github.com/heroku/cli";
 
-  sha256 = {
-    "x86_64-linux" = "0iqjxkdw53dvy54ahmr9yijlxrp5nbikh9z7iss93z753cgxdl06";
-  }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
-
-  fhsEnv = buildFHSUserEnv {
-    name = "heroku-fhs-env";
-  };
-
-  heroku = stdenv.mkDerivation rec {
-    inherit version;
-    name = "heroku";
-
-    meta = {
-      homepage = "https://toolbelt.heroku.com";
-      description = "Everything you need to get started using Heroku";
-      maintainers = with maintainers; [ aflatter mirdhyn ];
-      license = licenses.mit;
-      platforms = with platforms; unix;
-    };
-
-    src = fetchurl {
-      url = "https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client-${version}.tgz";
-      sha256 = "1z7z8sl2hkrc8rdvx3h00fbcrxs827xlfp6fji0ap97a6jc0v9x4";
+    src = fetchFromGitHub {
+      owner  = "heroku";
+      repo   = "cli";
+      rev    = "v${version}";
+      sha256 = "11jccham1vkmh5284l6i30na4a4y7b1jhi2ci2z2wwx8m3gkypq9";
     };
+  };
 
-    bin = fetchurl {
-      url = "https://cli-assets.heroku.com/branches/stable/${bin_ver}/heroku-v${bin_ver}-${arch}.tar.gz";
-      inherit sha256;
-    };
+in stdenv.mkDerivation rec {
+  name = "heroku-${version}";
+  version = "3.43.16";
+
+  meta = {
+    homepage = "https://toolbelt.heroku.com";
+    description = "Everything you need to get started using Heroku";
+    maintainers = with maintainers; [ aflatter mirdhyn peterhoeg ];
+    license = licenses.mit;
+    platforms = with platforms; unix;
+  };
 
-    installPhase = ''
-      cli=$out/share/heroku/cli
-      mkdir -p $cli
+  binPath = lib.makeBinPath [ postgresql ruby ];
 
-      tar xzf $src -C $out --strip-components=1
-      tar xzf $bin -C $cli --strip-components=1
+  buildInputs = [ makeWrapper ];
 
-      wrapProgram $out/bin/heroku \
-        --set HEROKU_NODE_PATH ${nodejs-6_x}/bin/node \
-        --set XDG_DATA_HOME    $out/share \
-        --set XDG_DATA_DIRS    $out/share
+  doUnpack = false;
 
-      # When https://github.com/NixOS/patchelf/issues/66 is fixed, reinstate this and dump the fhsuserenv
-      #patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
-      #  $cli/bin/heroku
-    '';
+  src = fetchurl {
+    url = "https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client-${version}.tgz";
+    sha256 = "08pai3cjaj7wshhyjcmkvyr1qxv5ab980whcm406798ng8f91hn7";
+  };
 
-    buildInputs = [ fhsEnv ruby postgresql makeWrapper ];
+  installPhase = ''
+    mkdir -p $out
 
-    doUnpack = false;
-  };
+    tar xzf $src -C $out --strip-components=1
+    install -Dm755 ${cli}/bin/cli $out/share/heroku/cli/bin/heroku
 
-in writeTextFile {
-  name = "heroku-${version}";
-  destination = "/bin/heroku";
-  executable = true;
-  text = ''
-    #!${bash}/bin/bash -e
-    ${fhsEnv}/bin/heroku-fhs-env ${heroku}/bin/heroku
+    wrapProgram $out/bin/heroku \
+      --set HEROKU_NODE_PATH ${nodejs-6_x}/bin/node \
+      --set XDG_DATA_HOME    $out/share \
+      --set XDG_DATA_DIRS    $out/share \
+      --prefix PATH : ${binPath}
   '';
 }