Unverified Commit 98630c12 authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

oxlint: switch to finalAttrs (#430878)

parents 2a23638b 8b289ae7
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -2,17 +2,19 @@
  lib,
  rustPlatform,
  fetchFromGitHub,
  nix-update-script,
  rust-jemalloc-sys,
  versionCheckHook,
}:

rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "oxlint";
  version = "1.6.0";

  src = fetchFromGitHub {
    owner = "oxc-project";
    repo = "oxc";
    tag = "oxlint_v${version}";
    tag = "oxlint_v${finalAttrs.version}";
    hash = "sha256-URgz9k89WgYfCu9OlNCZk5wRt8upt58rIxFWa90L+OQ=";
  };

@@ -22,20 +24,26 @@ rustPlatform.buildRustPackage rec {
    rust-jemalloc-sys
  ];

  env.OXC_VERSION = version;
  env.OXC_VERSION = finalAttrs.version;

  cargoBuildFlags = [
    "--bin=oxlint"
    "--bin=oxc_language_server"
  ];
  cargoTestFlags = cargoBuildFlags;
  cargoTestFlags = finalAttrs.cargoBuildFlags;

  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgramArg = "--version";
  doInstallCheck = true;

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Collection of JavaScript tools written in Rust";
    homepage = "https://github.com/oxc-project/oxc";
    changelog = "https://github.com/oxc-project/oxc/releases/tag/${src.tag}";
    changelog = "https://github.com/oxc-project/oxc/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ figsoda ];
    mainProgram = "oxlint";
  };
}
})