2016-05-06 02:14:40 -07:00
|
|
|
{ stdenv, fetchFromGitHub, erlang, rebar, makeWrapper, coreutils, curl, bash,
|
2016-03-30 10:19:55 -07:00
|
|
|
debugInfo ? false }:
|
2013-08-07 07:06:11 -07:00
|
|
|
|
2016-01-12 05:53:31 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2013-11-29 08:00:04 -08:00
|
|
|
name = "elixir-${version}";
|
2017-03-07 02:20:24 -08:00
|
|
|
version = "1.4.2";
|
2013-08-07 07:06:11 -07:00
|
|
|
|
2016-05-06 02:14:40 -07:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "elixir-lang";
|
|
|
|
repo = "elixir";
|
|
|
|
rev = "v${version}";
|
2017-03-07 02:20:24 -08:00
|
|
|
sha256 = "0jqww3l5jgqvlqpp6lh8i55v23a5imw4giarr05gsl7imv2qqshz";
|
2013-08-07 07:06:11 -07:00
|
|
|
};
|
|
|
|
|
2013-08-25 17:44:54 -07:00
|
|
|
buildInputs = [ erlang rebar makeWrapper ];
|
2013-08-07 07:06:11 -07:00
|
|
|
|
2016-01-12 05:53:31 -08:00
|
|
|
# Elixir expects that UTF-8 locale to be set (see https://github.com/elixir-lang/elixir/issues/3548).
|
|
|
|
# In other cases there is warnings during compilation.
|
|
|
|
LANG = "en_US.UTF-8";
|
|
|
|
LC_TYPE = "en_US.UTF-8";
|
|
|
|
|
2016-04-01 13:13:02 -07:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2016-06-15 07:15:06 -07:00
|
|
|
inherit debugInfo;
|
|
|
|
|
2016-03-30 10:19:55 -07:00
|
|
|
buildFlags = if debugInfo
|
|
|
|
then "ERL_COMPILER_OPTIONS=debug_info"
|
|
|
|
else "";
|
|
|
|
|
2013-08-07 07:06:11 -07:00
|
|
|
preBuild = ''
|
2014-02-08 10:05:31 -08:00
|
|
|
# The build process uses ./rebar. Link it to the nixpkgs rebar
|
|
|
|
rm -v rebar
|
|
|
|
ln -s ${rebar}/bin/rebar rebar
|
|
|
|
|
2013-08-07 07:06:11 -07:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "/usr/local" $out
|
|
|
|
'';
|
2013-08-07 07:09:08 -07:00
|
|
|
|
2013-08-25 17:44:54 -07:00
|
|
|
postFixup = ''
|
2014-02-08 10:05:31 -08:00
|
|
|
# Elixir binaries are shell scripts which run erl. Add some stuff
|
|
|
|
# to PATH so the scripts can run without problems.
|
2013-08-25 17:44:54 -07:00
|
|
|
|
2014-10-11 07:49:05 -07:00
|
|
|
for f in $out/bin/*; do
|
|
|
|
b=$(basename $f)
|
|
|
|
if [ $b == "mix" ]; then continue; fi
|
2013-08-25 17:44:54 -07:00
|
|
|
wrapProgram $f \
|
2016-08-22 15:06:51 -07:00
|
|
|
--prefix PATH ":" "${stdenv.lib.makeBinPath [ erlang coreutils curl bash ]}" \
|
2015-07-30 16:30:15 -07:00
|
|
|
--set CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
|
2013-08-25 17:44:54 -07:00
|
|
|
done
|
2015-09-05 20:33:01 -07:00
|
|
|
|
|
|
|
substituteInPlace $out/bin/mix \
|
2015-09-28 13:38:16 -07:00
|
|
|
--replace "/usr/bin/env elixir" "${coreutils}/bin/env elixir"
|
2013-08-25 17:44:54 -07:00
|
|
|
'';
|
|
|
|
|
2013-09-26 12:37:49 -07:00
|
|
|
meta = with stdenv.lib; {
|
2013-08-07 07:09:08 -07:00
|
|
|
homepage = "http://elixir-lang.org/";
|
2013-09-26 12:37:49 -07:00
|
|
|
description = "A functional, meta-programming aware language built on top of the Erlang VM";
|
2013-08-07 07:09:08 -07:00
|
|
|
|
|
|
|
longDescription = ''
|
2013-11-29 08:00:04 -08:00
|
|
|
Elixir is a functional, meta-programming aware language built on
|
|
|
|
top of the Erlang VM. It is a dynamic language with flexible
|
|
|
|
syntax and macro support that leverages Erlang's abilities to
|
|
|
|
build concurrent, distributed and fault-tolerant applications
|
|
|
|
with hot code upgrades.
|
2013-08-07 07:09:08 -07:00
|
|
|
'';
|
|
|
|
|
2013-09-26 12:37:49 -07:00
|
|
|
license = licenses.epl10;
|
2014-09-03 12:14:57 -07:00
|
|
|
platforms = platforms.unix;
|
2016-01-12 05:53:31 -08:00
|
|
|
maintainers = with maintainers; [ the-kenny havvy couchemar ];
|
2013-08-07 07:09:08 -07:00
|
|
|
};
|
2013-08-07 07:06:11 -07:00
|
|
|
}
|