2023-07-12 17:22:45 +02:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, getent, coreutils, nix-update-script, stdenv }:
|
2021-10-28 21:42:51 +02:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "otel-cli";
|
2023-08-09 23:26:00 +02:00
|
|
|
version = "0.4.0";
|
2021-10-28 21:42:51 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "equinix-labs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-08-09 23:26:00 +02:00
|
|
|
hash = "sha256-xIvxjmrZd/2eT2JAagH+mMyYkDjc7La5dUqsmNnOtrc=";
|
2021-10-28 21:42:51 +02:00
|
|
|
};
|
|
|
|
|
2023-08-09 23:26:00 +02:00
|
|
|
vendorHash = "sha256-mnMtvR2r5HbKC0P5iGFkwLcpx3IvmhgCI8/CCVJunXw=";
|
2021-10-28 21:42:51 +02:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
ln -s $GOPATH/bin/otel-cli .
|
|
|
|
'' + lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
substituteInPlace main_test.go \
|
2023-05-28 02:34:46 +02:00
|
|
|
--replace 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent coreutils ]}`'
|
2021-10-28 21:42:51 +02:00
|
|
|
'';
|
|
|
|
|
2023-02-02 20:28:38 +01:00
|
|
|
passthru.updateScript = nix-update-script {};
|
|
|
|
|
2021-10-28 21:42:51 +02:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/equinix-labs/otel-cli";
|
|
|
|
description = "A command-line tool for sending OpenTelemetry traces";
|
|
|
|
changelog = "https://github.com/equinix-labs/otel-cli/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ emattiza urandom ];
|
|
|
|
};
|
|
|
|
}
|