summary refs log tree commit diff
path: root/pkgs/development/interpreters/elixir
diff options
context:
space:
mode:
authorMoritz Ulrich <moritz@tarn-vedra.de>2013-08-26 02:44:54 +0200
committerMoritz Ulrich <moritz@tarn-vedra.de>2013-08-26 02:44:54 +0200
commite46fc8843c40e861ba740188189c9f5d5763b16c (patch)
treebafa3177eba4cf37e2ae056e3fb3f8eea16dd189 /pkgs/development/interpreters/elixir
parent45e975abff596d87e0d58fe919e48eac17982bad (diff)
downloadnixlib-e46fc8843c40e861ba740188189c9f5d5763b16c.tar
nixlib-e46fc8843c40e861ba740188189c9f5d5763b16c.tar.gz
nixlib-e46fc8843c40e861ba740188189c9f5d5763b16c.tar.bz2
nixlib-e46fc8843c40e861ba740188189c9f5d5763b16c.tar.lz
nixlib-e46fc8843c40e861ba740188189c9f5d5763b16c.tar.xz
nixlib-e46fc8843c40e861ba740188189c9f5d5763b16c.tar.zst
nixlib-e46fc8843c40e861ba740188189c9f5d5763b16c.zip
Elixir: Fix impurity with Erlang.
The bash scripts of elixir contain some references to `erl'. This
patch wraps the scripts and extends PATH so `erl' is available.

Signed-off-by: Moritz Ulrich <moritz@tarn-vedra.de>
Diffstat (limited to 'pkgs/development/interpreters/elixir')
-rw-r--r--pkgs/development/interpreters/elixir/default.nix15
1 files changed, 13 insertions, 2 deletions
diff --git a/pkgs/development/interpreters/elixir/default.nix b/pkgs/development/interpreters/elixir/default.nix
index ffa4402a72a7..3ac2368342da 100644
--- a/pkgs/development/interpreters/elixir/default.nix
+++ b/pkgs/development/interpreters/elixir/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, erlang, rebar }:
+{ stdenv, fetchurl, erlang, rebar, makeWrapper, coreutils }:
 
 stdenv.mkDerivation {
   name = "elixir-0.10.1";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "0gfr2bz3mw7ag9z2wb2g22n2vlyrp8dwy78fj9zi52kzl5w3vc3w";
   };
 
-  buildInputs = [ erlang rebar ];
+  buildInputs = [ erlang rebar makeWrapper ];
 
   preBuild = ''
     substituteInPlace rebar \
@@ -18,6 +18,17 @@ stdenv.mkDerivation {
       --replace "/usr/local" $out
   '';
 
+  postFixup = ''
+    # Elixirs binaries are shell scripts which run erl. This adds some
+    # stuff to PATH so the scripts run without problems.
+
+    for f in $out/bin/*
+    do
+      wrapProgram $f \
+      --prefix PATH ":" "${erlang}/bin:${coreutils}/bin"
+    done
+  '';
+
   meta = {
     homepage = "http://elixir-lang.org/";
     description = "Elixir is a functional, meta-programming aware language built on top of the Erlang VM.";