summary refs log tree commit diff
path: root/pkgs/development/beam-modules/fetch-rebar-deps.nix
diff options
context:
space:
mode:
authork32 <10274441+k32@users.noreply.github.com>2019-01-16 22:51:19 +0100
committerk32 <10274441+k32@users.noreply.github.com>2019-02-06 19:45:40 +0100
commitd4b243905f2181111b52d5a58b2119469ed689fc (patch)
tree895379986d9b69a9cfcbb503c92bf040908da34a /pkgs/development/beam-modules/fetch-rebar-deps.nix
parented5ec8b375e6a2b254c6110ff5124b3a95e019d7 (diff)
downloadnixpkgs-d4b243905f2181111b52d5a58b2119469ed689fc.tar
nixpkgs-d4b243905f2181111b52d5a58b2119469ed689fc.tar.gz
nixpkgs-d4b243905f2181111b52d5a58b2119469ed689fc.tar.bz2
nixpkgs-d4b243905f2181111b52d5a58b2119469ed689fc.tar.lz
nixpkgs-d4b243905f2181111b52d5a58b2119469ed689fc.tar.xz
nixpkgs-d4b243905f2181111b52d5a58b2119469ed689fc.tar.zst
nixpkgs-d4b243905f2181111b52d5a58b2119469ed689fc.zip
rebar3: 3.6.1 -> 3.9.0
Remove hermetic patch (make it compatible with the upstream)
(Mostly) eliminate the need for hex package registry
Diffstat (limited to 'pkgs/development/beam-modules/fetch-rebar-deps.nix')
-rw-r--r--pkgs/development/beam-modules/fetch-rebar-deps.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/pkgs/development/beam-modules/fetch-rebar-deps.nix b/pkgs/development/beam-modules/fetch-rebar-deps.nix
new file mode 100644
index 00000000000..a94d803f0d3
--- /dev/null
+++ b/pkgs/development/beam-modules/fetch-rebar-deps.nix
@@ -0,0 +1,32 @@
+{ stdenv, rebar3, curl }:
+
+{ name, version, sha256, src
+, meta ? {}
+}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation ({
+  name = "rebar-deps-${name}-${version}";
+
+  phases = [ "downloadPhase" "installPhase" ];
+
+  downloadPhase = ''
+    cp ${src} .
+    HOME='.' DEBUG=1 ${rebar3}/bin/rebar3 get-deps
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/_checkouts"
+    for i in ./_build/default/lib/* ; do
+       echo "$i"
+       cp -R "$i" "$out/_checkouts"
+    done
+  '';
+
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash = sha256;
+
+  impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
+})