elixir-ls: force local installation (#427805)

Changed files
+20 -34
pkgs
development
beam-modules
+1 -1
pkgs/development/beam-modules/default.nix
···
inherit fetchMixDeps mixRelease;
};
-
elixir-ls = callPackage ./elixir-ls { inherit elixir fetchMixDeps mixRelease; };
+
elixir-ls = callPackage ./elixir-ls { inherit elixir; };
lfe = lfe_2_1;
lfe_2_1 = lib'.callLFE ../interpreters/lfe/2.1.nix { inherit erlang buildRebar3 buildHex; };
+15 -29
pkgs/development/beam-modules/elixir-ls/default.nix
···
elixir,
fetchpatch,
fetchFromGitHub,
-
fetchMixDeps,
makeWrapper,
-
mixRelease,
+
stdenv,
nix-update-script,
}:
-
mixRelease rec {
+
stdenv.mkDerivation rec {
pname = "elixir-ls";
version = "0.28.1";
···
hash = "sha256-r4P+3MPniDNdF3SG2jfBbzHsoxn826eYd2tsv6bJBoI=";
};
-
inherit elixir;
-
-
stripDebug = true;
-
-
mixFodDeps = fetchMixDeps {
-
pname = "mix-deps-${pname}";
-
inherit src version elixir;
-
hash = "sha256-8zs+99jwf+YX5SwD65FCPmfrYhTCx4AQGCGsDeCKxKc=";
-
};
-
patches = [
# fix elixir deterministic support https://github.com/elixir-lsp/elixir-ls/pull/1216
# remove > 0.28.1
···
makeWrapper
];
-
# 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${lib.optionalString (lib.versionAtLeast elixir.version "1.16.0") "2"}
+
# for substitution
+
env.elixir = elixir;
-
runHook postBuild
-
'';
+
dontConfigure = true;
+
dontBuild = true;
installPhase = ''
-
mkdir -p $out/bin
-
cp -Rv release $out/libexec
+
cp -R . $out
+
ln -s $out/VERSION $out/scripts/VERSION
-
substituteAllInPlace $out/libexec/launch.sh
+
substituteAllInPlace $out/scripts/launch.sh
-
makeWrapper $out/libexec/language_server.sh $out/bin/elixir-ls \
-
--set ELS_INSTALL_PREFIX "$out/libexec"
+
mkdir -p $out/bin
+
+
makeWrapper $out/scripts/language_server.sh $out/bin/elixir-ls \
+
--set ELS_LOCAL "1"
-
makeWrapper $out/libexec/debug_adapter.sh $out/bin/elixir-debug-adapter \
-
--set ELS_INSTALL_PREFIX "$out/libexec"
+
makeWrapper $out/scripts/debug_adapter.sh $out/bin/elixir-debug-adapter \
+
--set ELS_LOCAL "1"
runHook postInstall
'';
+4 -4
pkgs/development/beam-modules/elixir-ls/launch.sh.patch
···
-
diff --git i/scripts/launch.sh w/scripts/launch.sh
-
index 21afbb1e..975cbdf0 100755
-
--- i/scripts/launch.sh
+
diff --git c/scripts/launch.sh w/scripts/launch.sh
+
index 21afbb1e..6b61f0b4 100755
+
--- c/scripts/launch.sh
+++ w/scripts/launch.sh
@@ -1,125 +1,4 @@
-#!/bin/sh
···
- SCRIPTPATH=${ELS_INSTALL_PREFIX}
-fi
+SCRIPT=$(readlink -f "$0")
-
+SCRIPTPATH=$(dirname "$SCRIPT")/../libexec
+
+SCRIPTPATH=$(dirname "$SCRIPT")/../scripts
export MIX_ENV=prod
# Mix.install prints to stdout and reads from stdin