aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Jensen <acjensen@gmail.com>2019-05-12 18:34:43 -0400
committerKevin Daudt <kdaudt@alpinelinux.org>2019-05-14 10:49:39 +0000
commit9925e648a61b88ab2158a3d0680acda6799917f1 (patch)
tree1ef430b30615e86c9a2b02281aaca462ff95a58b
parent2740d7c334747a50b829ccde72ba88db601485a9 (diff)
downloadaports-9925e648a61b88ab2158a3d0680acda6799917f1.tar.bz2
aports-9925e648a61b88ab2158a3d0680acda6799917f1.tar.xz
testing/libbpf: new aport
https://github.com/libbpf/libbpf A library for interacting with the Linux kernel's Berkeley Packet Filter (BPF) facility from user space Closes GH-7860
-rw-r--r--testing/libbpf/10-include-stddef.patch12
-rw-r--r--testing/libbpf/20-trailing-ldflags.patch29
-rw-r--r--testing/libbpf/APKBUILD33
3 files changed, 74 insertions, 0 deletions
diff --git a/testing/libbpf/10-include-stddef.patch b/testing/libbpf/10-include-stddef.patch
new file mode 100644
index 0000000000..e3fe4d1a9c
--- /dev/null
+++ b/testing/libbpf/10-include-stddef.patch
@@ -0,0 +1,12 @@
+diff --git a/src/libbpf.c b/src/libbpf.c
+index b38dcbe..bc3ac5d 100644
+--- a/src/libbpf.c
++++ b/src/libbpf.c
+@@ -29,6 +29,7 @@
+ #include <linux/filter.h>
+ #include <linux/list.h>
+ #include <linux/limits.h>
++#include <linux/stddef.h>
+ #include <linux/perf_event.h>
+ #include <linux/ring_buffer.h>
+ #include <sys/stat.h>
diff --git a/testing/libbpf/20-trailing-ldflags.patch b/testing/libbpf/20-trailing-ldflags.patch
new file mode 100644
index 0000000000..7f65ef5645
--- /dev/null
+++ b/testing/libbpf/20-trailing-ldflags.patch
@@ -0,0 +1,29 @@
+diff --git a/src/Makefile b/src/Makefile
+index e9021fe..1d86ecd 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -54,11 +54,7 @@ INSTALL = install
+
+ DESTDIR ?=
+
+-ifeq ($(shell uname -m),x86_64)
+- LIBSUBDIR := lib64
+-else
+- LIBSUBDIR := lib
+-endif
++LIBSUBDIR := lib
+
+ PREFIX ?= /usr
+ LIBDIR ?= $(PREFIX)/$(LIBSUBDIR)
+@@ -77,9 +73,9 @@ $(OBJDIR)/libbpf.so.$(VERSION): $(OBJDIR)/libbpf.so.$(LIBBPF_VERSION)
+ ln -sf $(^F) $@
+
+ $(OBJDIR)/libbpf.so.$(LIBBPF_VERSION): $(OBJS)
+- $(CC) -shared $(ALL_LDFLAGS) -Wl,--version-script=$(VERSION_SCRIPT) \
++ $(CC) -shared -Wl,--version-script=$(VERSION_SCRIPT) \
+ -Wl,-soname,libbpf.so.$(VERSION) \
+- $^ -o $@
++ $^ -o $@ $(ALL_LDFLAGS)
+
+ $(OBJDIR)/libbpf.pc:
+ sed -e "s|@PREFIX@|$(PREFIX)|" \
diff --git a/testing/libbpf/APKBUILD b/testing/libbpf/APKBUILD
new file mode 100644
index 0000000000..12fe9f0742
--- /dev/null
+++ b/testing/libbpf/APKBUILD
@@ -0,0 +1,33 @@
+# Maintainer: Adam Jensen <acjensen@gmail.com>
+pkgname=libbpf
+pkgver=5.0.8
+_versionref="816253000e918f22e3b395d1bf743503d3508b41"
+pkgrel=0
+pkgdesc="A library for interacting with the Linux kernel's Berkeley Packet Filter (BPF) facility from user space"
+url="https://github.com/libbpf/libbpf"
+arch="aarch64 x86 x86_64 s390x"
+license="GPL-2.0-only"
+# No test suite
+options="!check"
+depends="elfutils"
+makedepends="build-base linux-headers elfutils-dev"
+subpackages="$pkgname-static $pkgname-dev"
+source="$pkgname-$pkgver.tar.gz::https://codeload.github.com/libbpf/$pkgname/tar.gz/$_versionref
+ 10-include-stddef.patch
+ 20-trailing-ldflags.patch"
+builddir="$srcdir/libbpf-$_versionref"
+
+build() {
+ cd "$builddir/src"
+ make NO_PKG_CONFIG=1
+}
+
+package() {
+ cd "$builddir/src"
+ make install DESTDIR="$pkgdir"
+ cp -R "$builddir/include/uapi" "$pkgdir/usr/include/uapi"
+}
+
+sha512sums="cc14587830c7a24fb5c8c994febe4633733f0a364a0ee4c4c1d282f3b18892e90b950fae202860e76d564934cfacd023b5c68f59118a91779c29cfc23fd4e5c1 libbpf-5.0.8.tar.gz
+946e445ffa4c5df42ebac77b7a1c6478b37dc7b55e0883aee195c6a8c4f8718b4dbf98b7c6d3016e1619e59440d8e4a76dad1e843114dfe2f9a2610e5cbb7943 10-include-stddef.patch
+1ec15c45fc085b44aa1f6d5626f0ba9e57280304d1f6e1c4e7fe8e2b81fc927f5500fd48f8e70d2affb91dd67a74a80c85698d39bb85febde5abd479df5cdccc 20-trailing-ldflags.patch"