about summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers
diff options
context:
space:
mode:
authorThomas Depierre <depierre.thomas@gmail.com>2019-10-19 17:37:44 +0200
committerThomas Depierre <depierre.thomas@gmail.com>2019-11-17 13:45:57 +0100
commit8de4654d4b108ae11a02dc39bdf0366202fe113b (patch)
tree4036ab5638bdb5ea12c6e7bd82b6b5d63fcb2777 /pkgs/development/tools/build-managers
parenta21cb752426a57888d8bc0ef957b45e7033177e7 (diff)
downloadnixlib-8de4654d4b108ae11a02dc39bdf0366202fe113b.tar
nixlib-8de4654d4b108ae11a02dc39bdf0366202fe113b.tar.gz
nixlib-8de4654d4b108ae11a02dc39bdf0366202fe113b.tar.bz2
nixlib-8de4654d4b108ae11a02dc39bdf0366202fe113b.tar.lz
nixlib-8de4654d4b108ae11a02dc39bdf0366202fe113b.tar.xz
nixlib-8de4654d4b108ae11a02dc39bdf0366202fe113b.tar.zst
nixlib-8de4654d4b108ae11a02dc39bdf0366202fe113b.zip
beam-modules/hex-snapshot: remove
The package set is not maintained. It is also not used by most of the
BEAM community. Removing it to allow a more useful set of tools fit to
the BEAM community in Nixpkgs.
Diffstat (limited to 'pkgs/development/tools/build-managers')
-rw-r--r--pkgs/development/tools/build-managers/rebar3/default.nix10
-rwxr-xr-xpkgs/development/tools/build-managers/rebar3/rebar3-nix-bootstrap45
2 files changed, 7 insertions, 48 deletions
diff --git a/pkgs/development/tools/build-managers/rebar3/default.nix b/pkgs/development/tools/build-managers/rebar3/default.nix
index feb0086a355d..4ebeb7f05284 100644
--- a/pkgs/development/tools/build-managers/rebar3/default.nix
+++ b/pkgs/development/tools/build-managers/rebar3/default.nix
@@ -1,12 +1,10 @@
 { stdenv, fetchFromGitHub,
   fetchHex, erlang,
-  tree, hexRegistrySnapshot }:
+  tree }:
 
 let
   version = "3.12.0";
 
-  bootstrapper = ./rebar3-nix-bootstrap;
-
   erlware_commons = fetchHex {
     pkg = "erlware_commons";
     version = "1.3.1";
@@ -80,15 +78,9 @@ stdenv.mkDerivation rec {
     sha256 = "0936ix7lfwsamssap58b265zid7x2m97azrr2qpjcln3xysd16lg";
   };
 
-  inherit bootstrapper;
-
   buildInputs = [ erlang tree ];
 
-  # TODO: Remove registry snapshot
-  propagatedBuildInputs = [ hexRegistrySnapshot ];
-
   postPatch = ''
-    ${erlang}/bin/escript ${bootstrapper} registry-only
     mkdir -p _checkouts
     mkdir -p _build/default/lib/
 
diff --git a/pkgs/development/tools/build-managers/rebar3/rebar3-nix-bootstrap b/pkgs/development/tools/build-managers/rebar3/rebar3-nix-bootstrap
index 802f47af6adf..f1deed1df352 100755
--- a/pkgs/development/tools/build-managers/rebar3/rebar3-nix-bootstrap
+++ b/pkgs/development/tools/build-managers/rebar3/rebar3-nix-bootstrap
@@ -25,14 +25,12 @@
 %%%   Environment Variable
 
 -record(data, {version
-              , registry_only = false
               , debug_info = false
               , compile_ports
               , erl_libs
               , plugins
               , root
-              , name
-              , registry_snapshot}).
+              , name}).
 
 -define(HEX_REGISTRY_PATH, ".cache/rebar3/hex/default/registry").
 
@@ -41,30 +39,24 @@ main(Args) ->
     {ok, RequiredData} = gather_required_data_from_the_environment(ArgData),
     do_the_bootstrap(RequiredData).
 
-%% @doc There are two modes 'registry_only' where the register is
-%% created from hex and everything else.
 -spec do_the_bootstrap(#data{}) -> ok.
-do_the_bootstrap(RequiredData = #data{registry_only = true}) ->
-    ok = bootstrap_registry(RequiredData);
 do_the_bootstrap(RequiredData) ->
-    ok = bootstrap_registry(RequiredData),
     ok = bootstrap_configs(RequiredData),
     ok = bootstrap_plugins(RequiredData),
     ok = bootstrap_libs(RequiredData).
 
 %% @doc
 %% Argument parsing is super simple only because we want to keep the
-%% dependencies minimal. For now there can be two entries on the
-%% command line, "registry-only" and "debug-info"
+%% dependencies minimal. For now there can be one entry on the
+%% command line: "debug-info"
 -spec parse_args([string()]) -> #data{}.
 parse_args(Args0) ->
-    PossibleArgs = sets:from_list(["registry-only", "debug-info"]),
+    PossibleArgs = sets:from_list(["debug-info"]),
     Args1 = sets:from_list(Args0),
     Result = sets:subtract(Args1, PossibleArgs),
     case sets:to_list(Result) of
         [] ->
-            {ok, #data{registry_only = sets:is_element("registry-only", Args1),
-                       debug_info = sets:is_element("debug-info", Args1)}};
+            {ok, #data{debug_info = sets:is_element("debug-info", Args1)}};
         UnknownArgs ->
             io:format("Unexpected command line arguments passed in: ~p~n",
                       [UnknownArgs]),
@@ -156,30 +148,6 @@ fixup_app_name(FileName) ->
         [Name, _Version, _Tag] -> Name
     end.
 
--spec bootstrap_registry(#data{}) -> ok.
-bootstrap_registry(#data{registry_snapshot = RegistrySnapshot}) ->
-    io:format("Bootstrapping Hex Registry for Rebar~n"),
-    make_sure_registry_snapshot_exists(RegistrySnapshot),
-    filelib:ensure_dir(?HEX_REGISTRY_PATH),
-    ok = case filelib:is_file(?HEX_REGISTRY_PATH) of
-             true ->
-                 file:delete(?HEX_REGISTRY_PATH);
-             false ->
-                 ok
-         end,
-    ok = file:make_symlink(RegistrySnapshot,
-                           ?HEX_REGISTRY_PATH).
-
--spec make_sure_registry_snapshot_exists(string()) -> ok.
-make_sure_registry_snapshot_exists(RegistrySnapshot) ->
-    case filelib:is_file(RegistrySnapshot) of
-        true ->
-            ok;
-        false ->
-            stderr("Registry snapshot (~s) does not exist!", [RegistrySnapshot]),
-            erlang:halt(1)
-    end.
-
 -spec gather_required_data_from_the_environment(#data{}) -> {ok, #data{}}.
 gather_required_data_from_the_environment(ArgData) ->
     {ok, ArgData#data{ version = guard_env("version")
@@ -187,8 +155,7 @@ gather_required_data_from_the_environment(ArgData) ->
                      , plugins = get_env("buildPlugins", [])
                      , root = code:root_dir()
                      , name = guard_env("name")
-                     , compile_ports = nix2bool(get_env("compilePorts", ""))
-                     , registry_snapshot = guard_env("HEX_REGISTRY_SNAPSHOT")}}.
+                     , compile_ports = nix2bool(get_env("compilePorts", ""))}}.
 
 -spec nix2bool(any()) -> boolean().
 nix2bool("1") ->