2015-07-31 01:30:15 +02:00
|
|
|
{ stdenv, fetchurl, erlang, rebar, makeWrapper, coreutils, curl, bash }:
|
2013-08-07 16:06:11 +02:00
|
|
|
|
2013-11-29 17:00:04 +01:00
|
|
|
let
|
2015-09-28 22:38:16 +02:00
|
|
|
version = "1.1.1";
|
2013-11-29 17:00:04 +01:00
|
|
|
in
|
2013-08-07 16:06:11 +02:00
|
|
|
stdenv.mkDerivation {
|
2013-11-29 17:00:04 +01:00
|
|
|
name = "elixir-${version}";
|
2013-08-07 16:06:11 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-11-29 17:00:04 +01:00
|
|
|
url = "https://github.com/elixir-lang/elixir/archive/v${version}.tar.gz";
|
2015-09-28 22:38:16 +02:00
|
|
|
sha256 = "0shh5brhcrvbvhl4bw0fs2y5llw7i97khkkglygx30ncvd7nwz9v";
|
2013-08-07 16:06:11 +02:00
|
|
|
};
|
|
|
|
|
2013-08-26 02:44:54 +02:00
|
|
|
buildInputs = [ erlang rebar makeWrapper ];
|
2013-08-07 16:06:11 +02:00
|
|
|
|
|
|
|
preBuild = ''
|
2014-02-08 19:05:31 +01:00
|
|
|
# The build process uses ./rebar. Link it to the nixpkgs rebar
|
|
|
|
rm -v rebar
|
|
|
|
ln -s ${rebar}/bin/rebar rebar
|
|
|
|
|
2013-08-07 16:06:11 +02:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "/usr/local" $out
|
|
|
|
'';
|
2013-08-07 16:09:08 +02:00
|
|
|
|
2013-08-26 02:44:54 +02:00
|
|
|
postFixup = ''
|
2014-02-08 19:05:31 +01:00
|
|
|
# Elixir binaries are shell scripts which run erl. Add some stuff
|
|
|
|
# to PATH so the scripts can run without problems.
|
2013-08-26 02:44:54 +02:00
|
|
|
|
2014-10-11 16:49:05 +02:00
|
|
|
for f in $out/bin/*; do
|
|
|
|
b=$(basename $f)
|
|
|
|
if [ $b == "mix" ]; then continue; fi
|
2013-08-26 02:44:54 +02:00
|
|
|
wrapProgram $f \
|
2015-07-31 01:30:15 +02:00
|
|
|
--prefix PATH ":" "${erlang}/bin:${coreutils}/bin:${curl}/bin:${bash}/bin" \
|
|
|
|
--set CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
|
2013-08-26 02:44:54 +02:00
|
|
|
done
|
2015-09-06 05:33:01 +02:00
|
|
|
|
|
|
|
substituteInPlace $out/bin/mix \
|
2015-09-28 22:38:16 +02:00
|
|
|
--replace "/usr/bin/env elixir" "${coreutils}/bin/env elixir"
|
2013-08-26 02:44:54 +02:00
|
|
|
'';
|
|
|
|
|
2013-09-26 21:37:49 +02:00
|
|
|
meta = with stdenv.lib; {
|
2013-08-07 16:09:08 +02:00
|
|
|
homepage = "http://elixir-lang.org/";
|
2013-09-26 21:37:49 +02:00
|
|
|
description = "A functional, meta-programming aware language built on top of the Erlang VM";
|
2013-08-07 16:09:08 +02:00
|
|
|
|
|
|
|
longDescription = ''
|
2013-11-29 17:00:04 +01: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 16:09:08 +02:00
|
|
|
'';
|
|
|
|
|
2013-09-26 21:37:49 +02:00
|
|
|
license = licenses.epl10;
|
2014-09-03 21:14:57 +02:00
|
|
|
platforms = platforms.unix;
|
2015-09-28 22:38:16 +02:00
|
|
|
maintainers = [ maintainers.the-kenny maintainers.havvy ];
|
2013-08-07 16:09:08 +02:00
|
|
|
};
|
2013-08-07 16:06:11 +02:00
|
|
|
}
|