diff --git a/app-admin/bpftune/Manifest b/app-admin/bpftune/Manifest new file mode 100644 index 0000000000000..b0c1f595fb01b --- /dev/null +++ b/app-admin/bpftune/Manifest @@ -0,0 +1 @@ +DIST bpftune-0.4-2.gh.tar.gz 1646210 BLAKE2B 3fc5ace8b36da779756c55e6a21a2079fe4f8979501b05563d486077b713c8fc38c42bb6cbb6a5565207bcb0512ac21ed972b70f0ab98ca753d3489a4f5fe365 SHA512 65ce55d446ab347949b5746739f8a555489e00c4bd11e8d4a31b3dcce1d42771d193c89bf471d5c864e38c25fcea9a2a41a6e3e47d17699b4473613bb022a687 diff --git a/app-admin/bpftune/bpftune-0.4_p2.ebuild b/app-admin/bpftune/bpftune-0.4_p2.ebuild new file mode 100644 index 0000000000000..c670999bd0c9e --- /dev/null +++ b/app-admin/bpftune/bpftune-0.4_p2.ebuild @@ -0,0 +1,46 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_COMPAT=( {11..21} ) + +inherit toolchain-funcs llvm-r2 + +MY_PV=${PV/_p/-} +MY_P=${PN}-${MY_PV} +DESCRIPTION="BPF driven auto-tuning" +HOMEPAGE="https://github.com/oracle/bpftune" +SRC_URI="https://github.com/oracle/bpftune/archive/refs/tags/${MY_PV}.tar.gz -> ${MY_P}.gh.tar.gz" +S=${WORKDIR}/${MY_P} + +LICENSE="GPL-2" +SLOT="0/0" +KEYWORDS="~amd64" + +# tests need root +RESTRICT="test" + +DEPEND=" + dev-libs/libbpf:= + sys-libs/libcap:= + dev-util/bpftool + dev-libs/libnl:= +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + $(llvm_gen_dep ' + llvm-core/clang:${LLVM_SLOT}= + llvm-core/llvm:${LLVM_SLOT}= + ') +" + +PATCHES=( + "${FILESDIR}/bpftune-0.4_p2-cflags.patch" +) + +src_compile() { + emake CC="$(tc-getCC)" CLANG="${CHOST}-clang" +} diff --git a/app-admin/bpftune/files/bpftune-0.4_p2-cflags.patch b/app-admin/bpftune/files/bpftune-0.4_p2-cflags.patch new file mode 100644 index 0000000000000..decbc7fb115e9 --- /dev/null +++ b/app-admin/bpftune/files/bpftune-0.4_p2-cflags.patch @@ -0,0 +1,13 @@ +diff --git a/src/Makefile b/src/Makefile +index b42f945..c703321 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -57,7 +57,7 @@ endif + VERSION = 0.4.2 + VERSION_SCRIPT := libbpftune.map + +-CFLAGS = -fPIC -Wall -Wextra -g -I../include -std=c99 ++CFLAGS += -fPIC -Wall -Wextra -g -I../include -std=c99 + + CFLAGS += -DBPFTUNE_VERSION='"$(BPFTUNE_VERSION)"' \ + -DBPFTUNER_PREFIX_DIR='"$(prefix)"' \ diff --git a/app-admin/bpftune/metadata.xml b/app-admin/bpftune/metadata.xml new file mode 100644 index 0000000000000..74ae4dcd170fe --- /dev/null +++ b/app-admin/bpftune/metadata.xml @@ -0,0 +1,11 @@ + + + + + chutzpah@gentoo.org + Patrick McLean + + + oracle/bpftune + +