summaryrefslogtreecommitdiffstats
path: root/meta-oe/dynamic-layers/meta-python/recipes-devtools/bpftrace/bpftrace_0.25.1.bb
blob: f28c1547db41f8aab1cacb58a4fb68b567a0a05f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
SUMMARY = "bpftrace"
HOMEPAGE = "https://github.com/iovisor/bpftrace"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"

DEPENDS += "bison-native \
            flex-native \
            gzip-native \
            elfutils \
            bpftool-native \
            bcc \
            libcereal \
            libbpf \
            xxd-native \
            "
DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'pahole-native llvm-native', '', d)}"

SRC_URI = "git://github.com/iovisor/bpftrace;branch=release/0.25.x;protocol=https;tag=v${PV} \
           file://run-ptest \
           file://0002-CMakeLists.txt-allow-to-set-BISON_FLAGS-like-l.patch \
"
SRCREV = "e491811e5d648288c01f42ce087967b271f504a0"

inherit bash-completion cmake ptest pkgconfig

PACKAGECONFIG ?= " \
        ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)} \
        ${@bb.utils.contains("DISTRO_FEATURES", "systemd", "systemd", "", d)} \
        "

PACKAGECONFIG[tests] = "-DBUILD_TESTING=ON,-DBUILD_TESTING=OFF,gtest"
PACKAGECONFIG[systemd] = "-DENABLE_SYSTEMD=ON,-DENABLE_SYSTEMD=OFF,systemd"

do_install_ptest() {
    if [ -e ${B}/tests/bpftrace_test ]; then
        install -Dm 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests/bpftrace_test
        cp -rf ${B}/tests/runtime ${D}${PTEST_PATH}/tests
        cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests
    fi
    for f in testlibs/cmake_install.cmake \
             testprogs/cmake_install.cmake \
             testlibs/CTestTestfile.cmake \
             testprogs/CTestTestfile.cmake
    do
        sed -i -e 's|${STAGING_BINDIR_TOOLCHAIN}/||' ${D}${libdir}/bpftrace/ptest/tests/$f
        sed -i -e 's|${S}/||' ${D}${libdir}/bpftrace/ptest/tests/$f
        sed -i -e 's|${B}/||' ${D}${libdir}/bpftrace/ptest/tests/$f
    done
}

do_install_ptest:powerpc64() {
}

do_install_ptest:powerpc64le() {
}

EXTRA_OECMAKE = " \
    -DCMAKE_ENABLE_EXPORTS=1 \
    -DCMAKE_BUILD_TYPE=Release \
    -DUSE_SYSTEM_BPF_BCC=ON \
    -DUSE_SYSTEM_LIBBPF=ON \
    -DENABLE_MAN=OFF \
    -DBISON_FLAGS='--file-prefix-map=${WORKDIR}=' \
"

PACKAGES:remove:powerpc64 = "${PN}-ptest"
PACKAGES:remove:powerpc64le = "${PN}-ptest"

RDEPENDS:${PN}-ptest += "bash bpftool python3"

COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux"

INHIBIT_PACKAGE_STRIP_FILES += "\
    ${PKGD}${PTEST_PATH}/tests/testprogs/uprobe_test \
"

WARN_QA:append = "${@bb.utils.contains('PTEST_ENABLED', '1', ' buildpaths', '', d)}"
ERROR_QA:remove = "${@bb.utils.contains('PTEST_ENABLED', '1', 'buildpaths', '', d)}"