1{ lib, buildGoModule, fetchFromGitHub, makeWrapper, go }:
2
3buildGoModule rec {
4 pname = "cobra-cli";
5 version = "1.3.0";
6
7 src = fetchFromGitHub {
8 owner = "spf13";
9 repo = pname;
10 rev = "v${version}";
11 sha256 = "sha256-E0I/Pxw4biOv7aGVzGlQOFXnxkc+zZaEoX1JmyMh6UE=";
12 };
13
14 vendorSha256 = "sha256-vrtGPQzY+NImOGaSxV+Dvch+GNPfL9XfY4lfCHTGXwY=";
15
16 nativeBuildInputs = [ makeWrapper ];
17
18 allowGoReference = true;
19
20 postPatch = ''
21 substituteInPlace "cmd/add_test.go" \
22 --replace "TestGoldenAddCmd" "SkipGoldenAddCmd"
23 substituteInPlace "cmd/init_test.go" \
24 --replace "TestGoldenInitCmd" "SkipGoldenInitCmd"
25 '';
26
27 postFixup = ''
28 wrapProgram "$out/bin/cobra-cli" \
29 --prefix PATH : ${go}/bin
30 '';
31
32 meta = with lib; {
33 description = "Cobra CLI tool to generate applications and commands";
34 homepage = "https://github.com/spf13/cobra-cli/";
35 changelog = "https://github.com/spf13/cobra-cli/releases/tag/${version}";
36 license = licenses.afl20;
37 maintainers = [ maintainers.ivankovnatsky ];
38 };
39}