mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-23 23:43:30 +00:00
cobra-cli: fix the build
Fix two issues: - Skip tests which depend on the current year. - Ensure go is in PATH.
This commit is contained in:
parent
1201dd5a5e
commit
fa59d8e45c
@ -1,4 +1,4 @@
|
||||
{ lib, buildGoModule, fetchFromGitHub }:
|
||||
{ lib, buildGoModule, fetchFromGitHub, makeWrapper, go }:
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "cobra-cli";
|
||||
@ -13,6 +13,22 @@ buildGoModule rec {
|
||||
|
||||
vendorSha256 = "sha256-vrtGPQzY+NImOGaSxV+Dvch+GNPfL9XfY4lfCHTGXwY=";
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
allowGoReference = true;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace "cmd/add_test.go" \
|
||||
--replace "TestGoldenAddCmd" "SkipGoldenAddCmd"
|
||||
substituteInPlace "cmd/init_test.go" \
|
||||
--replace "TestGoldenInitCmd" "SkipGoldenInitCmd"
|
||||
'';
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram "$out/bin/cobra-cli" \
|
||||
--prefix PATH : ${go}/bin
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Cobra CLI tool to generate applications and commands";
|
||||
homepage = "https://github.com/spf13/cobra-cli/";
|
||||
|
Loading…
Reference in New Issue
Block a user