e7ec2969af
GitOrigin-RevId: 9b19f5e77dd906cb52dade0b7bd280339d2a1f3d
59 lines
1.4 KiB
Nix
59 lines
1.4 KiB
Nix
{ stdenv
|
|
, lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, installShellFiles
|
|
, buildPackages
|
|
, testers
|
|
, hugo
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "hugo";
|
|
version = "0.121.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "gohugoio";
|
|
repo = "hugo";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-YwwvxkS+oqTMZzwq6iiB/0vLHIyeReQi76B7fCgqtcY=";
|
|
};
|
|
|
|
vendorHash = "sha256-4j61PFULBXhtERDhbHW7gwEuP+KBUEdva2fjuaAVY0o=";
|
|
|
|
doCheck = false;
|
|
|
|
proxyVendor = true;
|
|
|
|
tags = [ "extended" ];
|
|
|
|
subPackages = [ "." ];
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [ "-s" "-w" "-X github.com/gohugoio/hugo/common/hugo.vendorInfo=nixpkgs" ];
|
|
|
|
postInstall = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
|
|
${emulator} $out/bin/hugo gen man
|
|
installManPage man/*
|
|
installShellCompletion --cmd hugo \
|
|
--bash <(${emulator} $out/bin/hugo completion bash) \
|
|
--fish <(${emulator} $out/bin/hugo completion fish) \
|
|
--zsh <(${emulator} $out/bin/hugo completion zsh)
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = hugo;
|
|
command = "hugo version";
|
|
version = "v${version}";
|
|
};
|
|
|
|
meta = {
|
|
changelog = "https://github.com/gohugoio/hugo/releases/tag/v${version}";
|
|
description = "A fast and modern static website engine";
|
|
homepage = "https://gohugo.io";
|
|
license = lib.licenses.asl20;
|
|
mainProgram = "hugo";
|
|
maintainers = with lib.maintainers; [ schneefux Br1ght0ne Frostman ];
|
|
};
|
|
}
|