depot/third_party/nixpkgs/pkgs/development/tools/sumneko-lua-language-server/default.nix
Default email 556d6f0562 Project import generated by Copybara.
GitOrigin-RevId: e4ef597edfd8a0ba5f12362932fc9b1dd01a0aef
2021-10-11 18:52:03 +02:00

58 lines
1.5 KiB
Nix

{ lib, stdenv, fetchFromGitHub, ninja, makeWrapper }:
stdenv.mkDerivation rec {
pname = "sumneko-lua-language-server";
version = "2.4.2";
src = fetchFromGitHub {
owner = "sumneko";
repo = "lua-language-server";
rev = version;
sha256 = "sha256-PYlHjKMnqnhAJAvmHbH6Bb+qOyNzDH+ewOkXkj2u4CU=";
fetchSubmodules = true;
};
nativeBuildInputs = [
ninja
makeWrapper
];
preBuild = ''
cd 3rd/luamake
'';
ninjaFlags = [
"-fcompile/ninja/linux.ninja"
];
postBuild = ''
cd ../..
./3rd/luamake/luamake rebuild
'';
installPhase = ''
runHook preInstall
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 \
$out/bin/lua-language-server \
--add-flags "-E $out/share/lua-language-server/main.lua \
--logpath='~/.cache/sumneko_lua/log' \
--metapath='~/.cache/sumneko_lua/meta'"
runHook postInstall
'';
meta = with lib; {
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;
mainProgram = "lua-language-server";
};
}