mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-09 15:13:31 -04:00
app-admin/ananicy-cpp: Add support for Clang compilation and eBPF implementation
Signed-off-by: Alberto Gireud <agireud@protonmail.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user