2017-02-01 10:39:43 +00:00
|
|
|
{ stdenv, lib, fetchurl, makeWrapper, buildGoPackage, fetchFromGitHub
|
2016-09-12 09:29:13 +01:00
|
|
|
, nodejs-6_x, postgresql, ruby }:
|
2015-03-24 10:03:07 +00:00
|
|
|
|
2015-04-28 16:02:33 +01:00
|
|
|
with stdenv.lib;
|
2015-03-24 10:03:07 +00:00
|
|
|
|
2016-09-12 09:29:13 +01:00
|
|
|
let
|
2017-02-01 10:39:43 +00:00
|
|
|
cli = buildGoPackage rec {
|
|
|
|
name = "cli-${version}";
|
2017-03-12 06:40:26 +00:00
|
|
|
version = "5.6.32";
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
goPackagePath = "github.com/heroku/cli";
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "heroku";
|
|
|
|
repo = "cli";
|
|
|
|
rev = "v${version}";
|
2017-03-12 06:40:26 +00:00
|
|
|
sha256 = "062aa79mv2njjb0ix7isbz6646wxmsldv27bsz5v2pbv597km0vz";
|
2016-09-12 09:29:13 +01:00
|
|
|
};
|
2017-03-12 06:40:26 +00:00
|
|
|
|
|
|
|
buildFlagsArray = ''
|
|
|
|
-ldflags=
|
|
|
|
-X=main.Version=${version}
|
|
|
|
-X=main.Channel=stable
|
|
|
|
-X=main.Autoupdate=no
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=/tmp
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
2017-02-01 10:39:43 +00:00
|
|
|
};
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
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;
|
|
|
|
};
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
binPath = lib.makeBinPath [ postgresql ruby ];
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
buildInputs = [ makeWrapper ];
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
doUnpack = false;
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client-${version}.tgz";
|
|
|
|
sha256 = "08pai3cjaj7wshhyjcmkvyr1qxv5ab980whcm406798ng8f91hn7";
|
|
|
|
};
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
2016-09-12 09:29:13 +01:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
tar xzf $src -C $out --strip-components=1
|
|
|
|
install -Dm755 ${cli}/bin/cli $out/share/heroku/cli/bin/heroku
|
2015-03-24 10:03:07 +00:00
|
|
|
|
2017-02-01 10:39:43 +00:00
|
|
|
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}
|
2015-03-24 10:03:07 +00:00
|
|
|
'';
|
|
|
|
}
|