|
| 1 | +{ |
| 2 | + lib, |
| 3 | + stdenv, |
| 4 | + fetchFromGitHub, |
| 5 | + cmake, |
| 6 | + versionCheckHook, |
| 7 | + nix-update-script, |
| 8 | +}: |
| 9 | + |
| 10 | +stdenv.mkDerivation (finalAttrs: { |
| 11 | + pname = "luau-lsp"; |
| 12 | + version = "1.45.0"; |
| 13 | + |
| 14 | + src = fetchFromGitHub { |
| 15 | + owner = "JohnnyMorganz"; |
| 16 | + repo = "luau-lsp"; |
| 17 | + tag = finalAttrs.version; |
| 18 | + hash = "sha256-OJAjTy0vTRb43TTiPeXafWq4kjIpnDXoTprVzbMnaWQ="; |
| 19 | + fetchSubmodules = true; |
| 20 | + }; |
| 21 | + |
| 22 | + NIX_CFLAGS_COMPILE = "-Wno-error"; |
| 23 | + |
| 24 | + cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ |
| 25 | + (lib.cmakeFeature "CMAKE_OSX_ARCHITECTURES" stdenv.hostPlatform.darwinArch) |
| 26 | + ]; |
| 27 | + |
| 28 | + nativeBuildInputs = [ cmake ]; |
| 29 | + |
| 30 | + buildPhase = '' |
| 31 | + runHook preBuild |
| 32 | +
|
| 33 | + cmake --build . --target Luau.LanguageServer.CLI --config Release |
| 34 | +
|
| 35 | + runHook postBuild |
| 36 | + ''; |
| 37 | + |
| 38 | + installPhase = '' |
| 39 | + runHook preInstall |
| 40 | +
|
| 41 | + install -D luau-lsp $out/bin/luau-lsp |
| 42 | +
|
| 43 | + runHook postInstall |
| 44 | + ''; |
| 45 | + |
| 46 | + nativeInstallCheckInputs = [ versionCheckHook ]; |
| 47 | + versionCheckProgramArg = "--version"; |
| 48 | + doInstallCheck = true; |
| 49 | + |
| 50 | + passthru.updateScript = nix-update-script { }; |
| 51 | + |
| 52 | + meta = { |
| 53 | + description = "Language Server Implementation for Luau"; |
| 54 | + homepage = "https://github.com/JohnnyMorganz/luau-lsp"; |
| 55 | + downloadPage = "https://github.com/JohnnyMorganz/luau-lsp/releases/tag/${finalAttrs.version}"; |
| 56 | + changelog = "https://github.com/JohnnyMorganz/luau-lsp/blob/${finalAttrs.version}/CHANGELOG.md"; |
| 57 | + license = lib.licenses.mit; |
| 58 | + maintainers = with lib.maintainers; [ |
| 59 | + anninzy |
| 60 | + HeitorAugustoLN |
| 61 | + ]; |
| 62 | + mainProgram = "luau-lsp"; |
| 63 | + platforms = lib.platforms.all; |
| 64 | + badPlatforms = [ |
| 65 | + # Could not find a package configuration file provided by "Protobuf" |
| 66 | + # It is unclear why this is only happening on x86_64-darwin |
| 67 | + "x86_64-darwin" |
| 68 | + ]; |
| 69 | + }; |
| 70 | +}) |
0 commit comments