nixpkgs/pkgs/development/tools/heroku/default.nix

71 lines
1.7 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, makeWrapper, buildGoPackage, fetchFromGitHub
, nodejs-6_x, postgresql, ruby }:
2015-03-24 10:03:07 +00:00
with stdenv.lib;
2015-03-24 10:03:07 +00:00
let
cli = buildGoPackage rec {
name = "cli-${version}";
2017-03-12 06:40:26 +00:00
version = "5.6.32";
goPackagePath = "github.com/heroku/cli";
src = fetchFromGitHub {
owner = "heroku";
repo = "cli";
rev = "v${version}";
2017-03-12 06:40:26 +00:00
sha256 = "062aa79mv2njjb0ix7isbz6646wxmsldv27bsz5v2pbv597km0vz";
};
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;
};
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;
2017-07-18 07:43:07 +01:00
broken = true; # Outdated function, not supported upstream. https://github.com/NixOS/nixpkgs/issues/27447
};
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
2015-03-24 10:03:07 +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
'';
}