btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / ot / otel-cli / package.nix
blobb0c4e38c4c52472e335a879ad177295883001b0c
1 { lib, buildGoModule, fetchFromGitHub, getent, coreutils, nix-update-script, stdenv }:
3 buildGoModule rec {
4   pname = "otel-cli";
5   version = "0.4.5";
7   src = fetchFromGitHub {
8     owner = "equinix-labs";
9     repo = pname;
10     rev = "v${version}";
11     hash = "sha256-JYi9CbP4mUhX0zNjhi6QlBzLKcj2zdPwlyBSIYKp6vk=";
12   };
14   vendorHash = "sha256-fWQz7ZrU8gulhpOHSN8Prn4EMC0KXy942FZD/PMsLxc=";
16   preCheck = ''
17     ln -s $GOPATH/bin/otel-cli .
18   '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
19     substituteInPlace main_test.go \
20       --replace-fail 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent coreutils ]}`'
21   '';
23   patches = [ ./patches/bin-echo-patch.patch ];
25   passthru.updateScript = nix-update-script {};
27   meta = with lib; {
28     homepage = "https://github.com/equinix-labs/otel-cli";
29     description = "Command-line tool for sending OpenTelemetry traces";
30     changelog = "https://github.com/equinix-labs/otel-cli/releases/tag/v${version}";
31     license = licenses.asl20;
32     maintainers = with lib.maintainers; [ emattiza urandom ];
33     mainProgram = "otel-cli";
34   };