depot/third_party/nixpkgs/pkgs/by-name/op/opentelemetry-collector-builder/package.nix

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";
};
}