summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <patrick.mclean@sony.com>2019-04-04 15:26:51 -0700
committerPatrick McLean <chutzpah@gentoo.org>2019-04-04 15:27:15 -0700
commit389ef0393e966b8367e6d0dfd8404ce35352a37e (patch)
tree5f955277a1e34861aa5d21c8393d81657a6861d4 /dev-libs/libbpf
parentdev-libs/cloog: switch to https:// schema, bug #682502 (diff)
downloadgentoo-389ef0393e966b8367e6d0dfd8404ce35352a37e.tar.gz
gentoo-389ef0393e966b8367e6d0dfd8404ce35352a37e.tar.bz2
gentoo-389ef0393e966b8367e6d0dfd8404ce35352a37e.zip
dev-libs/libbpf: Version bump to 0.20190404
Copyright: Sony Interactive Entertainment Inc. Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-libs/libbpf')
-rw-r--r--dev-libs/libbpf/Manifest1
-rw-r--r--dev-libs/libbpf/files/libbpf-0.20190404-makefile.patch16
-rw-r--r--dev-libs/libbpf/libbpf-0.20190404.ebuild68
3 files changed, 85 insertions, 0 deletions
diff --git a/dev-libs/libbpf/Manifest b/dev-libs/libbpf/Manifest
index 27e7e9bf4c98..eed781dd6e09 100644
--- a/dev-libs/libbpf/Manifest
+++ b/dev-libs/libbpf/Manifest
@@ -1 +1,2 @@
DIST libbpf-0.20190311.tar.gz 110782 BLAKE2B b660b2677abd3068aa37f390e817c755ee06cf683e357cad6a9537d8e509d53f24ac66e472148f5b66cbcdca7849db10fc34ff8e6f85bd54a0570a52846ff933 SHA512 dbac8efce3b4c6d4faf40b22de6f71bee630fc8b71aa96e13692ffff0474ed7aa5f66a3c1f5871ec1c27dc71b87bec3ce5138096590fb9238d4d696a722f358d
+DIST libbpf-0.20190404.tar.gz 115495 BLAKE2B a159d75163cee051e7784c20018020e650d88e3b011928b1a748199f88b22de713000d3557d083cbbfc3450b6ded9b891d0afb487611044cf2af93fd5691ff8c SHA512 724fe12c9a028a9b6d5a05ee679a3c7f687a32f403bbee3c90730005dac20e0a5e9e6c21df02780d329a88acf4ec525411e448f537b49ce2767de8eae6012661
diff --git a/dev-libs/libbpf/files/libbpf-0.20190404-makefile.patch b/dev-libs/libbpf/files/libbpf-0.20190404-makefile.patch
new file mode 100644
index 000000000000..7bfe5eb6335f
--- /dev/null
+++ b/dev-libs/libbpf/files/libbpf-0.20190404-makefile.patch
@@ -0,0 +1,16 @@
+diff --git a/Makefile b/src/Makefile
+index 35b4818..c034531 100644
+--- a/Makefile
++++ b/Makefile
+@@ -36,7 +36,10 @@ OBJDIR ?= .
+ OBJS := $(addprefix $(OBJDIR)/,bpf.o btf.o libbpf.o libbpf_errno.o netlink.o \
+ nlattr.o str_error.o libbpf_probes.o bpf_prog_linfo.o xsk.o)
+
+-LIBS := $(OBJDIR)/libbpf.a
++ifdef BUILD_STATIC
++ LIBS := $(OBJDIR)/libbpf.a
++endif
++
+ ifndef BUILD_STATIC_ONLY
+ LIBS += $(OBJDIR)/libbpf.so \
+ $(OBJDIR)/libbpf.so.$(VERSION) \
diff --git a/dev-libs/libbpf/libbpf-0.20190404.ebuild b/dev-libs/libbpf/libbpf-0.20190404.ebuild
new file mode 100644
index 000000000000..2ffb199b195b
--- /dev/null
+++ b/dev-libs/libbpf/libbpf-0.20190404.ebuild
@@ -0,0 +1,68 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs
+
+EGIT_COMMIT="7c27c6306160f630c3c4f4b4971deb657126d681"
+
+HOMEPAGE="https://github.com/libbpf/libbpf"
+DESCRIPTION="Stand-alone build of libbpf from the Linux kernel"
+SRC_URI="https://github.com/${PN}/${PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2 LGPL-2.1 BSD-2"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~x86"
+IUSE="static-libs"
+
+COMMON_DEPEND="virtual/libelf
+ !<=dev-util/bcc-0.7.0"
+DEPEND="${COMMON_DEPEND}
+ sys-kernel/linux-headers"
+RDEPEND="${COMMON_DEPEND}"
+
+S="${WORKDIR}/${PN}-${EGIT_COMMIT}/src"
+
+PATCHES=(
+ "${FILESDIR}/libbpf-0.20190404-makefile.patch"
+)
+
+src_prepare() {
+ # upstream doesn't provide a pkgconfig file, so
+ # let's make one
+ printf 'prefix=/usr\nexec_prefix=${prefix}\nlibdir=%s\n' \
+ "/usr/$(get_libdir)" \
+ > ${PN}.pc
+ printf 'includedir=${prefix}/include\n\n' \
+ >> ${PN}.pc
+
+ printf 'Name: %s\nDescription: %s\nVersion: %s\nLibs: -lbpf %s\n' \
+ "${PN}" \
+ "${DESCRIPTION}" \
+ "${PV}" \
+ "$($(tc-getPKG_CONFIG) --libs libelf)" \
+ >> ${PN}.pc
+
+ default
+}
+
+src_compile() {
+ emake \
+ BUILD_SHARED=y \
+ LIBSUBDIR="$(get_libdir)" \
+ $(usex static-libs 'BUILD_STATIC=y' '' '' '') \
+ CC="$(tc-getCC)"
+}
+
+src_install() {
+ emake \
+ BUILD_SHARED=y \
+ LIBSUBDIR="$(get_libdir)" \
+ DESTDIR="${D}" \
+ $(usex static-libs 'BUILD_STATIC=y' '' '' '') \
+ install
+
+ insinto /usr/$(get_libdir)/pkgconfig
+ doins ${PN}.pc
+}