2021-06-28 23:13:55 +00:00
|
|
|
{ fetchFromGitHub, fetchHex, rebar3Relx, buildRebar3, rebar3-proper, lib }:
|
2021-05-20 23:08:51 +00:00
|
|
|
let
|
2021-06-28 23:13:55 +00:00
|
|
|
version = "0.17.0";
|
2021-05-20 23:08:51 +00:00
|
|
|
owner = "erlang-ls";
|
|
|
|
repo = "erlang_ls";
|
2021-05-28 09:39:13 +00:00
|
|
|
deps = import ./rebar-deps.nix {
|
|
|
|
inherit fetchHex fetchFromGitHub;
|
|
|
|
builder = buildRebar3;
|
2021-06-28 23:13:55 +00:00
|
|
|
overrides = (self: super: {
|
|
|
|
proper = super.proper.overrideAttrs (_: {
|
|
|
|
configurePhase = "true";
|
|
|
|
});
|
|
|
|
});
|
2021-05-28 09:39:13 +00:00
|
|
|
};
|
2021-07-14 22:03:04 +00:00
|
|
|
in
|
|
|
|
rebar3Relx {
|
|
|
|
pname = "erlang-ls";
|
2021-05-20 23:08:51 +00:00
|
|
|
inherit version;
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
inherit owner repo;
|
2021-06-28 23:13:55 +00:00
|
|
|
sha256 = "0szg9hx436cvy80sh94dzmf2rainnw3fjc84bv3hlzjwwzmxj9aw";
|
2021-05-20 23:08:51 +00:00
|
|
|
rev = version;
|
|
|
|
};
|
2021-05-28 09:39:13 +00:00
|
|
|
releaseType = "escript";
|
|
|
|
beamDeps = builtins.attrValues deps;
|
2021-06-28 23:13:55 +00:00
|
|
|
buildPlugins = [ rebar3-proper ];
|
2021-05-28 09:39:13 +00:00
|
|
|
buildPhase = "HOME=. make";
|
2021-06-28 23:13:55 +00:00
|
|
|
# based on https://github.com/erlang-ls/erlang_ls/blob/main/.github/workflows/build.yml
|
|
|
|
# these tests are excessively long and we should probably skip them
|
|
|
|
checkPhase = ''
|
|
|
|
HOME=. epmd -daemon
|
|
|
|
HOME=. rebar3 ct
|
|
|
|
HOME=. rebar3 proper --constraint_tries 100
|
|
|
|
'';
|
|
|
|
doCheck = true;
|
2021-05-20 23:08:51 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp _build/default/bin/erlang_ls $out/bin/
|
|
|
|
cp _build/dap/bin/els_dap $out/bin/
|
|
|
|
'';
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/erlang-ls/erlang_ls";
|
|
|
|
description = "The Erlang Language Server";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
license = licenses.asl20;
|
|
|
|
};
|
|
|
|
}
|