depot/pkgs/by-name/op/opentelemetry-collector-builder/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

45 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
}:
buildGoModule rec {
pname = "ocb";
version = "0.112.0";
src = fetchFromGitHub {
owner = "open-telemetry";
repo = "opentelemetry-collector";
rev = "cmd/builder/v${version}";
hash = "sha256-0eL9J+PrURiNkL6CzUIlcvjyZor8iS9vKX8j0srLlZ8=";
};
sourceRoot = "${src.name}/cmd/builder";
vendorHash = "sha256-vZsGSLdzKa4sA/N3RG6Kwn8tMoIIhPJ6uAkM4pheitU=";
CGO_ENABLED = 0;
ldflags = [
"-s"
"-w"
"-X go.opentelemetry.io/collector/cmd/builder/internal.version=${version}"
];
# Some tests download new dependencies for a modified go.mod. Nix doesn't allow network access so skipping.
checkFlags = [
"-skip TestGenerateAndCompile|TestReplaceStatementsAreComplete|TestVersioning"
];
# Rename 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";
};
}