git.iko.soy/typeable/nixpkgs
on master help sign in
rebar3: 3.1.0 -> 3.3.2
commitfe727a19c10bd7ddf72a71ee573c269ac7431b27 authorEric Bailey <eric@ericb.me> dateWed 23 Nov 2016, 15:06 (10 years ago) parent4125688
3 files changed+81−71
pkgs/development/tools/build-managers/rebar3/default.nix+34−34 pkgs/development/tools/build-managers/rebar3/hermetic-bootstrap.patch+28−18 pkgs/development/tools/build-managers/rebar3/hermetic-rebar3.patch+19−19
pkgs/development/tools/build-managers/rebar3/default.nix+34−34
@@ -3,45 +3,20 @@
33 tree, fetchFromGitHub, hexRegistrySnapshot }:
44
55let
6− version = "3.1.0";
6+ version = "3.3.2";
77
88 bootstrapper = ./rebar3-nix-bootstrap;
99
10− erlware_commons = fetchHex {
11− pkg = "erlware_commons";
12− version = "0.19.0";
13− sha256 = "1gfsy9bbhjb94c5ghff2niamn93x2x08lnklh6pp7sfr5i0gkgsv";
14− };
15− ssl_verify_hostname = fetchHex {
16− pkg = "ssl_verify_hostname";
17− version = "1.0.5";
18− sha256 = "1gzavzqzljywx4l59gvhkjbr1dip4kxzjjz1s4wsn42f2kk13jzj";
10+ bbmustache = fetchHex {
11+ pkg = "bbmustache";
12+ version = "1.3.0";
13+ sha256 = "042pfgss8kscq6ssg8gix8ccmdsrx0anjczsbrn2a6c36ljrx2p6";
1914 };
2015 certifi = fetchHex {
2116 pkg = "certifi";
2217 version = "0.4.0";
2318 sha256 = "04bnvsbssdcf6b9h9bfglflds7j0gx6q5igl1xxhx6fnwaz37hhw";
2419 };
25− providers = fetchHex {
26− pkg = "providers";
27− version = "1.6.0";
28− sha256 = "0byfa1h57n46jilz4q132j0vk3iqc0v1vip89li38gb1k997cs0g";
29− };
30− getopt = fetchHex {
31− pkg = "getopt";
32− version = "0.8.2";
33− sha256 = "1xw30h59zbw957cyjd8n50hf9y09jnv9dyry6x3avfwzcyrnsvkk";
34− };
35− bbmustache = fetchHex {
36− pkg = "bbmustache";
37− version = "1.0.4";
38− sha256 = "04lvwm7f78x8bys0js33higswjkyimbygp4n72cxz1kfnryx9c03";
39− };
40− relx = fetchHex {
41− pkg = "relx";
42− version = "3.17.0";
43− sha256 = "1xjybi93m8gj9f9z3lkc7xbg3k5cw56yl78rcz5qfirr0223sby2";
44− };
4520 cf = fetchHex {
4621 pkg = "cf";
4722 version = "0.2.1";
@@ -49,14 +24,39 @@ let
4924 };
5025 cth_readable = fetchHex {
5126 pkg = "cth_readable";
52− version = "1.2.2";
53− sha256 = "0kb9v4998liwyidpjkhcg1nin6djjzxcx6b313pbjicbp4r58n3p";
27+ version = "1.2.3";
28+ sha256 = "0wfpfismzi2q0nzvx9qyllch4skwmsk6yqffw8iw2v48ssbfvfhz";
29+ };
30+ erlware_commons = fetchHex {
31+ pkg = "erlware_commons";
32+ version = "0.21.0";
33+ sha256 = "0gxb011m637rca2g0vhm1q9krm3va50rz1py6zf8k92q4iv9a2p7";
5434 };
5535 eunit_formatters = fetchHex {
5636 pkg = "eunit_formatters";
5737 version = "0.3.1";
5838 sha256 = "0cg9dasv60v09q3q4wja76pld0546mhmlpb0khagyylv890hg934";
5939 };
40+ getopt = fetchHex {
41+ pkg = "getopt";
42+ version = "0.8.2";
43+ sha256 = "1xw30h59zbw957cyjd8n50hf9y09jnv9dyry6x3avfwzcyrnsvkk";
44+ };
45+ providers = fetchHex {
46+ pkg = "providers";
47+ version = "1.6.0";
48+ sha256 = "0byfa1h57n46jilz4q132j0vk3iqc0v1vip89li38gb1k997cs0g";
49+ };
50+ ssl_verify_fun = fetchHex {
51+ pkg = "ssl_verify_fun";
52+ version = "1.1.1";
53+ sha256 = "0pnnan9xf4r6pr34hi28zdyv501i39jwnrwk6pr9r4wabkmhb22g";
54+ };
55+ relx = fetchHex {
56+ pkg = "relx";
57+ version = "3.21.1";
58+ sha256 = "00590aqy0rfzgsnzxqgwbmn90imxxqlzmnmapy6bq76vw2rynvb8";
59+ };
6060 rebar3_hex = fetchHex {
6161 pkg = "rebar3_hex";
6262 version = "1.12.0";
@@ -70,7 +70,7 @@ stdenv.mkDerivation {
7070
7171 src = fetchurl {
7272 url = "https://github.com/rebar/rebar3/archive/${version}.tar.gz";
73− sha256 = "0r4wpnpi81ha4iirv9hcif3vrgc82qd51kah7rnhvpym55wcy9ml";
73+ sha256 = "14nhc1bmna3b4y9qmd0lzpi0jdaw92r7ljg7vlghn297awsjgg6c";
7474 };
7575
7676 inherit bootstrapper;
@@ -97,7 +97,7 @@ stdenv.mkDerivation {
9797 cp --no-preserve=mode -R ${cth_readable} _build/default/lib/cth_readable
9898 cp --no-preserve=mode -R ${eunit_formatters} _build/default/lib/eunit_formatters
9999 cp --no-preserve=mode -R ${relx} _build/default/lib/relx
100− cp --no-preserve=mode -R ${ssl_verify_hostname} _build/default/lib/ssl_verify_hostname
100+ cp --no-preserve=mode -R ${ssl_verify_fun} _build/default/lib/ssl_verify_fun
101101 cp --no-preserve=mode -R ${rebar3_hex} _build/default/plugins/rebar3_hex
102102 '';
103103
pkgs/development/tools/build-managers/rebar3/hermetic-bootstrap.patch+28−18
@@ -1,5 +1,5 @@
11diff --git a/bootstrap b/bootstrap
2−index 35759b0..939c838 100755
2+index c36fddb..9fcb718 100755
33--- a/bootstrap
44+++ b/bootstrap
55@@ -7,9 +7,11 @@ main(_) ->
@@ -9,42 +9,44 @@ index 35759b0..939c838 100755
99- inets:start(),
1010- inets:start(httpc, [{profile, rebar}]),
1111- set_httpc_options(),
12−+ %% Removed for hermeticity on Nix
12++ %% Removed for hermeticity on Nix
1313+ %%
14−+ %% inets:start(),
15−+ %% inets:start(httpc, [{profile, rebar}]),
16−+ %% set_httpc_options(),
17−
14++ %% inets:start(),
15++ %% inets:start(httpc, [{profile, rebar}]),
16++ %% set_httpc_options(),
17+
1818 %% Fetch and build deps required to build rebar3
1919 BaseDeps = [{providers, []}
20−@@ -74,12 +76,12 @@ default_registry_file() ->
20+@@ -73,13 +75,13 @@ default_registry_file() ->
21+ CacheDir = filename:join([Home, ".cache", "rebar3"]),
2122 filename:join([CacheDir, "hex", "default", "registry"]).
22−
23− fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
23+
24+-fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
2425- case lists:keyfind(Name, 1, Deps) of
2526- {Name, Vsn} ->
2627- ok = fetch({pkg, atom_to_binary(Name, utf8), list_to_binary(Vsn)}, Name);
2728- {Name, _, Source} ->
2829- ok = fetch(Source, Name)
2930- end,
31++fetch_and_compile({Name, ErlFirstFiles}, _Deps) ->
3032+ %% case lists:keyfind(Name, 1, Deps) of
3133+ %% {Name, Vsn} ->
3234+ %% ok = fetch({pkg, atom_to_binary(Name, utf8), list_to_binary(Vsn)}, Name);
3335+ %% {Name, _, Source} ->
3436+ %% ok = fetch(Source, Name)
3537+ %% end,
36−
38+
3739 %% Hack: erlware_commons depends on a .script file to check if it is being built with
3840 %% rebar2 or rebar3. But since rebar3 isn't built yet it can't get the vsn with get_key.
39−@@ -88,63 +90,63 @@ fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
40−
41+@@ -88,67 +90,67 @@ fetch_and_compile({Name, ErlFirstFiles}, Deps) ->
42+
4143 compile(Name, ErlFirstFiles).
42−
44+
4345-fetch({pkg, Name, Vsn}, App) ->
4446- Dir = filename:join([filename:absname("_build/default/lib/"), App]),
4547- case filelib:is_dir(Dir) of
4648- false ->
47−- CDN = "https://s3.amazonaws.com/s3.hex.pm/tarballs",
49+- CDN = "https://repo.hex.pm/tarballs",
4850- Package = binary_to_list(<<Name/binary, "-", Vsn/binary, ".tar">>),
4951- Url = string:join([CDN, Package], "/"),
5052- case request(Url) of
@@ -85,7 +87,11 @@ index 35759b0..939c838 100755
8587- end.
8688-
8789-get_http_vars(Scheme) ->
88−- proplists:get_value(Scheme, get_rebar_config(), []).
90+- OS = case os:getenv(atom_to_list(Scheme)) of
91+- Str when is_list(Str) -> Str;
92+- _ -> []
93+- end,
94+- proplists:get_value(Scheme, get_rebar_config(), OS).
8995-
9096-set_httpc_options() ->
9197- set_httpc_options(https_proxy, get_http_vars(https_proxy)),
@@ -101,7 +107,7 @@ index 35759b0..939c838 100755
101107+%% Dir = filename:join([filename:absname("_build/default/lib/"), App]),
102108+%% case filelib:is_dir(Dir) of
103109+%% false ->
104−+%% CDN = "https://s3.amazonaws.com/s3.hex.pm/tarballs",
110++%% CDN = "https://repo.hex.pm/tarballs",
105111+%% Package = binary_to_list(<<Name/binary, "-", Vsn/binary, ".tar">>),
106112+%% Url = string:join([CDN, Package], "/"),
107113+%% case request(Url) of
@@ -142,7 +148,11 @@ index 35759b0..939c838 100755
142148+%% end.
143149+
144150+%% get_http_vars(Scheme) ->
145−+%% proplists:get_value(Scheme, get_rebar_config(), []).
151++%% OS = case os:getenv(atom_to_list(Scheme)) of
152++%% Str when is_list(Str) -> Str;
153++%% _ -> []
154++%% end,
155++%% proplists:get_value(Scheme, get_rebar_config(), OS).
146156+
147157+%% set_httpc_options() ->
148158+%% set_httpc_options(https_proxy, get_http_vars(https_proxy)),
@@ -154,6 +164,6 @@ index 35759b0..939c838 100755
154164+%% set_httpc_options(Scheme, Proxy) ->
155165+%% {ok, {_, _, Host, Port, _, _}} = http_uri:parse(Proxy),
156166+%% httpc:set_options([{Scheme, {{Host, Port}, []}}], rebar).
157−
167+
158168 compile(App, FirstFiles) ->
159169 Dir = filename:join(filename:absname("_build/default/lib/"), App),
pkgs/development/tools/build-managers/rebar3/hermetic-rebar3.patch+19−19
@@ -1,8 +1,8 @@
1−diff a/src/rebar3.erl b/src/rebar3.erl
2−index c1a1ae4..1bf1ea0 100644
1+diff --git a/src/rebar3.erl b/src/rebar3.erl
2+index 47dc25a..edda250 100644
33--- a/src/rebar3.erl
44+++ b/src/rebar3.erl
5−@@ -294,9 +294,11 @@ start_and_load_apps(Caller) ->
5+@@ -304,9 +304,11 @@ start_and_load_apps(Caller) ->
66 ensure_running(crypto, Caller),
77 ensure_running(asn1, Caller),
88 ensure_running(public_key, Caller),
@@ -12,16 +12,16 @@ index c1a1ae4..1bf1ea0 100644
1212+ ensure_running(ssl, Caller).
1313+%% Removed due to the hermicity requirements of Nix
1414+%%
15−+%% inets:start(),
16−+%% inets:start(httpc, [{profile, rebar}]).
17−
15++%% inets:start(),
16++%% inets:start(httpc, [{profile, rebar}]).
17+
1818 ensure_running(App, Caller) ->
1919 case application:start(App) of
20−diff a/src/rebar_hermicity.erl b/src/rebar_hermicity.erl
20+diff --git a/src/rebar_hermeticity.erl b/src/rebar_hermeticity.erl
2121new file mode 100644
22−index 0000000..d814e2a
22+index 0000000..8f6cc7d
2323--- /dev/null
24−+++ b/src/rebar_hermicity.erl
24++++ b/src/rebar_hermeticity.erl
2525@@ -0,0 +1,42 @@
2626+%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*-
2727+%% ex: ts=4 sw=4 et
@@ -49,7 +49,7 @@ index 0000000..d814e2a
4949+%% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
5050+%% THE SOFTWARE.
5151+%% -------------------------------------------------------------------
52−+-module(rebar_hermicity).
52++-module(rebar_hermeticity).
5353+
5454+-export([request/5]).
5555+
@@ -63,23 +63,23 @@ index 0000000..d814e2a
6363+ ?ERROR("A request is being made that violates Nix hermicity "
6464+ "This request has been stopped. Details of the request "
6565+ "are as follows:", []),
66−+ ?ERROR("Requesnt: ~p ~s", [Method, Url]),
66++ ?ERROR("Request: ~p ~s", [Method, Url]),
6767+ erlang:halt(1).
68−diff a/src/rebar_pkg_resource.erl b/src/rebar_pkg_resource.erl
69−index ec7e09d..03be343 100644
68+diff --git a/src/rebar_pkg_resource.erl b/src/rebar_pkg_resource.erl
69+index 5817817..2ea1703 100644
7070--- a/src/rebar_pkg_resource.erl
7171+++ b/src/rebar_pkg_resource.erl
72−@@ -104,7 +104,7 @@ make_vsn(_) ->
72+@@ -107,7 +107,7 @@ make_vsn(_) ->
7373 {error, "Replacing version of type pkg not supported."}.
74−
74+
7575 request(Url, ETag) ->
7676- case httpc:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]++[{"User-Agent", rebar_utils:user_agent()}]},
77−+ case rebar_hermicity:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]++[{"User-Agent", rebar_utils:user_agent()}]},
77++ case rebar_hermeticity:request(get, {Url, [{"if-none-match", ETag} || ETag =/= false]++[{"User-Agent", rebar_utils:user_agent()}]},
7878 [{ssl, ssl_opts(Url)}, {relaxed, true}],
7979 [{body_format, binary}],
8080 rebar) of
81−diff a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
82−index 5e1e253..ea25b9e 100644
81+diff --git a/src/rebar_prv_update.erl b/src/rebar_prv_update.erl
82+index 75c609e..4283c23 100644
8383--- a/src/rebar_prv_update.erl
8484+++ b/src/rebar_prv_update.erl
8585@@ -52,7 +52,7 @@ do(State) ->
@@ -87,7 +87,7 @@ index 5e1e253..ea25b9e 100644
8787 {ok, Url} ->
8888 ?DEBUG("Fetching registry from ~p", [Url]),
8989- case httpc:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]},
90−+ case rebar_hermicity:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]},
90++ case rebar_hermeticity:request(get, {Url, [{"User-Agent", rebar_utils:user_agent()}]},
9191 [], [{stream, TmpFile}, {sync, true}],
9292 rebar) of
9393 {ok, saved_to_file} ->