Skip to content

Instantly share code, notes, and snippets.

@RocketPuppy
Created May 7, 2016 01:00
Show Gist options
  • Save RocketPuppy/00461c40748ee70aaef458b3626ef6b7 to your computer and use it in GitHub Desktop.
Save RocketPuppy/00461c40748ee70aaef458b3626ef6b7 to your computer and use it in GitHub Desktop.
{ stdenv, go, goPackages, git, curl, cacert, cowsay, jq,
openssl, nodejs, python, fetchFromGitHub }:
stdenv.mkDerivation rec {
rev = "v5.1.6";
name = "heroku-cli-${rev}";
buildInputs = [
cacert go nodejs curl git python cowsay jq openssl
goPackages.osext goPackages.binarydist goPackages.merry
goPackages.speakeasy goPackages.netrc goPackages.golock
goPackages.sling goPackages.errors goPackages.go-querystring
goPackages.vtclean goPackages.ioprogress goPackages.rollbar
goPackages.levenshtein goPackages.webbrowser goPackages.xz
goPackages.crypto goPackages.ginkgo goPackages.gomega
];
src = fetchFromGitHub {
inherit rev;
owner = "heroku";
repo = "cli";
sha256 = "0larcbgsg8fns0glrm4di2mpg6pv70dp6mhj6pc4xj32m7spfw3j";
};
inherit cacert nodejs;
dontStrip = true;
buildPhase = ''
mkdir $out
export HEROKU_NODE_PATH="$nodejs/bin/node"
export CURL_CA_BUNDLE="$cacert/etc/ssl/certs/ca-bundle.crt"
export WORKSPACE=$out/heroku
export HOME=$out/homeless-shelter
make build
'';
installPhase = ''
cp -r $out/heroku/* $out
rm -rf $out/heroku
mv $out/bin/heroku $out/bin/heroku-unwrapped
echo "HEROKU_NODE_PATH=$nodejs/bin/node exec $out/bin/heroku-unwrapped \$*" > $out/bin/heroku
chmod +x $out/bin/heroku
'';
shellHook = ''
export HEROKU_NODE_PATH="$nodejs/bin/node"
export CURL_CA_BUNDLE="$cacert/etc/ssl/certs/ca-bundle.crt"
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment