nixpkgs/pkgs/development/interpreters/elixir/default.nix

57 lines
1.7 KiB
Nix
Raw Normal View History

2014-09-27 21:58:58 +02:00
{ stdenv, fetchurl, erlang, rebar, makeWrapper, coreutils, curl, bash, cacert }:
let
2015-04-09 09:10:35 +02:00
version = "1.0.4";
in
stdenv.mkDerivation {
name = "elixir-${version}";
src = fetchurl {
url = "https://github.com/elixir-lang/elixir/archive/v${version}.tar.gz";
2015-04-09 09:10:35 +02:00
sha256 = "1babp3ff6hajdm247zl9rc311k973cdnv6dqaai7l8817gg1yd3r";
};
buildInputs = [ erlang rebar makeWrapper ];
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
substituteInPlace Makefile \
--replace "/usr/local" $out
2014-10-01 20:27:55 +02:00
substituteInPlace bin/mix \
2014-09-27 21:58:58 +02:00
--replace "/usr/bin/env elixir" "$out/bin/elixir"
'';
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.
for f in $out/bin/*; do
b=$(basename $f)
if [ $b == "mix" ]; then continue; fi
wrapProgram $f \
2014-09-27 21:58:58 +02:00
--prefix PATH ":" "${erlang}/bin:${coreutils}/bin:${curl}/bin:${bash}/bin" \
2015-05-29 23:03:34 +02:00
--set CURL_CA_BUNDLE "${cacert}/ca-bundle.crt"
done
'';
meta = with stdenv.lib; {
homepage = "http://elixir-lang.org/";
description = "A functional, meta-programming aware language built on top of the Erlang VM";
longDescription = ''
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.
'';
license = licenses.epl10;
platforms = platforms.unix;
maintainers = [ maintainers.the-kenny ];
};
}