beam-packages: init elixir_ls 0.7.0 (#118950)

This commit is contained in:
Raphael Megzari 2021-04-19 19:22:29 +09:00 committed by GitHub
parent 80b600af29
commit aa41080e22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 76 additions and 2 deletions

View File

@ -63,6 +63,8 @@ let
debugInfo = true;
};
elixir_ls = callPackage ./elixir_ls.nix { inherit elixir fetchMixDeps mixRelease; };
# Remove old versions of elixir, when the supports fades out:
# https://hexdocs.pm/elixir/compatibility-and-deprecations.html

View File

@ -0,0 +1,71 @@
{ lib, elixir, fetchFromGitHub, fetchMixDeps, mixRelease }:
# Based on the work of Hauleth
# None of this would have happened without him
mixRelease rec {
pname = "elixir-ls";
version = "0.7.0";
src = fetchFromGitHub {
owner = "elixir-lsp";
repo = "elixir-ls";
rev = "v{version}";
sha256 = "0d0hqc35hfjkpm88vz21mnm2a9rxiqfrdi83whhhh6d2ba216b7s";
fetchSubmodules = true;
};
mixDeps = fetchMixDeps {
pname = "mix-deps-${pname}";
inherit src version;
sha256 = "0r9x223imq4j9pn9niskyaybvk7jmq8dxcyzk7kwfsi128qig1a1";
};
# 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;
};
}

View File

@ -11650,7 +11650,8 @@ in
inherit (beam.interpreters)
erlang erlangR23 erlangR22 erlangR21 erlangR20 erlangR19 erlangR18
erlang_odbc erlang_javac erlang_odbc_javac erlang_basho_R16B02
elixir elixir_1_11 elixir_1_10 elixir_1_9 elixir_1_8 elixir_1_7;
elixir elixir_1_11 elixir_1_10 elixir_1_9 elixir_1_8 elixir_1_7
elixir_ls;
erlang_nox = beam_nox.interpreters.erlang;

View File

@ -111,7 +111,7 @@ rec {
# access for example elixir built with different version of Erlang, use
# `beam.packages.erlangR23.elixir`.
inherit (packages.erlang)
elixir elixir_1_11 elixir_1_10 elixir_1_9 elixir_1_8 elixir_1_7;
elixir elixir_1_11 elixir_1_10 elixir_1_9 elixir_1_8 elixir_1_7 elixir_ls;
inherit (packages.erlang) lfe lfe_1_2 lfe_1_3;
};