libbpf: initial package

This commit is contained in:
heitbaum 2021-10-17 18:05:42 +11:00
parent d3745e7546
commit 7db11926f4
2 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,24 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="libbpf"
PKG_VERSION="0.5.0"
PKG_SHA256="d5b27980ceab9a80b6f28d3e67b51cea526fda49bd13151ba966e33548feb4f4"
PKG_LICENSE="LGPL-2.1"
PKG_SITE="https://github.com/libbpf/libbpf"
PKG_URL="https://github.com/libbpf/libbpf/archive/refs/tags/v${PKG_VERSION}.tar.gz"
PKG_DEPENDS_TARGET="toolchain elfutils"
PKG_LONGDESC="libbpf supports building BPF CO-RE-enabled applications"
PKG_TOOLCHAIN="make"
make_target() {
make BUILD_STATIC_ONLY=1 \
PREFIX=${SYSROOT_PREFIX}/usr \
-C src
}
makeinstall_target() {
make BUILD_STATIC_ONLY=1 \
PREFIX=${SYSROOT_PREFIX}/usr \
-C src install
}

View File

@ -0,0 +1,39 @@
--- a/src/Makefile 2021-09-09 09:01:51.000000000 +1000
+++ b/src/Makefile 2021-10-17 17:49:02.868557327 +1100
@@ -61,15 +61,12 @@
DESTDIR ?=
-ifeq ($(filter-out %64 %64be %64eb %64le %64el s390x, $(shell uname -m)),)
- LIBSUBDIR := lib64
-else
- LIBSUBDIR := lib
-endif
+LIBSUBDIR := lib
# By default let the pc file itself use ${prefix} in includedir/libdir so that
# the prefix can be overridden at runtime (eg: --define-prefix)
ifndef LIBDIR
+ PREFIX_PC := /usr
LIBDIR_PC := $$\{prefix\}/$(LIBSUBDIR)
else
LIBDIR_PC := $(LIBDIR)
@@ -100,7 +97,7 @@
$^ $(ALL_LDFLAGS) -o $@
$(OBJDIR)/libbpf.pc:
- $(Q)sed -e "s|@PREFIX@|$(PREFIX)|" \
+ $(Q)sed -e "s|@PREFIX@|$(PREFIX_PC)|" \
-e "s|@LIBDIR@|$(LIBDIR_PC)|" \
-e "s|@VERSION@|$(LIBBPF_VERSION)|" \
< libbpf.pc.template > $@
--- a/src/libbpf.pc.template 2021-09-09 09:01:51.000000000 +1000
+++ b/src/libbpf.pc.template 2021-10-17 18:03:19.681346272 +1100
@@ -7,6 +7,6 @@
Name: libbpf
Description: BPF library
Version: @VERSION@
-Libs: -L${libdir} -lbpf
+Libs: -L${libdir} -lbpf -lz
Requires.private: libelf zlib
Cflags: -I${includedir}