diff --git a/pkgs/development/interpreters/lfe/default.nix b/pkgs/development/interpreters/lfe/default.nix index c7957275f9e7..cafcc4c28ee8 100644 --- a/pkgs/development/interpreters/lfe/default.nix +++ b/pkgs/development/interpreters/lfe/default.nix @@ -1,19 +1,33 @@ -{ stdenv, fetchFromGitHub, erlang, makeWrapper, coreutils, bash }: +{ stdenv, fetchFromGitHub, erlang, makeWrapper, coreutils, bash, beamPackages }: -stdenv.mkDerivation rec { - name = "lfe-${version}"; - version = "1.1.1"; +let + inherit (beamPackages) buildRebar3 buildHex; + proper = buildHex rec { + name = "proper"; + version = "1.1.1-beta"; + sha256 = "0hnkhs761yjynw9382w8wm4j3x0r7lllzavaq2kh9n7qy3zc1rdx"; + + configurePhase = '' + ${erlang}/bin/escript write_compile_flags include/compile_flags.hrl + ''; + }; +in +buildRebar3 rec { + name = "lfe"; + version = "1.2.1"; src = fetchFromGitHub { owner = "rvirding"; - repo = "lfe"; + repo = name; rev = version; - sha256 = "0w1vpjqj8ni43gi84i0mcml4gfaqhmmd9s46di37cngpdw86i3bz"; + sha256 = "0j5gjlsk92y14kxgvd80q9vwyhmjkphpzadcswyjxikgahwg1avz"; }; - buildInputs = [ erlang makeWrapper ]; - - setupHook = ./setup-hook.sh; + buildInputs = [ makeWrapper ]; + beamDeps = [ proper ]; + patches = [ ./no-test-deps.patch ]; + doCheck = true; + checkTarget = "travis"; # These installPhase tricks are based on Elixir's Makefile. # TODO: Make, upload, and apply a patch. @@ -24,7 +38,7 @@ stdenv.mkDerivation rec { rm -Rf $ebindir install -m755 -d $ebindir - install -m644 ebin/* $ebindir + install -m644 _build/default/lib/lfe/ebin/* $ebindir install -m755 -d $bindir for bin in bin/lfe{,c,doc,script}; do install -m755 $bin $bindir; done diff --git a/pkgs/development/interpreters/lfe/no-test-deps.patch b/pkgs/development/interpreters/lfe/no-test-deps.patch new file mode 100644 index 000000000000..8c3faf1ff402 --- /dev/null +++ b/pkgs/development/interpreters/lfe/no-test-deps.patch @@ -0,0 +1,13 @@ +diff --git a/rebar.config b/rebar.config +index 1d5a68e..ca33be7 100644 +--- a/rebar.config ++++ b/rebar.config +@@ -2,7 +2,7 @@ + + {erl_opts, [debug_info]}. + +-{profiles, [{test, [{deps, [proper]}]}]}. ++%% {profiles, [{test, [{deps, [proper]}]}]}. + + {pre_hooks, [{"(linux|darwin|solaris|freebsd|netbsd|openbsd)", ct, + "bin/lfe bin/lfec" diff --git a/pkgs/development/interpreters/lfe/setup-hook.sh b/pkgs/development/interpreters/lfe/setup-hook.sh deleted file mode 100644 index 2405dcea15f3..000000000000 --- a/pkgs/development/interpreters/lfe/setup-hook.sh +++ /dev/null @@ -1,5 +0,0 @@ -addLfeLibPath() { - addToSearchPath ERL_LIBS $1/lib/lfe/lib -} - -envHooks+=(addLfeLibPath)