From 9d58f894cdd8cb606078b2b434662fb229cc4fd4 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Tue, 12 Jul 2016 06:48:33 -0500 Subject: [PATCH] lfe: init at 1.1.1 (#16865) This is a first pass at adding an LFE package. N.B. man pages are ignored for now. --- lib/maintainers.nix | 1 + pkgs/development/interpreters/lfe/default.nix | 62 +++++++++++++++++++ .../interpreters/lfe/setup-hook.sh | 5 ++ pkgs/top-level/all-packages.nix | 4 +- 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/interpreters/lfe/default.nix create mode 100644 pkgs/development/interpreters/lfe/setup-hook.sh diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 3e4229bf4414..ae06c524bde5 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -422,6 +422,7 @@ wscott = "Wayne Scott "; wyvie = "Elijah Rum "; yarr = "Dmitry V. "; + yurrriq = "Eric Bailey "; z77z = "Marco Maggesi "; zagy = "Christian Zagrodnick "; zef = "Zef Hemel "; diff --git a/pkgs/development/interpreters/lfe/default.nix b/pkgs/development/interpreters/lfe/default.nix new file mode 100644 index 000000000000..f3a54aef8ab1 --- /dev/null +++ b/pkgs/development/interpreters/lfe/default.nix @@ -0,0 +1,62 @@ +{ stdenv, fetchFromGitHub, erlang, makeWrapper, coreutils, bash }: + +stdenv.mkDerivation rec { + name = "lfe-${version}"; + version = "1.1.1"; + + src = fetchFromGitHub { + owner = "rvirding"; + repo = "lfe"; + rev = version; + sha256 = "0w1vpjqj8ni43gi84i0mcml4gfaqhmmd9s46di37cngpdw86i3bz"; + }; + + buildInputs = [ erlang makeWrapper ]; + + setupHook = ./setup-hook.sh; + + # These installPhase tricks are based on Elixir's Makefile. + # TODO: Make, upload, and apply a patch. + installPhase = '' + local libdir=$out/lib/lfe + local ebindir=$libdir/ebin + local bindir=$libdir/bin + + rm -Rf $ebindir + install -m755 -d $ebindir + install -m644 ebin/* $ebindir + + install -m755 -d $bindir + for bin in bin/lfe{,c,doc,script}; do install -m755 $bin $bindir; done + + install -m755 -d $out/bin + for file in $bindir/*; do ln -sf $file $out/bin/; done + ''; + + # Thanks again, Elixir. + postFixup = '' + # LFE binaries are shell scripts which run erl and lfe. + # Add some stuff to PATH so the scripts can run without problems. + for f in $out/bin/*; do + wrapProgram $f \ + --prefix PATH ":" "${erlang}/bin:${coreutils}/bin:${bash}/bin:$out/bin" + substituteInPlace $f --replace "/usr/bin/env" "${coreutils}/bin/env" + done + ''; + + meta = with stdenv.lib; { + description = "The best of Erlang and of Lisp; at the same time!"; + longDescription = '' + LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang + compiler. Code produced with it is compatible with "normal" Erlang + code. An LFE evaluator and shell is also included. + ''; + + homepage = "http://lfe.io"; + downloadPage = "https://github.com/rvirding/lfe/releases"; + + license = licenses.asl20; + maintainers = with maintainers; [ yurrriq ]; + platforms = platforms.unix; + }; +} diff --git a/pkgs/development/interpreters/lfe/setup-hook.sh b/pkgs/development/interpreters/lfe/setup-hook.sh new file mode 100644 index 000000000000..2405dcea15f3 --- /dev/null +++ b/pkgs/development/interpreters/lfe/setup-hook.sh @@ -0,0 +1,5 @@ +addLfeLibPath() { + addToSearchPath ERL_LIBS $1/lib/lfe/lib +} + +envHooks+=(addLfeLibPath) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 2909258a72b3..f2ea7a07ca6d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2366,7 +2366,7 @@ in libqmi = callPackage ../development/libraries/libqmi { }; libqrencode = callPackage ../development/libraries/libqrencode { }; - + libmbim = callPackage ../development/libraries/libmbim { }; libmongo-client = callPackage ../development/libraries/libmongo-client { }; @@ -5651,6 +5651,8 @@ in elixir = callPackage ../development/interpreters/elixir { debugInfo = true; }; + lfe = callPackage ../development/interpreters/lfe { }; + groovy = callPackage ../development/interpreters/groovy { }; guile_1_8 = callPackage ../development/interpreters/guile/1.8.nix { };