packer: migrate to buildGoModule

This commit is contained in:
Danielle Lancashire 2021-04-01 15:16:28 +02:00
parent 42fa68be1d
commit 2112a55caf

View file

@ -1,12 +1,9 @@
{ lib, buildGoPackage, fetchFromGitHub, installShellFiles }:
buildGoPackage rec {
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
buildGoModule rec {
pname = "packer";
version = "1.7.1";
goPackagePath = "github.com/hashicorp/packer";
subPackages = [ "." ];
src = fetchFromGitHub {
owner = "hashicorp";
repo = "packer";
@ -14,12 +11,16 @@ buildGoPackage rec {
sha256 = "sha256-PZwKvb43Xf8HaC148Xo076u3sP53nwC4fJ2X7HU0gDo=";
};
vendorSha256 = null;
subPackages = [ "." ];
buildFlagsArray = [ "-ldflags=-s -w" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
installShellCompletion --zsh go/src/${goPackagePath}/contrib/zsh-completion/_packer
installShellCompletion --zsh contrib/zsh-completion/_packer
'';
meta = with lib; {