PORTNAME=	opentelemetry-cpp
PORTVERSION=	1.27.0
DISTVERSIONPREFIX=	v
CATEGORIES=	devel

MAINTAINER=	sunpoet@FreeBSD.org
COMMENT=	OpenTelemetry C++ client
WWW=		https://opentelemetry.io/ \
		https://github.com/open-telemetry/opentelemetry-cpp

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/LICENSE

LIB_DEPENDS=	libcurl.so:ftp/curl \
		libgtest.so:devel/googletest \
		libryml.so:devel/rapidyaml
TEST_DEPENDS=	benchmark>=0:devel/benchmark

USES=		cpe cmake:testing compiler:c++17-lang localbase:ldflags

CMAKE_OFF=	BUILD_TESTING \
		BUILD_W3CTRACECONTEXT_TEST \
		OPENTELEMETRY_SKIP_DYNAMIC_LOADING_TESTS \
		OTELCPP_MAINTAINER_MODE \
		TARBALL \
		WITH_ABI_VERSION_2 \
		WITH_API_ONLY \
		WITH_ASYNC_EXPORT_PREVIEW \
		WITH_ELASTICSEARCH \
		WITH_EXAMPLES \
		WITH_EXAMPLES_HTTP \
		WITH_FUNC_TESTS \
		WITH_GSL \
		WITH_METRICS_EXEMPLAR_PREVIEW \
		WITH_NO_DEPRECATED_CODE \
		WITH_NO_GETENV \
		WITH_OPENTRACING \
		WITH_OTLP_FILE \
		WITH_OTLP_GRPC \
		WITH_OTLP_GRPC_CREDENTIAL_PREVIEW \
		WITH_OTLP_GRPC_SSL_MTLS_PREVIEW \
		WITH_OTLP_HTTP \
		WITH_OTLP_HTTP_COMPRESSION \
		WITH_OTLP_RETRY_PREVIEW \
		WITH_PROMETHEUS \
		WITH_RESOURCE_DETECTORS_PREVIEW \
		WITH_THREAD_INSTRUMENTATION_PREVIEW \
		WITH_ZIPKIN
CMAKE_ON=	BUILD_SHARED_LIBS \
		CMAKE_POSITION_INDEPENDENT_CODE \
		OPENTELEMETRY_INSTALL \
		OTELCPP_VERSIONED_LIBS \
		WITH_ABI_VERSION_1 \
		WITH_BENCHMARK \
		WITH_CONFIGURATION \
		WITH_CURL_LOGGING
CMAKE_TESTING_ON=	\
		BUILD_TESTING \
		WITH_FUNC_TESTS
USE_LDCONFIG=	yes

PLIST_SUB=	PORTVERSION=${PORTVERSION}

USE_GITHUB=	yes
GH_ACCOUNT=	open-telemetry

CPE_VENDOR=	cncf

.include <bsd.port.mk>
