summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2022-05-03 23:28:06 -0700
committerPatrick McLean <chutzpah@gentoo.org>2022-05-03 23:28:30 -0700
commit2972cf1653cb4adbd4b6dea1722a0300b4b484b1 (patch)
treed2bd2c797a6b92fdc65bdef4046123488e12bc98 /dev-cpp/opentelemetry-cpp
parentprofiles/base: update firefox[system-python-libs] use flag mask (diff)
downloadgentoo-2972cf1653cb4adbd4b6dea1722a0300b4b484b1.tar.gz
gentoo-2972cf1653cb4adbd4b6dea1722a0300b4b484b1.tar.bz2
gentoo-2972cf1653cb4adbd4b6dea1722a0300b4b484b1.zip
dev-cpp/opentelemetry-cpp: new package, add 1.3.0
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-cpp/opentelemetry-cpp')
-rw-r--r--dev-cpp/opentelemetry-cpp/Manifest1
-rw-r--r--dev-cpp/opentelemetry-cpp/files/opentelemetry-cpp-1.3.0-tests.patch92
-rw-r--r--dev-cpp/opentelemetry-cpp/metadata.xml12
-rw-r--r--dev-cpp/opentelemetry-cpp/opentelemetry-cpp-1.3.0.ebuild48
4 files changed, 153 insertions, 0 deletions
diff --git a/dev-cpp/opentelemetry-cpp/Manifest b/dev-cpp/opentelemetry-cpp/Manifest
new file mode 100644
index 000000000000..81ee9b9a56ff
--- /dev/null
+++ b/dev-cpp/opentelemetry-cpp/Manifest
@@ -0,0 +1 @@
+DIST opentelemetry-cpp-1.3.0.tar.gz 710030 BLAKE2B 56aa3213fd9c9ac5266197c2ca417f5ff181ca28016033c9320e63122eaf9a53bdb265e1778227a9036bc42f8837755a3009cb23610268bc03b9fb24b3844c82 SHA512 38f613c208ec847c8bf7765732d8198fcc427c293a929945d72c2f739e89d2a0ad36be4d94cc3c1b77fd7b1f1d1e5d8bdb38094a493ba3da3125281cd1016836
diff --git a/dev-cpp/opentelemetry-cpp/files/opentelemetry-cpp-1.3.0-tests.patch b/dev-cpp/opentelemetry-cpp/files/opentelemetry-cpp-1.3.0-tests.patch
new file mode 100644
index 000000000000..a1ef0ff1d3cd
--- /dev/null
+++ b/dev-cpp/opentelemetry-cpp/files/opentelemetry-cpp-1.3.0-tests.patch
@@ -0,0 +1,92 @@
+diff --git a/ext/test/http/curl_http_test.cc b/ext/test/http/curl_http_test.cc
+index f8d248b..9a5be49 100644
+--- a/ext/test/http/curl_http_test.cc
++++ b/ext/test/http/curl_http_test.cc
+@@ -187,50 +187,6 @@ TEST_F(BasicCurlHttpTests, HttpResponse)
+ ASSERT_EQ(count, 4);
+ }
+
+-TEST_F(BasicCurlHttpTests, SendGetRequest)
+-{
+- received_requests_.clear();
+- auto session_manager = http_client::HttpClientFactory::Create();
+- EXPECT_TRUE(session_manager != nullptr);
+-
+- auto session = session_manager->CreateSession("http://127.0.0.1:19000");
+- auto request = session->CreateRequest();
+- request->SetUri("get/");
+- GetEventHandler *handler = new GetEventHandler();
+- session->SendRequest(*handler);
+- ASSERT_TRUE(waitForRequests(30, 1));
+- session->FinishSession();
+- ASSERT_TRUE(handler->is_called_);
+- delete handler;
+-}
+-
+-TEST_F(BasicCurlHttpTests, SendPostRequest)
+-{
+- received_requests_.clear();
+- auto session_manager = http_client::HttpClientFactory::Create();
+- EXPECT_TRUE(session_manager != nullptr);
+-
+- auto session = session_manager->CreateSession("http://127.0.0.1:19000");
+- auto request = session->CreateRequest();
+- request->SetUri("post/");
+- request->SetMethod(http_client::Method::Post);
+-
+- const char *b = "test-data";
+- http_client::Body body = {b, b + strlen(b)};
+- request->SetBody(body);
+- request->AddHeader("Content-Type", "text/plain");
+- PostEventHandler *handler = new PostEventHandler();
+- session->SendRequest(*handler);
+- ASSERT_TRUE(waitForRequests(30, 1));
+- session->FinishSession();
+- ASSERT_TRUE(handler->is_called_);
+-
+- session_manager->CancelAllSessions();
+- session_manager->FinishAllSessions();
+-
+- delete handler;
+-}
+-
+ TEST_F(BasicCurlHttpTests, RequestTimeout)
+ {
+ received_requests_.clear();
+@@ -271,17 +227,6 @@ TEST_F(BasicCurlHttpTests, CurlHttpOperations)
+ delete handler;
+ }
+
+-TEST_F(BasicCurlHttpTests, SendGetRequestSync)
+-{
+- received_requests_.clear();
+- curl::HttpClientSync http_client;
+-
+- http_client::Headers m1 = {};
+- auto result = http_client.Get("http://127.0.0.1:19000/get/", m1);
+- EXPECT_EQ(result, true);
+- EXPECT_EQ(result.GetSessionState(), http_client::SessionState::Response);
+-}
+-
+ TEST_F(BasicCurlHttpTests, SendGetRequestSyncTimeout)
+ {
+ received_requests_.clear();
+@@ -296,18 +241,6 @@ TEST_F(BasicCurlHttpTests, SendGetRequestSyncTimeout)
+ result.GetSessionState() == http_client::SessionState::SendFailed);
+ }
+
+-TEST_F(BasicCurlHttpTests, SendPostRequestSync)
+-{
+- received_requests_.clear();
+- curl::HttpClientSync http_client;
+-
+- http_client::Headers m1 = {};
+- http_client::Body body = {};
+- auto result = http_client.Post("http://127.0.0.1:19000/post/", body, m1);
+- EXPECT_EQ(result, true);
+- EXPECT_EQ(result.GetSessionState(), http_client::SessionState::Response);
+-}
+-
+ TEST_F(BasicCurlHttpTests, GetBaseUri)
+ {
+ curl::HttpClient session_manager;
diff --git a/dev-cpp/opentelemetry-cpp/metadata.xml b/dev-cpp/opentelemetry-cpp/metadata.xml
new file mode 100644
index 000000000000..c4293b76629d
--- /dev/null
+++ b/dev-cpp/opentelemetry-cpp/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>chutzpah@gentoo.org</email>
+ <name>Patrick McLean</name>
+ </maintainer>
+ <use>
+ <flag name="jaeger">Include the jaeger 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.3.0.ebuild b/dev-cpp/opentelemetry-cpp/opentelemetry-cpp-1.3.0.ebuild
new file mode 100644
index 000000000000..011b5b0e193c
--- /dev/null
+++ b/dev-cpp/opentelemetry-cpp/opentelemetry-cpp-1.3.0.ebuild
@@ -0,0 +1,48 @@
+# Copyright 2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+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"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+jaeger prometheus test"
+
+RDEPEND="
+ net-misc/curl:=
+"
+DEPEND="
+ ${RDEPEND}
+ test? (
+ dev-cpp/gtest
+ dev-cpp/benchmark
+ )
+"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+ # remove tests the need network
+ "${FILESDIR}/opentelemetry-cpp-1.3.0-tests.patch"
+)
+
+src_configure() {
+ local -a mycmakeargs=(
+ -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
+ -DBUILD_SHARED_LIBS:BOOL=ON
+ -DBUILD_TESTING:BOOL=$(usex test)
+ -DWITH_JAEGER:BOOL=$(usex jaeger)
+ -DWITH_PROMETHEUS:BOOL=$(usex prometheus)
+ )
+
+ cmake_src_configure
+}