2023-07-15 17:15:38 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, buildPackages
|
|
|
|
, testers
|
|
|
|
, hugo
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "hugo";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "0.119.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gohugoio";
|
|
|
|
repo = pname;
|
2023-08-04 22:07:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-QumHL3S57Xm6N3u4VakNzRGmUi0RT8lVXG1K5/Dsq4A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
vendorHash = "sha256-KbGZ7MSioP82UNgmeKFdgCBkTIqL0fV5QhzrcxYyl4k=";
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
doCheck = false;
|
2020-05-15 21:57:56 +00:00
|
|
|
|
2022-01-07 04:07:37 +00:00
|
|
|
proxyVendor = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-06 21:57:35 +00:00
|
|
|
tags = [ "extended" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
subPackages = [ "." ];
|
|
|
|
|
2021-03-20 04:20:00 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
ldflags = [ "-s" "-w" "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=nixpkgs" ];
|
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
|
|
|
|
${emulator} $out/bin/hugo gen man
|
2021-03-20 04:20:00 +00:00
|
|
|
installManPage man/*
|
|
|
|
installShellCompletion --cmd hugo \
|
2022-10-06 18:32:54 +00:00
|
|
|
--bash <(${emulator} $out/bin/hugo completion bash) \
|
|
|
|
--fish <(${emulator} $out/bin/hugo completion fish) \
|
|
|
|
--zsh <(${emulator} $out/bin/hugo completion zsh)
|
2021-03-20 04:20:00 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = hugo;
|
|
|
|
command = "hugo version";
|
|
|
|
version = "v${version}";
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "A fast and modern static website engine";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://gohugo.io";
|
|
|
|
license = licenses.asl20;
|
2020-11-19 00:13:47 +00:00
|
|
|
maintainers = with maintainers; [ schneefux Br1ght0ne Frostman ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|