From 45e975abff596d87e0d58fe919e48eac17982bad Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Mon, 26 Aug 2013 02:43:12 +0200 Subject: [PATCH 1/2] Wrap Erlang scripts to provide missing 'sed' and 'awk'. Signed-off-by: Moritz Ulrich --- pkgs/development/interpreters/erlang/R14B04.nix | 11 +++++++++-- pkgs/development/interpreters/erlang/R15B03.nix | 8 ++++++++ pkgs/development/interpreters/erlang/R16B01.nix | 9 ++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/pkgs/development/interpreters/erlang/R14B04.nix b/pkgs/development/interpreters/erlang/R14B04.nix index 1d5c9ae3d39..4dd32cd806c 100644 --- a/pkgs/development/interpreters/erlang/R14B04.nix +++ b/pkgs/development/interpreters/erlang/R14B04.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, perl, gnum4, ncurses, openssl }: +{ stdenv, fetchurl, perl, gnum4, ncurses, openssl +, makeWrapper, gnused, gawk }: let version = "14B04"; in @@ -10,7 +11,7 @@ stdenv.mkDerivation { sha256 = "0vlvjlg8vzcy6inb4vj00bnj0aarvpchzxwhmi492nv31s8kb6q9"; }; - buildInputs = [ perl gnum4 ncurses openssl ]; + buildInputs = [ perl gnum4 ncurses openssl makeWrapper ]; patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure ''; @@ -21,6 +22,12 @@ stdenv.mkDerivation { configureFlags = "--with-ssl=${openssl}"; + # Some erlang bin/ scripts run sed and awk + postFixup = '' + wrapProgram $out/lib/erlang/bin/erl --prefix PATH ":" "${gnused}/bin/" + wrapProgram $out/lib/erlang/bin/start_erl --prefix PATH ":" "${gnused}/bin/:${gawk}/bin" + ''; + meta = { homepage = "http://www.erlang.org/"; description = "Programming language used for massively scalable soft real-time systems"; diff --git a/pkgs/development/interpreters/erlang/R15B03.nix b/pkgs/development/interpreters/erlang/R15B03.nix index d282e45dc62..e0760db9f58 100644 --- a/pkgs/development/interpreters/erlang/R15B03.nix +++ b/pkgs/development/interpreters/erlang/R15B03.nix @@ -1,4 +1,5 @@ { stdenv, fetchurl, perl, gnum4, ncurses, openssl +, makeWrapper, gnused, gawk , wxSupport ? false, mesa ? null, wxGTK ? null, xlibs ? null }: assert wxSupport -> mesa != null && wxGTK != null && xlibs != null; @@ -15,6 +16,7 @@ stdenv.mkDerivation { buildInputs = [ perl gnum4 ncurses openssl + makeWrapper ] ++ stdenv.lib.optional wxSupport [ mesa wxGTK xlibs.libX11 ]; patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure ''; @@ -26,6 +28,12 @@ stdenv.mkDerivation { configureFlags = "--with-ssl=${openssl}"; + # Some erlang bin/ scripts run sed and awk + postFixup = '' + wrapProgram $out/lib/erlang/bin/erl --prefix PATH ":" "${gnused}/bin/" + wrapProgram $out/lib/erlang/bin/start_erl --prefix PATH ":" "${gnused}/bin/:${gawk}/bin" + ''; + meta = { homepage = "http://www.erlang.org/"; description = "Programming language used for massively scalable soft real-time systems"; diff --git a/pkgs/development/interpreters/erlang/R16B01.nix b/pkgs/development/interpreters/erlang/R16B01.nix index 902af75d494..168db4484b1 100644 --- a/pkgs/development/interpreters/erlang/R16B01.nix +++ b/pkgs/development/interpreters/erlang/R16B01.nix @@ -1,4 +1,5 @@ { stdenv, fetchurl, perl, gnum4, ncurses, openssl +, gnused, gawk, makeWrapper , wxSupport ? false, mesa ? null, wxGTK ? null, xlibs ? null }: assert wxSupport -> mesa != null && wxGTK != null && xlibs != null; @@ -14,7 +15,7 @@ stdenv.mkDerivation { }; buildInputs = - [ perl gnum4 ncurses openssl + [ perl gnum4 ncurses openssl makeWrapper ] ++ stdenv.lib.optional wxSupport [ mesa wxGTK xlibs.libX11 ]; patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure ''; @@ -26,6 +27,12 @@ stdenv.mkDerivation { configureFlags = "--with-ssl=${openssl}"; + # Some erlang bin/ scripts run sed and awk + postFixup = '' + wrapProgram $out/lib/erlang/bin/erl --prefix PATH ":" "${gnused}/bin/" + wrapProgram $out/lib/erlang/bin/start_erl --prefix PATH ":" "${gnused}/bin/:${gawk}/bin" + ''; + meta = { homepage = "http://www.erlang.org/"; description = "Programming language used for massively scalable soft real-time systems"; From e46fc8843c40e861ba740188189c9f5d5763b16c Mon Sep 17 00:00:00 2001 From: Moritz Ulrich Date: Mon, 26 Aug 2013 02:44:54 +0200 Subject: [PATCH 2/2] 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 --- pkgs/development/interpreters/elixir/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/elixir/default.nix b/pkgs/development/interpreters/elixir/default.nix index ffa4402a72a..3ac2368342d 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.";