Merge pull request #865 from the-kenny/fix-erlang-elixir

Fix purity of Elixir and Erlang
This commit is contained in:
Evgeny Egorochkin 2013-08-26 00:17:48 -07:00
commit f4666120ac
4 changed files with 38 additions and 5 deletions

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, erlang, rebar }: { stdenv, fetchurl, erlang, rebar, makeWrapper, coreutils }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "elixir-0.10.1"; name = "elixir-0.10.1";
@ -8,7 +8,7 @@ stdenv.mkDerivation {
sha256 = "0gfr2bz3mw7ag9z2wb2g22n2vlyrp8dwy78fj9zi52kzl5w3vc3w"; sha256 = "0gfr2bz3mw7ag9z2wb2g22n2vlyrp8dwy78fj9zi52kzl5w3vc3w";
}; };
buildInputs = [ erlang rebar ]; buildInputs = [ erlang rebar makeWrapper ];
preBuild = '' preBuild = ''
substituteInPlace rebar \ substituteInPlace rebar \
@ -18,6 +18,17 @@ stdenv.mkDerivation {
--replace "/usr/local" $out --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 = { meta = {
homepage = "http://elixir-lang.org/"; homepage = "http://elixir-lang.org/";
description = "Elixir is a functional, meta-programming aware language built on top of the Erlang VM."; description = "Elixir is a functional, meta-programming aware language built on top of the Erlang VM.";

View file

@ -1,4 +1,5 @@
{ stdenv, fetchurl, perl, gnum4, ncurses, openssl }: { stdenv, fetchurl, perl, gnum4, ncurses, openssl
, makeWrapper, gnused, gawk }:
let version = "14B04"; in let version = "14B04"; in
@ -10,7 +11,7 @@ stdenv.mkDerivation {
sha256 = "0vlvjlg8vzcy6inb4vj00bnj0aarvpchzxwhmi492nv31s8kb6q9"; 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 ''; patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure '';
@ -21,6 +22,12 @@ stdenv.mkDerivation {
configureFlags = "--with-ssl=${openssl}"; 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 = { meta = {
homepage = "http://www.erlang.org/"; homepage = "http://www.erlang.org/";
description = "Programming language used for massively scalable soft real-time systems"; description = "Programming language used for massively scalable soft real-time systems";

View file

@ -1,4 +1,5 @@
{ stdenv, fetchurl, perl, gnum4, ncurses, openssl { stdenv, fetchurl, perl, gnum4, ncurses, openssl
, makeWrapper, gnused, gawk
, wxSupport ? false, mesa ? null, wxGTK ? null, xlibs ? null }: , wxSupport ? false, mesa ? null, wxGTK ? null, xlibs ? null }:
assert wxSupport -> mesa != null && wxGTK != null && xlibs != null; assert wxSupport -> mesa != null && wxGTK != null && xlibs != null;
@ -15,6 +16,7 @@ stdenv.mkDerivation {
buildInputs = buildInputs =
[ perl gnum4 ncurses openssl [ perl gnum4 ncurses openssl
makeWrapper
] ++ stdenv.lib.optional wxSupport [ mesa wxGTK xlibs.libX11 ]; ] ++ stdenv.lib.optional wxSupport [ mesa wxGTK xlibs.libX11 ];
patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure ''; patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure '';
@ -26,6 +28,12 @@ stdenv.mkDerivation {
configureFlags = "--with-ssl=${openssl}"; 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 = { meta = {
homepage = "http://www.erlang.org/"; homepage = "http://www.erlang.org/";
description = "Programming language used for massively scalable soft real-time systems"; description = "Programming language used for massively scalable soft real-time systems";

View file

@ -1,4 +1,5 @@
{ stdenv, fetchurl, perl, gnum4, ncurses, openssl { stdenv, fetchurl, perl, gnum4, ncurses, openssl
, gnused, gawk, makeWrapper
, wxSupport ? false, mesa ? null, wxGTK ? null, xlibs ? null }: , wxSupport ? false, mesa ? null, wxGTK ? null, xlibs ? null }:
assert wxSupport -> mesa != null && wxGTK != null && xlibs != null; assert wxSupport -> mesa != null && wxGTK != null && xlibs != null;
@ -14,7 +15,7 @@ stdenv.mkDerivation {
}; };
buildInputs = buildInputs =
[ perl gnum4 ncurses openssl [ perl gnum4 ncurses openssl makeWrapper
] ++ stdenv.lib.optional wxSupport [ mesa wxGTK xlibs.libX11 ]; ] ++ stdenv.lib.optional wxSupport [ mesa wxGTK xlibs.libX11 ];
patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure ''; patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure '';
@ -26,6 +27,12 @@ stdenv.mkDerivation {
configureFlags = "--with-ssl=${openssl}"; 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 = { meta = {
homepage = "http://www.erlang.org/"; homepage = "http://www.erlang.org/";
description = "Programming language used for massively scalable soft real-time systems"; description = "Programming language used for massively scalable soft real-time systems";