public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Andrew Ammerlaan" <andrewammerlaan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/guru:master commit in: app-admin/ananicy-cpp/
Date: Thu,  7 Mar 2024 11:34:26 +0000 (UTC)	[thread overview]
Message-ID: <1709784374.af85370459af3a4b5244cf8e6642ed7773afc94d.andrewammerlaan@gentoo> (raw)

commit:     af85370459af3a4b5244cf8e6642ed7773afc94d
Author:     Alberto Gireud <agireud <AT> protonmail <DOT> com>
AuthorDate: Thu Mar  7 03:49:13 2024 +0000
Commit:     Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Thu Mar  7 04:06:14 2024 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=af853704

app-admin/ananicy-cpp: Add support for Clang compilation and eBPF implementation

Signed-off-by: Alberto Gireud <agireud <AT> protonmail.com>

 ...1.1.1-r2.ebuild => ananicy-cpp-1.1.1-r3.ebuild} | 39 ++++++++++++++++++++--
 app-admin/ananicy-cpp/metadata.xml                 |  4 +++
 2 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/app-admin/ananicy-cpp/ananicy-cpp-1.1.1-r2.ebuild b/app-admin/ananicy-cpp/ananicy-cpp-1.1.1-r3.ebuild
similarity index 55%
rename from app-admin/ananicy-cpp/ananicy-cpp-1.1.1-r2.ebuild
rename to app-admin/ananicy-cpp/ananicy-cpp-1.1.1-r3.ebuild
index e97720ff94..abefa9baaf 100644
--- a/app-admin/ananicy-cpp/ananicy-cpp-1.1.1-r2.ebuild
+++ b/app-admin/ananicy-cpp/ananicy-cpp-1.1.1-r3.ebuild
@@ -10,32 +10,65 @@ HOMEPAGE="https://gitlab.com/ananicy-cpp/ananicy-cpp"
 LICENSE="GPL-3"
 SLOT="0"
 KEYWORDS="~amd64"
-IUSE="systemd"
+IUSE="bpf clang systemd"
+REQUIRED_USE="
+	bpf? ( clang )
+"
 
 SRC_URI="https://gitlab.com/ananicy-cpp/ananicy-cpp/-/archive/v${PV}/${PN}-v${PV}.tar.bz2"
 S="${WORKDIR}/${PN}-v${PV}"
 
-DEPEND="
+RDEPEND="
 	!app-admin/ananicy
 	>=dev-cpp/nlohmann_json-3.9
 	>=dev-libs/libfmt-8
 	>=dev-libs/spdlog-1.9
+	bpf? (
+		 dev-libs/elfutils
+		 dev-libs/libbpf
+		 dev-util/bpftool
+	)
 	systemd? ( sys-apps/systemd )
 "
-RDEPEND="${DEPEND}"
+
+DEPEND="
+	>=dev-build/cmake-3.17
+	clang? ( >=sys-devel/clang-10 )
+	${RDEPEND}
+"
 
 PATCHES=(
 	"${FILESDIR}/${P}-remove-debug-flags.patch"
 )
 
+pkg_setup() {
+	if use bpf ; then
+		CONFIG_CHECK+="~BPF ~BPF_EVENTS ~BPF_SYSCALL ~HAVE_EBPF_JIT"
+	fi
+}
+
 src_configure() {
 	local mycmakeargs=(
 		-DENABLE_SYSTEMD=$(usex systemd)
+		-DUSE_BPF_PROC_IMPL=$(usex bpf)
 		-DUSE_EXTERNAL_FMTLIB=ON
 		-DUSE_EXTERNAL_JSON=ON
 		-DUSE_EXTERNAL_SPDLOG=ON
 		-DVERSION=${PV}
 	)
+
+	if use clang; then
+		local version_clang=$(clang --version 2>/dev/null | grep -F -- 'clang version' | awk '{ print $3 }')
+		[[ -n ${version_clang} ]] && version_clang=$(ver_cut 1 "${version_clang}")
+		[[ -z ${version_clang} ]] && die "Failed to read clang version!"
+		CC=${CHOST}-clang-${version_clang}
+		CXX=${CHOST}-clang++-${version_clang}
+
+		if use bpf ; then
+			mycmakeargs+=( -DBPF_BUILD_LIBBPF=OFF )
+		fi
+	fi
+
 	cmake_src_configure
 }
 

diff --git a/app-admin/ananicy-cpp/metadata.xml b/app-admin/ananicy-cpp/metadata.xml
index 52724a1795..59b0456acf 100644
--- a/app-admin/ananicy-cpp/metadata.xml
+++ b/app-admin/ananicy-cpp/metadata.xml
@@ -10,4 +10,8 @@
     <remote-id type="gitlab">ananicy-cpp/ananicy-cpp</remote-id>
     <remote-id type="github">kuche1/minq-ananicy</remote-id>
   </upstream>
+  <use>
+    <flag name="bpf">Use eBPF for processing</flag>
+    <flag name="clang">Use Clang compiler instead of GCC</flag>
+  </use>
 </pkgmetadata>


             reply	other threads:[~2024-03-07 11:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07 11:34 Andrew Ammerlaan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-25 16:41 [gentoo-commits] repo/proj/guru:dev commit in: app-admin/ananicy-cpp/ Julien Roy
2024-03-25 16:52 ` [gentoo-commits] repo/proj/guru:master " Julien Roy
2024-03-06  0:48 Julien Roy
2024-03-04 21:09 Julien Roy
2024-03-04 21:09 Julien Roy
2024-03-04 21:09 Julien Roy
2023-09-14 13:22 David Roman
2022-06-06 16:28 Florian Schmaus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1709784374.af85370459af3a4b5244cf8e6642ed7773afc94d.andrewammerlaan@gentoo \
    --to=andrewammerlaan@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox