Unverified Commit 4c08d384 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

llm-ls: use system oniguruma (#481442)

parents ace24a96 c8705e43
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -4,24 +4,26 @@
  fetchFromGitHub,
  fetchpatch,
  pkg-config,
  oniguruma,
  versionCheckHook,
  nix-update-script,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "llm-ls";
  version = "0.5.3";

  src = fetchFromGitHub {
    owner = "huggingface";
    repo = "llm-ls";
    tag = version;
    tag = finalAttrs.version;
    hash = "sha256-ICMM2kqrHFlKt2/jmE4gum1Eb32afTJkT3IRoqcjJJ8=";
  };

  cargoPatches = [
    # https://github.com/huggingface/llm-ls/pull/102
    ./fix-time-compilation-failure.patch

    (fetchpatch {
      name = "fix-version.patch";
      url = "https://github.com/huggingface/llm-ls/commit/479401f3a5173f2917a888c8068f84e29b7dceed.patch?full_index=1";
@@ -29,12 +31,18 @@ rustPlatform.buildRustPackage rec {
    })
  ];

  env.RUSTONIG_SYSTEM_LIBONIG = true;

  cargoHash = "sha256-qiYspv2KcvzxVshVpAMlSqFDqbbiutpLyWMz+QSIVmQ=";

  buildAndTestSubdir = "crates/llm-ls";

  nativeBuildInputs = [ pkg-config ];

  buildInputs = [
    oniguruma
  ];

  nativeInstallCheckInputs = [
    versionCheckHook
  ];
@@ -47,10 +55,10 @@ rustPlatform.buildRustPackage rec {
  meta = {
    description = "LSP server leveraging LLMs for code completion (and more?)";
    homepage = "https://github.com/huggingface/llm-ls";
    changelog = "https://github.com/huggingface/llm-ls/releases/tag/${version}";
    changelog = "https://github.com/huggingface/llm-ls/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ jfvillablanca ];
    platforms = lib.platforms.all;
    mainProgram = "llm-ls";
  };
}
})