aboutsummaryrefslogtreecommitdiffstats
path: root/core/deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-10-25 20:26:26 +0300
committerLoïc Hoguin <[email protected]>2016-10-25 20:26:26 +0300
commit503be6d23babf96e6db0382c450967ec8883b285 (patch)
treec77734ea1f2c9ba134207ae126bae28c529a691c /core/deps.mk
parented4665f9ab890ac8e2b0a339d685519840ddee5e (diff)
downloaderlang.mk-503be6d23babf96e6db0382c450967ec8883b285.tar.gz
erlang.mk-503be6d23babf96e6db0382c450967ec8883b285.tar.bz2
erlang.mk-503be6d23babf96e6db0382c450967ec8883b285.zip
Use curl to fetch Hex dependencies
Diffstat (limited to 'core/deps.mk')
-rw-r--r--core/deps.mk17
1 files changed, 4 insertions, 13 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 2207592..8ad96a8 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -498,21 +498,12 @@ define dep_fetch_cp
cp -R $(call dep_repo,$(1)) $(DEPS_DIR)/$(call dep_name,$(1));
endef
-define dep_fetch_hex.erl
- ssl:start(),
- inets:start(),
- {ok, {{_, 200, _}, _, Body}} = httpc:request(get,
- {"https://s3.amazonaws.com/s3.hex.pm/tarballs/$(1)-$(2).tar", []},
- [], [{body_format, binary}]),
- {ok, Files} = erl_tar:extract({binary, Body}, [memory]),
- {_, Source} = lists:keyfind("contents.tar.gz", 1, Files),
- ok = erl_tar:extract({binary, Source}, [{cwd, "$(call core_native_path,$(DEPS_DIR)/$1)"}, compressed]),
- halt()
-endef
-
# Hex only has a package version. No need to look in the Erlang.mk packages.
define dep_fetch_hex
- $(call erlang,$(call dep_fetch_hex.erl,$(1),$(strip $(word 2,$(dep_$(1))))));
+ mkdir -p $(ERLANG_MK_TMP)/hex $(DEPS_DIR)/$1; \
+ $(call core_http_get,$(ERLANG_MK_TMP)/hex/$1.tar,\
+ https://s3.amazonaws.com/s3.hex.pm/tarballs/$1-$(strip $(word 2,$(dep_$1))).tar); \
+ tar -xOf $(ERLANG_MK_TMP)/hex/$1.tar contents.tar.gz | tar -C $(DEPS_DIR)/$1 -xz;
endef
define dep_fetch_fail