commit:     5d22ff4feb4aef6552ba0f27521e01001b7a849d
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 14 19:12:54 2021 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Sep 21 00:37:07 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d22ff4f

dev-libs/libbpf: Port to EAPI 8

- Reorder variables per skel.ebuild
- Drop redundant COMMON_DEPEND
- Export CC, AR and other variables instead of passing them directly to emake
- Drop USE=static-libs, since the build-system doesn't offer a way to build only
  shared library, so let's just install both libraries unconditionally

Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 dev-libs/libbpf/libbpf-9999.ebuild | 38 +++++++++++++++++---------------------
 1 file changed, 17 insertions(+), 21 deletions(-)

diff --git a/dev-libs/libbpf/libbpf-9999.ebuild 
b/dev-libs/libbpf/libbpf-9999.ebuild
index a122d56cb68..2b8fd07a6a9 100644
--- a/dev-libs/libbpf/libbpf-9999.ebuild
+++ b/dev-libs/libbpf/libbpf-9999.ebuild
@@ -1,7 +1,7 @@
 # Copyright 2019-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=7
+EAPI=8
 
 inherit flag-o-matic toolchain-funcs
 
@@ -10,46 +10,42 @@ if [[ ${PV} =~ [9]{4,} ]]; then
        EGIT_REPO_URI="https://github.com/libbpf/libbpf.git";
 else
        SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
-       KEYWORDS="~amd64 ~arm64 ~x86"
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 
~riscv ~s390 ~sparc ~x86"
 fi
 S="${WORKDIR}/${P}/src"
 
-HOMEPAGE="https://github.com/libbpf/libbpf";
 DESCRIPTION="Stand-alone build of libbpf from the Linux kernel"
+HOMEPAGE="https://github.com/libbpf/libbpf";
 
 LICENSE="GPL-2 LGPL-2.1 BSD-2"
 SLOT="0/${PV}"
-IUSE="+static-libs"
+IUSE="static-libs"
 
-COMMON_DEPEND="virtual/libelf
-       !<=dev-util/bcc-0.7.0"
-DEPEND="${COMMON_DEPEND}
-       sys-kernel/linux-headers"
-RDEPEND="${COMMON_DEPEND}"
+DEPEND="
+       sys-kernel/linux-headers
+       virtual/libelf"
+RDEPEND="${DEPEND}"
 
 PATCHES=(
-       "${FILESDIR}/libbpf-9999-paths.patch"
+       "${FILESDIR}"/libbpf-9999-paths.patch
 )
 
-src_compile() {
+src_configure() {
        append-cflags -fPIC
-       emake \
-               BUILD_SHARED=y \
-               LIBSUBDIR="$(get_libdir)" \
-               $(usex static-libs 'BUILD_STATIC=y' '' '' '') \
-               CC="$(tc-getCC)" \
-               AR="$(tc-getAR)" \
-               V=1
+       tc-export CC AR
+       export LIBSUBDIR="$(get_libdir)"
+       export V=1
 }
 
 src_install() {
        emake \
-               BUILD_SHARED=y \
-               LIBSUBDIR="$(get_libdir)" \
                DESTDIR="${D}" \
-               $(usex static-libs 'BUILD_STATIC=y' '' '' '') \
                install install_uapi_headers
 
+       if ! use static-libs; then
+               find "${ED}" -name '*.a' -delete || die
+       fi
+
        insinto /usr/$(get_libdir)/pkgconfig
        doins ${PN}.pc
 }

Reply via email to