commit:     61c0c5361c541093efe945b57a43314c3118116c
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Sat Sep 13 14:01:00 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Sep 20 22:24:56 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61c0c536

dev-cpp/opentelemetry-cpp: add 1.22.0

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43853
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-cpp/opentelemetry-cpp/Manifest                 |   2 +
 dev-cpp/opentelemetry-cpp/metadata.xml             |   4 +
 .../opentelemetry-cpp-1.22.0.ebuild                | 120 +++++++++++++++++++++
 3 files changed, 126 insertions(+)

diff --git a/dev-cpp/opentelemetry-cpp/Manifest 
b/dev-cpp/opentelemetry-cpp/Manifest
index f5aa9d8052f1..bb0a26952a6d 100644
--- a/dev-cpp/opentelemetry-cpp/Manifest
+++ b/dev-cpp/opentelemetry-cpp/Manifest
@@ -1,5 +1,7 @@
 DIST opentelemetry-cpp-1.16.1.tar.gz 904173 BLAKE2B 
7f63ddd1b4305d6c98ad4a8c52ad12bbdbd8a2b125f2143978873dff4a94675bf644bcba609bc7de65868a34b530a0930be5a836e4ff05f476d5643ae3294b90
 SHA512 
c93005c9b24b358a9998141f6c7fd9675778731775dacaad18f0e81117fd00aaabff371c04cf96688a9c86117727181052a141d961d4db28fc457b454351c570
 DIST opentelemetry-cpp-1.20.0.tar.gz 1115605 BLAKE2B 
938fb90e203613e1beb193b28b0232423cbd111b6d9490fd12d706836619eb7fa01d9a625dd1b56fd91a355d49f916b4ccda58d76a862408505467dd2e33a2da
 SHA512 
db9745be96907431c32a69230b29a5bddba0654f3f379f6cd0827f44895ef39c9612381303ec239d6ad98920bcc4006a90e25b715ade9ddf30aff843d1931416
+DIST opentelemetry-cpp-1.22.0.tar.gz 1125051 BLAKE2B 
40c9824b348a2d72d591aac3f5640cc7a0af77b8b4046acf39d1ced6fcfebb666dae40eb3f4e5f1d739e0b4105e54ca0eaeefc7ef443cd1935e3b1bcb6f32e63
 SHA512 
a85869d2858f350e4a3b85e5d68e669a5fff42a2222ba7782bba92f5fe6856a110b3ddc9744a6c3e68c1ddfdc7bdb2b570bbeff78275a4e98cea889a8fda0120
 DIST opentelemetry-cpp-1.3.0.tar.gz 710030 BLAKE2B 
56aa3213fd9c9ac5266197c2ca417f5ff181ca28016033c9320e63122eaf9a53bdb265e1778227a9036bc42f8837755a3009cb23610268bc03b9fb24b3844c82
 SHA512 
38f613c208ec847c8bf7765732d8198fcc427c293a929945d72c2f739e89d2a0ad36be4d94cc3c1b77fd7b1f1d1e5d8bdb38094a493ba3da3125281cd1016836
 DIST opentelemetry-cpp-1.4.0.tar.gz 722520 BLAKE2B 
c34867846708218e5ffcff9cdaa275e0c43201f681a68ad697d9f83ac04b7fdc6cdb69d942274cbe200b241e407ba11218c7e92da4f9adf4490e89c06388347f
 SHA512 
a2339c0f9b2dc0d4f1964536a844241436bd68774445a0eab6e89e51965e01d3c40d2aa776d751eb497c50e9fdaa4e0023095efb14c8abbd6bbe23a2596eb3c9
 DIST opentelemetry-cpp-1.6.0.tar.gz 790774 BLAKE2B 
9512c092bfe49c9da82eff3950204c1f2eb654df2ed428e58ceb8877d15d80d9978fa6da37f7780352538c74de04bac69660528b255dfbce743f89b9d4020dd2
 SHA512 
ae0777451a3d2d676afd9f3142ab78c7afb08474f6038bd810ff0ee30fee6695e10100c901e7ffadf3faf16c7d19622acdea414cd720be8572f7720f2d528628
+DIST opentelemetry-proto-1.7.0.tar.gz 127009 BLAKE2B 
c0d5d5a24104cb62537abe8922e1b165fd58670efe549d82fe3295f9017de71077e77a173eca42ef1a339f92960f172f449dc2ba82d75fe5b8dc1ee88996c188
 SHA512 
488ebeab036c4d202ff40a3c21fdbb6f0ab58338e680240d47ae439d5975da3ff31114325a10c8ca18d3034ed15b1b86454d853405c460891c202e3b4b8c000e

diff --git a/dev-cpp/opentelemetry-cpp/metadata.xml 
b/dev-cpp/opentelemetry-cpp/metadata.xml
index 952c39c94bd8..95134574e683 100644
--- a/dev-cpp/opentelemetry-cpp/metadata.xml
+++ b/dev-cpp/opentelemetry-cpp/metadata.xml
@@ -9,7 +9,11 @@
                <name>Patrick McLean</name>
        </maintainer>
        <use>
+               <flag name="elasticsearch">Build support for the elasticsearch 
exporter</flag>
+               <flag name="grpc">Build support for the OTLP (OpenTelemetry 
Protocol) GRPC exporter</flag>
+               <flag name="http">Build support for the OTLP (OpenTelemetry 
Protocol) HTTP exporter</flag>
                <flag name="jaeger">Include the jaeger exporter</flag>
+               <flag name="otlp">Build support for the OTLP (OpenTelemetry 
Protocol) File exporter</flag>
                <flag name="prometheus">include the Prometheus Client in the 
SDK</flag>
        </use>
 </pkgmetadata>

diff --git a/dev-cpp/opentelemetry-cpp/opentelemetry-cpp-1.22.0.ebuild 
b/dev-cpp/opentelemetry-cpp/opentelemetry-cpp-1.22.0.ebuild
new file mode 100644
index 000000000000..ab64d6bff5f5
--- /dev/null
+++ b/dev-cpp/opentelemetry-cpp/opentelemetry-cpp-1.22.0.ebuild
@@ -0,0 +1,120 @@
+# Copyright 2022-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# update based on third_party_release
+OPENTELEMETRY_PROTO="1.7.0"
+
+inherit cmake
+
+DESCRIPTION="The OpenTelemetry C++ Client"
+HOMEPAGE="
+       https://opentelemetry.io/
+       https://github.com/open-telemetry/opentelemetry-cpp/
+"
+SRC_URI="
+       https://github.com/open-telemetry/${PN}/archive/refs/tags/v${PV}.tar.gz
+               -> ${P}.tar.gz
+       otlp? (
+               
https://github.com/open-telemetry/opentelemetry-proto/archive/refs/tags/v${OPENTELEMETRY_PROTO}.tar.gz
+                       -> opentelemetry-proto-${OPENTELEMETRY_PROTO}.tar.gz
+       )
+"
+
+LICENSE="Apache-2.0"
+SLOT="0/1"
+KEYWORDS="~amd64 ~arm64 ~ppc64"
+
+IUSE="elasticsearch grpc http otlp prometheus test"
+REQUIRED_USE="
+       grpc? ( otlp )
+       http? ( otlp )
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       http? (
+               net-misc/curl
+               sys-libs/zlib
+       )
+       elasticsearch? (
+               dev-cpp/nlohmann_json
+               net-misc/curl
+       )
+       grpc? ( net-libs/grpc:= )
+       otlp? (
+               dev-cpp/abseil-cpp:=
+               dev-libs/protobuf:=[libprotoc(+)]
+               dev-cpp/nlohmann_json
+       )
+       prometheus? ( dev-cpp/prometheus-cpp )
+"
+DEPEND="
+       ${RDEPEND}
+       test? ( dev-cpp/gtest )
+"
+BDEPEND="
+       virtual/pkgconfig
+       otlp? ( dev-libs/protobuf[protoc(+)] )
+"
+
+src_configure() {
+       # sanity check subslot to kick would be drive by bumpers
+       # 
https://github.com/open-telemetry/opentelemetry-cpp/blob/main/docs/abi-version-policy.md
+       local detected_abi
+       detected_abi="$(sed -n -e 's/^#  define OPENTELEMETRY_ABI_VERSION_NO 
\(.*\)/\1/p' \
+               api/include/opentelemetry/version.h)"
+       detected_abi="${detected_abi}"
+       if [[ "${SLOT}" != "0/${detected_abi}" ]]; then
+               die "SLOT ${SLOT} doesn't match upstream specified ABI 
${detected_abi}."
+       fi
+
+       local detected_proto_ver
+       detected_proto_ver="$(sed -n -e '/^opentelemetry-proto=/p' 
third_party_release)"
+       if [[ "${OPENTELEMETRY_PROTO}" != 
"${detected_proto_ver#opentelemetry-proto=v}" ]]; then
+               die "OPENTELEMETRY_PROTO=${OPENTELEMETRY_PROTO} doesn't match 
upstream specified ${detected_proto_ver}"
+       fi
+
+       local mycmakeargs=(
+               -DBUILD_TESTING=$(usex test)
+               -DWITH_BENCHMARK=OFF # benchmark tests dont make sense in 
ebuilds
+               -DBUILD_W3CTRACECONTEXT_TEST=OFF # network-sandbox breaking 
tests
+               -DWITH_FUNC_TESTS=ON
+
+               -DOTELCPP_VERSIONED_LIBS=ON
+               -DOTELCPP_MAINTAINER_MODE=OFF
+               -DOPENTELEMETRY_INSTALL=ON
+               -DWITH_STL=ON
+               -DWITH_GSL=OFF
+
+               -DWITH_API_ONLY=OFF
+
+               -DWITH_ELASTICSEARCH=$(usex elasticsearch)
+               -DWITH_PROMETHEUS=$(usex prometheus)
+               -DWITH_OPENTRACING=OFF # unpackaged
+               -DWITH_ZIPKIN=OFF # unpackaged
+               -DWITH_ETW=OFF # unpackaged
+
+               # 
https://github.com/open-telemetry/opentelemetry-cpp/blob/main/exporters/otlp/README.md
+               # file exporter can be built separately to the other exporter.
+               # Its just simpler dependency wise to have a "otlp" use flag 
that the other exporter require.
+               -DWITH_OTLP_FILE=$(usex otlp)
+               -DWITH_OTLP_GRPC=$(usex grpc)
+               -DWITH_OTLP_HTTP=$(usex http)
+               -DWITH_OTLP_HTTP_COMPRESSION=ON # zlib is in the system set
+       )
+       use otlp && mycmakeargs+=( 
-DOTELCPP_PROTO_PATH="${WORKDIR}"/opentelemetry-proto-${OPENTELEMETRY_PROTO} )
+
+       cmake_src_configure
+}
+
+src_test() {
+       local CMAKE_SKIP_TESTS=(
+               # needs a running prometheus instance
+               exporter.PrometheusExporter.ShutdownSetsIsShutdownToTrue
+       )
+
+       # curl tests fragile
+       cmake_src_test -j1
+}

Reply via email to