{ lib, stdenv, fetchFromGitHub, # nativeBuildInputs ninja, makeWrapper, # buildInputs fmt, rsync, versionCheckHook, nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "lua-language-server"; version = "3.15.0"; src = fetchFromGitHub { owner = "luals"; repo = "lua-language-server"; tag = finalAttrs.version; hash = "sha256-frsq5OA3giLOJ/KPcAqVhme+0CtJuZrS3F4zHN1PnFM="; fetchSubmodules = true; }; nativeBuildInputs = [ ninja makeWrapper ]; buildInputs = [ fmt ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ rsync ]; env.NIX_LDFLAGS = "-lfmt"; postPatch = '' # filewatch tests are failing on darwin # this feature is not used in lua-language-server substituteInPlace 3rd/bee.lua/test/test.lua \ --replace-fail 'require "test_filewatch"' "" # use nixpkgs fmt library for d in 3rd/bee.lua 3rd/luamake/bee.lua do rm -r $d/3rd/fmt/* touch $d/3rd/fmt/format.cc substituteInPlace $d/bee/nonstd/format.h $d/bee/nonstd/print.h \ --replace-fail "include <3rd/fmt/fmt" "include