Files
nixpkgs/pkgs/by-name/go/go-xmlstruct/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

51 lines
1.3 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
nix-update-script,
}:
buildGoModule (finalAttrs: {
pname = "go-xmlstruct";
version = "1.11.2";
src = fetchFromGitHub {
owner = "twpayne";
repo = "go-xmlstruct";
tag = "v${finalAttrs.version}";
hash = "sha256-wkU8YIE3+kuC8g1/qNnW/nLxsDktS2NNTI88GWdwbLw=";
};
vendorHash = "sha256-myt5JjEDnLfkYkB+yb/oaH4dgIOB9qFcqcEb6KO5vBk=";
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
# The --help flag doesn't actually exist in goxmlstruct, causing it to return exit code 2,
# but this error condition is the only way to get the usage information.
output=$($out/bin/goxmlstruct --help 2>&1 || true)
if ! echo "$output" | grep -q "Usage of $out/bin/goxmlstruct:"; then
echo "Expected usage information not found in output"
echo "Got: $output"
exit 1
fi
runHook postInstallCheck
'';
passthru = {
updateScript = nix-update-script { };
};
meta = {
description = "Generate Go structs from multiple XML documents";
mainProgram = "goxmlstruct";
homepage = "https://github.com/twpayne/go-xmlstruct";
changelog = "https://github.com/twpayne/go-xmlstruct/releases/tag/v${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dvcorreia ];
};
})