Merge pull request #22341 from peterhoeg/f/heroku

heroku: 3.43.12 -> 3.43.16
This commit is contained in:
Alexey Shmalko 2017-02-01 21:29:22 +02:00 committed by GitHub
commit 7f3f30b782

View File

@ -1,74 +1,56 @@
{ stdenv, fetchurl, bash, buildFHSUserEnv, makeWrapper, writeTextFile { stdenv, lib, fetchurl, makeWrapper, buildGoPackage, fetchFromGitHub
, nodejs-6_x, postgresql, ruby }: , nodejs-6_x, postgresql, ruby }:
with stdenv.lib; with stdenv.lib;
let let
version = "3.43.12"; cli = buildGoPackage rec {
bin_ver = "5.4.7-8dc2c80"; name = "cli-${version}";
version = "5.6.14";
arch = { goPackagePath = "github.com/heroku/cli";
"x86_64-linux" = "linux-amd64";
}."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
sha256 = { src = fetchFromGitHub {
"x86_64-linux" = "0iqjxkdw53dvy54ahmr9yijlxrp5nbikh9z7iss93z753cgxdl06"; owner = "heroku";
}."${stdenv.system}" or (throw "system ${stdenv.system} not supported"); repo = "cli";
rev = "v${version}";
fhsEnv = buildFHSUserEnv { sha256 = "11jccham1vkmh5284l6i30na4a4y7b1jhi2ci2z2wwx8m3gkypq9";
name = "heroku-fhs-env"; };
}; };
heroku = stdenv.mkDerivation rec { in 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";
};
bin = fetchurl {
url = "https://cli-assets.heroku.com/branches/stable/${bin_ver}/heroku-v${bin_ver}-${arch}.tar.gz";
inherit sha256;
};
installPhase = ''
cli=$out/share/heroku/cli
mkdir -p $cli
tar xzf $src -C $out --strip-components=1
tar xzf $bin -C $cli --strip-components=1
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
# 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
'';
buildInputs = [ fhsEnv ruby postgresql makeWrapper ];
doUnpack = false;
};
in writeTextFile {
name = "heroku-${version}"; name = "heroku-${version}";
destination = "/bin/heroku"; version = "3.43.16";
executable = true;
text = '' meta = {
#!${bash}/bin/bash -e homepage = "https://toolbelt.heroku.com";
${fhsEnv}/bin/heroku-fhs-env ${heroku}/bin/heroku description = "Everything you need to get started using Heroku";
maintainers = with maintainers; [ aflatter mirdhyn peterhoeg ];
license = licenses.mit;
platforms = with platforms; unix;
};
binPath = lib.makeBinPath [ postgresql ruby ];
buildInputs = [ makeWrapper ];
doUnpack = false;
src = fetchurl {
url = "https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client-${version}.tgz";
sha256 = "08pai3cjaj7wshhyjcmkvyr1qxv5ab980whcm406798ng8f91hn7";
};
installPhase = ''
mkdir -p $out
tar xzf $src -C $out --strip-components=1
install -Dm755 ${cli}/bin/cli $out/share/heroku/cli/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}
''; '';
} }