From 72bbd58f1dbab748481b02ee7bbaaab8a6fbce96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20S=C3=A1nchez?= Date: Fri, 28 Jun 2024 13:10:26 +0100 Subject: [PATCH] opentelemetry-collector-builder: init at 0.101.0 (#258467) --- .../package.nix | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 pkgs/by-name/op/opentelemetry-collector-builder/package.nix diff --git a/pkgs/by-name/op/opentelemetry-collector-builder/package.nix b/pkgs/by-name/op/opentelemetry-collector-builder/package.nix new file mode 100644 index 0000000000000..1f47665155e20 --- /dev/null +++ b/pkgs/by-name/op/opentelemetry-collector-builder/package.nix @@ -0,0 +1,43 @@ +{ + lib, + buildGoModule, + fetchFromGitHub, +}: +buildGoModule rec { + pname = "ocb"; + version = "0.101.0"; + + src = fetchFromGitHub { + owner = "open-telemetry"; + repo = "opentelemetry-collector"; + rev = "cmd/builder/v${version}"; + hash = "sha256-Ucp00OjyPtHA6so/NOzTLtPSuhXwz6A2708w2WIZb/E="; + }; + + sourceRoot = "${src.name}/cmd/builder"; + vendorHash = "sha256-MTwD9xkrq3EudppLSoONgcPCBWlbSmaODLH9NtYgVOk="; + + CGO_ENABLED = 0; + ldflags = [ + "-s" + "-w" + "-X go.opentelemetry.io/collector/cmd/builder/internal.version=${version}" + ]; + + # The TestGenerateAndCompile tests download new dependencies for a modified go.mod. Nix doesn't allow network access so skipping. + checkFlags = [ "-skip TestGenerateAndCompile" ]; + + # Rename the to ocb (it's generated as "builder") + postInstall = '' + mv $out/bin/builder $out/bin/ocb + ''; + + meta = { + description = "OpenTelemetry Collector"; + homepage = "https://github.com/open-telemetry/opentelemetry-collector.git"; + changelog = "https://github.com/open-telemetry/opentelemetry-collector/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ davsanchez ]; + mainProgram = "ocb"; + }; +}