hugo: 0.139.3 -> 0.140.1 and refactor (#368072)

This commit is contained in:
Pol Dellaiera
2024-12-25 22:34:24 +01:00
committed by GitHub

View File

@@ -5,28 +5,36 @@
fetchFromGitHub,
installShellFiles,
buildPackages,
testers,
versionCheckHook,
nix-update-script,
hugo,
}:
buildGoModule rec {
pname = "hugo";
version = "0.139.3";
version = "0.140.1";
src = fetchFromGitHub {
owner = "gohugoio";
repo = "hugo";
rev = "refs/tags/v${version}";
hash = "sha256-bUqLVM1jQ6LVsnDIP2NanmmEFe3mDUt446kH9I0aZQI=";
tag = "v${version}";
hash = "sha256-9H7hXBz/rKJZr/XvqFRmOQylf6sfJtkwik3jh/k+Vec=";
};
vendorHash = "sha256-LwXrCYGlWe6dOdPTh3YKhJDUID6e+OUOfDYtYxYnx/Y=";
vendorHash = "sha256-swcj1JxYoRqKscu/IC0uiAATp4AXN0aANWkSq/mJsyc=";
checkFlags = [
# Workaround for "failed to load modules"
"-skip=TestCommands/mod"
];
checkFlags =
let
skippedTestPrefixes = [
# Workaround for "failed to load modules"
"TestCommands/mod"
# Server tests are flaky, at least in x86_64-darwin. See #368072
# We can try testing again after updating the `httpget` helper
# ref: https://github.com/gohugoio/hugo/blob/v0.140.1/main_test.go#L220-L233
"TestCommands/server"
];
in
[ "-skip=^${builtins.concatStringsSep "|^" skippedTestPrefixes}" ];
proxyVendor = true;
@@ -58,11 +66,12 @@ buildGoModule rec {
--zsh <(${emulator} $out/bin/hugo completion zsh)
'';
passthru.tests.version = testers.testVersion {
package = hugo;
command = "hugo version";
version = "v${version}";
};
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgram = "${placeholder "out"}/bin/${meta.mainProgram}";
versionCheckProgramArg = [ "version" ];
passthru.updateScript = nix-update-script { };
@@ -76,6 +85,7 @@ buildGoModule rec {
schneefux
Br1ght0ne
Frostman
kachick
];
};
}