2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ninja, makeWrapper }:
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "sumneko-lua-language-server";
|
2021-10-17 09:34:42 +00:00
|
|
|
version = "2.4.5";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sumneko";
|
|
|
|
repo = "lua-language-server";
|
|
|
|
rev = version;
|
2021-10-17 09:34:42 +00:00
|
|
|
sha256 = "sha256-7eTYHZDJLmYTwe0K+RJMRl4tRz9o0DeniHD5+v9f1Jw=";
|
2021-01-15 22:18:51 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
ninja
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cd 3rd/luamake
|
|
|
|
'';
|
|
|
|
|
|
|
|
ninjaFlags = [
|
2021-08-18 13:19:15 +00:00
|
|
|
"-fcompile/ninja/linux.ninja"
|
2021-04-19 03:05:28 +00:00
|
|
|
];
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
cd ../..
|
|
|
|
./3rd/luamake/luamake rebuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2021-04-19 03:05:28 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2021-10-11 16:52:03 +00:00
|
|
|
install -Dt "$out"/share/lua-language-server/bin/Linux bin/Linux/lua-language-server
|
|
|
|
install -m644 -t "$out"/share/lua-language-server/bin/Linux bin/Linux/*.*
|
|
|
|
install -m644 -t "$out"/share/lua-language-server {debugger,main}.lua
|
|
|
|
cp -r locale meta script "$out"/share/lua-language-server
|
|
|
|
|
|
|
|
makeWrapper "$out"/share/lua-language-server/bin/Linux/lua-language-server \
|
2021-01-15 22:18:51 +00:00
|
|
|
$out/bin/lua-language-server \
|
2021-10-11 16:52:03 +00:00
|
|
|
--add-flags "-E $out/share/lua-language-server/main.lua \
|
2021-01-15 22:18:51 +00:00
|
|
|
--logpath='~/.cache/sumneko_lua/log' \
|
|
|
|
--metapath='~/.cache/sumneko_lua/meta'"
|
2021-04-19 03:05:28 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2021-01-15 22:18:51 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-15 22:18:51 +00:00
|
|
|
description = "Lua Language Server coded by Lua ";
|
|
|
|
homepage = "https://github.com/sumneko/lua-language-server";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ mjlbach ];
|
|
|
|
platforms = platforms.linux;
|
2021-09-28 08:13:01 +00:00
|
|
|
mainProgram = "lua-language-server";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
}
|