commit:     bf4fceea4680d3e25627149c1b0ffba102e2ab33
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Wed Mar 13 21:12:07 2019 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed Mar 13 21:12:25 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf4fceea

dev-util/bcc: Make 0.9.0 work with <5.0 kernels, add maintainer

The 0.9.0 release requires bpf.h from 5.0 kernels to compile, but will
otherwise work on 4.18+ kernels. This adds a patch that just patches in
the 5.0 version of bpf.h when linux-headers is less than 5.0.

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.62, Repoman-2.3.12
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 dev-util/bcc/Manifest            |  1 +
 dev-util/bcc/bcc-0.9.0-r1.ebuild | 11 ++++++++++-
 dev-util/bcc/metadata.xml        |  3 +++
 3 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/dev-util/bcc/Manifest b/dev-util/bcc/Manifest
index a4b0f0db8d9..136c3b7aa67 100644
--- a/dev-util/bcc/Manifest
+++ b/dev-util/bcc/Manifest
@@ -1,3 +1,4 @@
 DIST bcc-0.6.0.tar.gz 1986593 BLAKE2B 
514c2c781eb94d99560232d8050b5664ce3565622b236e78cd111be27b3482849965600a1d574f59243917672f00bb3cef65cab63103f6c4a5cf62024c683d9b
 SHA512 
1a8edf6da22f3119a74cf43f03ec83b97ed2f6fc18828d750d8a695ac1451b6b3209e5d2cf48bc87f53fa9447e8813a018a58d31588d477e4aa364a2d0217e80
 DIST bcc-0.7.0.tar.gz 2009289 BLAKE2B 
370b553521289d983d1165633e76a5e405250b9b09dbf3e78c127d232908e73facce06097ce4dbf0bbccda929b6715a9b7460affe123556087c8ca00b8d62c0b
 SHA512 
ebe6c4cbecba2d587c69af71ddc8cb451b2b8e1d49ef887f291c813320c2c60d49357500fc2751d5b418df2be1d02763c385d89de6efa6e10f049c25acf01b4e
+DIST bcc-0.9.0-linux-5-bpf.patch.xz 28524 BLAKE2B 
f0369e50eabd7b1eb9a492b9652cd7647c7c7fda3b01db1e7f2bf716e76357d07d67193b31189b98309e26895ac3dd5c755d4cef6bc592e4674f40710c33539c
 SHA512 
fc5b828a5826da2cf1e1a76758c635f5443d202aecbe3f269d78abcaa0117ad7658bea6c43e7b60e1ecc6bcc65bd19b100217758a1203d278ddb03c5837c43f1
 DIST bcc-0.9.0.tar.gz 2036984 BLAKE2B 
cebbeb57f06af90442d28be1633a54c198bf796786c4fcca3a83dea03bc76949f958dd24f7d85feb2e3402576410f965754f3d031076486b7d378493c56035e8
 SHA512 
373080181380ec3bcb13469e29ff1f792e924a2df00a614da4647ed54060ad216525dd0f49c5d0afba7946a6d2f4e3475af97250a33db825945af3d165294091

diff --git a/dev-util/bcc/bcc-0.9.0-r1.ebuild b/dev-util/bcc/bcc-0.9.0-r1.ebuild
index 421f8729ea5..f23a490a902 100644
--- a/dev-util/bcc/bcc-0.9.0-r1.ebuild
+++ b/dev-util/bcc/bcc-0.9.0-r1.ebuild
@@ -10,7 +10,8 @@ inherit cmake-utils linux-info python-single-r1 
python-utils-r1
 DESCRIPTION="Tools for BPF-based Linux IO analysis, networking, monitoring, 
and more"
 HOMEPAGE="https://iovisor.github.io/bcc/";
 EGIT_COMMIT="v${PV}"
-SRC_URI="https://github.com/iovisor/bcc/archive/${EGIT_COMMIT}.tar.gz -> 
${P}.tar.gz"
+SRC_URI="https://github.com/iovisor/bcc/archive/${EGIT_COMMIT}.tar.gz -> 
${P}.tar.gz
+       mirror://gentoo/bcc-0.9.0-linux-5-bpf.patch.xz"
 RESTRICT="test"
 
 LICENSE="Apache-2.0"
@@ -49,6 +50,14 @@ pkg_setup() {
        python-single-r1_pkg_setup
 }
 
+src_prepare() {
+       # needs bpf.h from linux-5.0 to build
+       has_version '>=sys-kernel/linux-headers-5.0' || \
+               eapply "${WORKDIR}/bcc-0.9.0-linux-5-bpf.patch"
+
+       cmake-utils_src_prepare
+}
+
 src_configure() {
        local mycmakeargs=(
                -DREVISION=${PV%%_*}

diff --git a/dev-util/bcc/metadata.xml b/dev-util/bcc/metadata.xml
index 43eb746c3b0..4611e015755 100644
--- a/dev-util/bcc/metadata.xml
+++ b/dev-util/bcc/metadata.xml
@@ -4,6 +4,9 @@
   <maintainer type="person">
     <email>zmed...@gentoo.org</email>
   </maintainer>
+  <maintainer type="person">
+    <email>chutz...@gentoo.org</email>
+  </maintainer>
   <upstream>
     <remote-id type="github">iovisor/bcc</remote-id>
   </upstream>

Reply via email to