2023-07-15 17:15:38 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, getent, coreutils, nix-update-script, stdenv }:
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "otel-cli";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.4.5";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "equinix-labs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-JYi9CbP4mUhX0zNjhi6QlBzLKcj2zdPwlyBSIYKp6vk=";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
vendorHash = "sha256-fWQz7ZrU8gulhpOHSN8Prn4EMC0KXy942FZD/PMsLxc=";
|
2022-12-28 21:21:41 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
ln -s $GOPATH/bin/otel-cli .
|
2024-09-26 11:04:55 +00:00
|
|
|
'' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
|
2022-12-28 21:21:41 +00:00
|
|
|
substituteInPlace main_test.go \
|
2024-05-15 15:35:15 +00:00
|
|
|
--replace-fail 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent coreutils ]}`'
|
2022-12-28 21:21:41 +00:00
|
|
|
'';
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
patches = [ ./patches/bin-echo-patch.patch ];
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
passthru.updateScript = nix-update-script {};
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/equinix-labs/otel-cli";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Command-line tool for sending OpenTelemetry traces";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/equinix-labs/otel-cli/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with lib.maintainers; [ emattiza urandom ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "otel-cli";
|
2022-12-28 21:21:41 +00:00
|
|
|
};
|
|
|
|
}
|