2021-04-22 02:08:21 +00:00
|
|
|
{ lib, elixir, fetchFromGitHub, fetchMixDeps, mixRelease }:
|
|
|
|
# Based on the work of Hauleth
|
|
|
|
# None of this would have happened without him
|
|
|
|
|
|
|
|
mixRelease rec {
|
|
|
|
pname = "elixir-ls";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.8.1";
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit elixir;
|
2021-04-22 02:08:21 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "elixir-lsp";
|
|
|
|
repo = "elixir-ls";
|
2021-04-25 03:57:28 +00:00
|
|
|
rev = "v${version}";
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "sha256-KlZq12RCor9GrwA8QMP3R+jUQ/xFHRjkLwwkvthiMU0=";
|
2021-04-22 02:08:21 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-05-28 09:39:13 +00:00
|
|
|
mixFodDeps = fetchMixDeps {
|
2021-04-22 02:08:21 +00:00
|
|
|
pname = "mix-deps-${pname}";
|
2021-12-06 16:07:01 +00:00
|
|
|
inherit src version elixir;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "sha256-OzjToAg+q/ybCyqzNFk28OBsItjFTbdPi416EPh2qX0=";
|
2021-04-22 02:08:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# elixir_ls is an umbrella app
|
|
|
|
# override configurePhase to not skip umbrella children
|
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
mix deps.compile --no-deps-check
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
|
|
|
|
|
|
|
# elixir_ls require a special step for release
|
|
|
|
# compile and release need to be performed together because
|
|
|
|
# of the no-deps-check requirement
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
mix do compile --no-deps-check, elixir_ls.release
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp -Rv release $out/lib
|
|
|
|
# Prepare the wrapper script
|
|
|
|
substitute release/language_server.sh $out/bin/elixir-ls \
|
|
|
|
--replace 'exec "''${dir}/launch.sh"' "exec $out/lib/launch.sh"
|
|
|
|
chmod +x $out/bin/elixir-ls
|
|
|
|
# prepare the launcher
|
|
|
|
substituteInPlace $out/lib/launch.sh \
|
|
|
|
--replace "ERL_LIBS=\"\$SCRIPTPATH:\$ERL_LIBS\"" \
|
|
|
|
"ERL_LIBS=$out/lib:\$ERL_LIBS" \
|
|
|
|
--replace "exec elixir" "exec ${elixir}/bin/elixir"
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/elixir-lsp/elixir-ls";
|
|
|
|
description = ''
|
|
|
|
A frontend-independent IDE "smartness" server for Elixir.
|
|
|
|
Implements the "Language Server Protocol" standard and provides debugger support via the "Debug Adapter Protocol"
|
|
|
|
'';
|
|
|
|
longDescription = ''
|
|
|
|
The Elixir Language Server provides a server that runs in the background, providing IDEs, editors, and other tools with information about Elixir Mix projects.
|
|
|
|
It adheres to the Language Server Protocol, a standard for frontend-independent IDE support.
|
|
|
|
Debugger integration is accomplished through the similar VS Code Debug Protocol.
|
|
|
|
'';
|
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = teams.beam.members;
|
|
|
|
};
|
2021-09-18 10:52:07 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
2021-04-22 02:08:21 +00:00
|
|
|
}
|