Move registry to rebar3, since it needs it itself to be bootstrapped.

This makes rebar3 build a bit more hermetic. Next stage is to pull in
rebar3 plugins dependencies for bootstrap to pick up.
This commit is contained in:
Gleb Peregud
2015-12-15 14:05:19 +01:00
parent 033902d269
commit 4ba1a51b7f
3 changed files with 11 additions and 9 deletions
@@ -1,8 +1,13 @@
{ stdenv, fetchurl, erlang }:
{ stdenv, fetchurl, erlang, tree, fetchFromGitHub }:
let
version = "3.0.0-beta.4";
registrySnapshot = import ./registrySnapshot.nix { inherit fetchFromGitHub; };
setupRegistry = ''
mkdir -p _build/default/{lib,plugins,packages}/ ./.cache/rebar3/hex/default/
zcat ${registrySnapshot}/registry.ets.gz > .cache/rebar3/hex/default/registry
'';
in
stdenv.mkDerivation {
name = "rebar3-${version}";
@@ -13,8 +18,11 @@ stdenv.mkDerivation {
};
buildInputs = [ erlang ];
inherit setupRegistry;
buildPhase = ''
${setupRegistry}
HOME=. escript bootstrap
'';
installPhase = ''
@@ -0,0 +1,8 @@
{ fetchFromGitHub }:
fetchFromGitHub {
owner = "gleber";
repo = "hex-pm-registry-snapshots";
rev = "48147b0";
sha256 = "0ibfnhrhbka4n6wkhs99fpy3sjab54ip37jgvx2hcfhfr4pxhbxw";
}