Unverified Commit 315cd493 authored by Yohann Boniface's avatar Yohann Boniface Committed by GitHub
Browse files

hl-log-viewer: init at 0.30.3 (#375147)

parents 11307915 5af070ed
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -18845,6 +18845,11 @@
    githubId = 939420;
    name = "Petros Angelatos";
  };
  petrzjunior = {
    github = "petrzjunior";
    githubId = 7000918;
    name = "Petr Zahradnik";
  };
  petterstorvik = {
    email = "petterstorvik@gmail.com";
    github = "storvik";
+51 −0
Original line number Diff line number Diff line
{
  lib,
  rustPlatform,
  installShellFiles,
  fetchFromGitHub,
  nix-update-script,
  versionCheckHook,
}:
rustPlatform.buildRustPackage (finalAttrs: {
  pname = "hl-log-viewer";
  version = "0.30.3";

  src = fetchFromGitHub {
    owner = "pamburus";
    repo = "hl";
    tag = "v${finalAttrs.version}";
    hash = "sha256-18FzXUvpMHu3EfECgcslhReinMM6Oa1qdTKbbqFiv1w=";
  };

  cargoHash = "sha256-qx3NxWgCsCurU+TObQIvn1Xyn5IRP/iNem3s201MD4A=";
  useFetchCargoVendor = true;

  nativeBuildInputs = [ installShellFiles ];

  postInstall = ''
    installShellCompletion --cmd hl \
      --bash <($out/bin/hl --shell-completions bash) \
      --fish <($out/bin/hl --shell-completions fish) \
      --zsh <($out/bin/hl --shell-completions zsh)
    $out/bin/hl --man-page >hl.1
    installManPage hl.1
  '';

  doInstallCheck = true;
  nativeInstallCheckInputs = [
    versionCheckHook
  ];
  versionCheckProgram = "${placeholder "out"}/bin/hl";
  versionCheckProgramArg = "--version";

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

  meta = {
    description = "JSON and logfmt log converter to human readable representation";
    homepage = "https://github.com/pamburus/hl";
    changelog = "https://github.com/pamburus/hl/releases/tag/v${finalAttrs.version}";
    license = lib.licenses.mit;
    mainProgram = "hl";
    maintainers = with lib.maintainers; [ petrzjunior ];
  };
})