2023-07-12 15:22:45 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, getent, coreutils, nix-update-script, stdenv }:
|
2021-10-28 19:42:51 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "otel-cli";
|
2024-04-02 01:29:39 +00:00
|
|
|
version = "0.4.5";
|
2021-10-28 19:42:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "equinix-labs";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2024-04-02 01:29:39 +00:00
|
|
|
hash = "sha256-JYi9CbP4mUhX0zNjhi6QlBzLKcj2zdPwlyBSIYKp6vk=";
|
2021-10-28 19:42:51 +00:00
|
|
|
};
|
|
|
|
|
2024-04-02 01:29:39 +00:00
|
|
|
vendorHash = "sha256-fWQz7ZrU8gulhpOHSN8Prn4EMC0KXy942FZD/PMsLxc=";
|
2021-10-28 19:42:51 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
ln -s $GOPATH/bin/otel-cli .
|
|
|
|
'' + lib.optionalString (!stdenv.isDarwin) ''
|
|
|
|
substituteInPlace main_test.go \
|
2024-04-02 01:29:39 +00:00
|
|
|
--replace-fail 'const minimumPath = `/bin:/usr/bin`' 'const minimumPath = `${lib.makeBinPath [ getent coreutils ]}`'
|
2021-10-28 19:42:51 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-02 01:29:39 +00:00
|
|
|
patches = [ ./patches/bin-echo-patch.patch ];
|
|
|
|
|
2023-02-02 19:28:38 +00:00
|
|
|
passthru.updateScript = nix-update-script {};
|
|
|
|
|
2021-10-28 19:42:51 +00: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 ];
|
2023-11-27 01:17:53 +00:00
|
|
|
mainProgram = "otel-cli";
|
2021-10-28 19:42:51 +00:00
|
|
|
};
|
|
|
|
}
|