summary refs log tree commit diff
path: root/pkgs/development/tools/bingo/default.nix
blob: 6e7ed39a221c8d028c2543fe893cfa894e8b88eb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ lib, buildGoModule, fetchFromGitHub, testers, bingo }:

buildGoModule rec {
  pname = "bingo";
  version = "0.5.2";

  src = fetchFromGitHub {
    owner = "bwplotka";
    repo = "bingo";
    rev = "v${version}";
    sha256 = "sha256-4D8YaA/AH1gIp5iwD7WEAdBl73sqwHpfOe7bnxVcRcw=";
  };

  vendorSha256 = "sha256-xrz9FpwZd+FboVVTWSqGHRguGwrwE9cSFEEtulzbfDQ=";

  patches = [
    # Do not execute `go` command when invoking `bingo version`.
    ./version_go.patch
  ];

  postPatch = ''
    rm get_e2e_test.go get_e2e_utils_test.go
  '';

  CGO_ENABLED = 0;

  ldflags = [ "-s" "-w" ];

  passthru.tests.version = testers.testVersion {
    package = bingo;
    command = "bingo version";
    version = "v${version}";
  };

  meta = with lib; {
    description = "Like `go get` but for Go tools! CI Automating versioning of Go binaries in a nested, isolated Go modules.";
    homepage = "https://github.com/bwplotka/bingo";
    license = licenses.asl20;
    maintainers = with maintainers; [ aaronjheng ];
  };
}