erlang-ls: use rebar3Relx

This commit is contained in:
David
2021-05-21 17:24:45 +09:00
committed by Raphael Megzari
parent 72795f8c0b
commit 049ecc9716
2 changed files with 140 additions and 68 deletions
@@ -1,25 +1,23 @@
{ fetchFromGitHub, fetchHex, stdenv, erlang, rebar3WithPlugins, lib }:
{ fetchFromGitHub, fetchHex, rebar3Relx, buildRebar3, lib }:
let
version = "0.15.0";
owner = "erlang-ls";
repo = "erlang_ls";
deps = import ./rebar-deps.nix { inherit fetchHex fetchFromGitHub; };
in stdenv.mkDerivation {
deps = import ./rebar-deps.nix {
inherit fetchHex fetchFromGitHub;
builder = buildRebar3;
};
in rebar3Relx {
name = "erlang-ls";
inherit version;
pname = "erlang-ls";
buildInputs = [ erlang (rebar3WithPlugins { }) ];
src = fetchFromGitHub {
inherit owner repo;
sha256 = "1s6zk8r5plm7ajifz17mvfrnk5mzbhj7alayink9phqbmzrypnfg";
rev = version;
};
buildPhase = ''
mkdir _checkouts
${toString (lib.mapAttrsToList (k: v: ''
cp -R ${v} _checkouts/${k}
'') deps)}
make
'';
releaseType = "escript";
beamDeps = builtins.attrValues deps;
buildPhase = "HOME=. make";
installPhase = ''
mkdir -p $out/bin
cp _build/default/bin/erlang_ls $out/bin/