diff options
author | Peter Hoeg <peter@speartail.com> | 2016-09-12 16:29:13 +0800 |
---|---|---|
committer | Peter Hoeg <peter@speartail.com> | 2016-11-04 14:56:32 +0800 |
commit | 46e6e2ba170e1c462fd752080c3e7c4bd93ba324 (patch) | |
tree | 6c2c7ecabf75e4ad01c6ee5b40accffbc52b1183 /pkgs/development/tools/heroku | |
parent | fa4167c0a13cbe0d97b9c88d91b86845a8c4e740 (diff) | |
download | nixlib-46e6e2ba170e1c462fd752080c3e7c4bd93ba324.tar nixlib-46e6e2ba170e1c462fd752080c3e7c4bd93ba324.tar.gz nixlib-46e6e2ba170e1c462fd752080c3e7c4bd93ba324.tar.bz2 nixlib-46e6e2ba170e1c462fd752080c3e7c4bd93ba324.tar.lz nixlib-46e6e2ba170e1c462fd752080c3e7c4bd93ba324.tar.xz nixlib-46e6e2ba170e1c462fd752080c3e7c4bd93ba324.tar.zst nixlib-46e6e2ba170e1c462fd752080c3e7c4bd93ba324.zip |
heroku: [WIP] 3.43.2 -> 3.43.12 and wrap the downloaded binary
The heroku tool has changed and now downloads a binary to do bulk of the work. This PR also downloads the binary to wrap it properly, but due to https://github.com/NixOS/patchelf/issues/66 we cannot ```patchelf``` the binary and it doesn't work. So for now we instead wrap it in a buildFHSUserEnv so at least things are working again. Once the patchelf issue has been solved, I'll update this again.
Diffstat (limited to 'pkgs/development/tools/heroku')
-rw-r--r-- | pkgs/development/tools/heroku/default.nix | 84 |
1 files changed, 65 insertions, 19 deletions
diff --git a/pkgs/development/tools/heroku/default.nix b/pkgs/development/tools/heroku/default.nix index 0993ee7b5443..e78c7a7ff9a5 100644 --- a/pkgs/development/tools/heroku/default.nix +++ b/pkgs/development/tools/heroku/default.nix @@ -1,28 +1,74 @@ -{ stdenv, fetchurl, postgresql, ruby, makeWrapper, nodejs-6_x }: +{ stdenv, fetchurl, bash, buildFHSUserEnv, makeWrapper, writeTextFile +, nodejs-6_x, postgresql, ruby }: with stdenv.lib; -stdenv.mkDerivation rec { - version = "3.43.2"; - name = "heroku-${version}"; - 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; +let + version = "3.43.12"; + bin_ver = "5.4.7-8dc2c80"; + + arch = { + "x86_64-linux" = "linux-amd64"; + }."${stdenv.system}" or (throw "system ${stdenv.system} not supported"); + + sha256 = { + "x86_64-linux" = "0iqjxkdw53dvy54ahmr9yijlxrp5nbikh9z7iss93z753cgxdl06"; + }."${stdenv.system}" or (throw "system ${stdenv.system} not supported"); + + fhsEnv = buildFHSUserEnv { + name = "heroku-fhs-env"; }; - src = fetchurl { - url = "https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client-${version}.tgz"; - sha256 = "1sapbxg7pzi89c95k0vsp8k5bysggkjf58jwck2xs0y4ly36wbnc"; + 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"; + }; + + 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; }; - installPhase = '' - mkdir -p $out - cp -R * $out/ - wrapProgram $out/bin/heroku --set HEROKU_NODE_PATH ${nodejs-6_x}/bin/node +in writeTextFile { + name = "heroku-${version}"; + destination = "/bin/heroku"; + executable = true; + text = '' + #!${bash}/bin/bash -e + ${fhsEnv}/bin/heroku-fhs-env ${heroku}/bin/heroku ''; - - buildInputs = [ ruby postgresql makeWrapper ]; } |