2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ninja, makeWrapper }:
|
2020-12-30 01:30:18 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "sumneko-lua-language-server";
|
2021-02-20 17:41:17 +00:00
|
|
|
version = "1.16.0";
|
2020-12-30 01:30:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sumneko";
|
|
|
|
repo = "lua-language-server";
|
|
|
|
rev = version;
|
2021-02-20 17:41:17 +00:00
|
|
|
sha256 = "1fqhvmz7a4qgz3zq6qgpcjhhhm2j4wpx0385n3zcphd9h9s3a9xa";
|
2020-12-30 01:30:18 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
ninja
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
cd 3rd/luamake
|
|
|
|
'';
|
|
|
|
|
|
|
|
ninjaFlags = [
|
|
|
|
"-f ninja/linux.ninja"
|
|
|
|
];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
cd ../..
|
|
|
|
./3rd/luamake/luamake rebuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/extras
|
|
|
|
cp -r ./{locale,meta,script,*.lua} $out/extras/
|
|
|
|
cp ./bin/Linux/{bee.so,lpeglabel.so} $out/extras
|
|
|
|
cp ./bin/Linux/lua-language-server $out/extras/.lua-language-server-unwrapped
|
|
|
|
makeWrapper $out/extras/.lua-language-server-unwrapped \
|
|
|
|
$out/bin/lua-language-server \
|
|
|
|
--add-flags "-E $out/extras/main.lua \
|
|
|
|
--logpath='~/.cache/sumneko_lua/log' \
|
|
|
|
--metapath='~/.cache/sumneko_lua/meta'"
|
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2020-12-30 01:30:18 +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;
|
|
|
|
};
|
|
|
|
}
|