38 lines
964 B
Nix
38 lines
964 B
Nix
{ stdenv, lib, fetchFromGitHub, llvmPackages, cmake }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "luau-lsp";
|
|
version = "1.42.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "JohnnyMorganz";
|
|
repo = "luau-lsp";
|
|
rev = "${version}";
|
|
hash = "sha256-MX5jXkSxfN7IqY3kvlAKiimFecsuvCnCQ0QegISvAxE="; # Replace with "" to get the hash while running `fr`
|
|
fetchSubmodules = true;
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
#cmakeFlags = [
|
|
# "-DCMAKE_BUILD_TYPE=Release"
|
|
#];
|
|
|
|
#patchPhase = ''
|
|
# sed -i '274d' luau/CMakeLists.txt
|
|
# sed -i '23i set(CMAKE_CXX_FLAGS "$\{CMAKE_CXX_FLAGS} -w")' CMakeLists.txt
|
|
#'';
|
|
patchPhase = ''
|
|
sed -i '274d' luau/CMakeLists.txt
|
|
sed -i '113d' CMakeLists.txt
|
|
'';
|
|
|
|
buildPhase = ''
|
|
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-Wno-unused-result"
|
|
cmake --build . --target Luau.LanguageServer.CLI --config Release
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp luau-lsp $out/bin/
|
|
'';
|
|
}
|