Unverified Commit c33de3d9 authored by Petr Portnov's avatar Petr Portnov
Browse files

xq-xml: add nix-update-script

parent 29a721d4
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -2,8 +2,8 @@
  lib,
  buildGoModule,
  fetchFromGitHub,
  testers,
  xq-xml,
  versionCheckHook,
  nix-update-script,
}:

buildGoModule (finalAttrs: {
@@ -13,7 +13,7 @@ buildGoModule (finalAttrs: {
  src = fetchFromGitHub {
    owner = "sibprogrammer";
    repo = "xq";
    rev = "v${finalAttrs.version}";
    tag = "v${finalAttrs.version}";
    hash = "sha256-6iC5YhCppzlyp6o+Phq98gQj4LjQx/5pt2+ejOvGvTE=";
  };

@@ -22,21 +22,20 @@ buildGoModule (finalAttrs: {
  ldflags = [
    "-s"
    "-w"
    "-X=main.commit=${finalAttrs.src.rev}"
    "-X=main.commit=v${finalAttrs.version}"
    "-X=main.version=${finalAttrs.version}"
  ];

  passthru.tests = {
    version = testers.testVersion {
      package = xq-xml;
    };
  };
  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];

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

  meta = {
    description = "Command-line XML and HTML beautifier and content extractor";
    mainProgram = "xq";
    homepage = "https://github.com/sibprogrammer/xq";
    changelog = "https://github.com/sibprogrammer/xq/releases/tag/${finalAttrs.src.rev}";
    changelog = "https://github.com/sibprogrammer/xq/releases/tag/v${finalAttrs.version}";
    license = lib.licenses.mit;
    maintainers = [ lib.maintainers.progrm_jarvis ];
  };