{ lib, stdenv, fetchFromGitHub, # nativeBuildInputs ninja, makeWrapper, # buildInputs fmt, libbfd, libunwind, rsync, versionCheckHook, nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "lua-language-server"; version = "3.17.1"; src = fetchFromGitHub { owner = "luals"; repo = "lua-language-server"; tag = finalAttrs.version; hash = "sha256-NfxBiXiGF4+meXTwp6We9+bmHW7Z9ZcxvRXAGwWAULo="; fetchSubmodules = true; }; nativeBuildInputs = [ ninja makeWrapper ]; buildInputs = [ fmt libbfd libunwind ] ++ 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