summaryrefslogtreecommitdiffstats
path: root/dynamic-layers/openembedded-layer/recipes-devtools/bpftrace/bpftrace_0.16.0.bb
blob: 556722c6fe91d390f2d2d06f0f4ddb9403971c19 (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
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 \
            bcc \
            systemtap \
            libcereal \
            libbpf \
            "

DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'gtest xxd-native', '', d)}"
PV .= "+git${SRCREV}"
RDEPENDS:${PN} += "bash python3 xz"
RDEPENDS:${PN}-ptest += "bash"

SRC_URI = "git://github.com/iovisor/bpftrace;branch=master;protocol=https \
           file://run-ptest \
"
SRCREV = "a277ec42102c463d656df8f64eb2f7e87e322210"

S = "${WORKDIR}/git"

inherit cmake ptest

do_install_ptest() {
    install -d ${D}${PTEST_PATH}/tests
    install -m 755 ${B}/tests/bpftrace_test ${D}${PTEST_PATH}/tests
    cp -rf ${B}/tests/runtime* ${D}${PTEST_PATH}/tests
    cp -rf ${B}/tests/test* ${D}${PTEST_PATH}/tests
}

def llvm_major_version(d):
    pvsplit = d.getVar('LLVMVERSION').split('.')
    return pvsplit[0]

LLVM_MAJOR_VERSION = "${@llvm_major_version(d)}"

EXTRA_OECMAKE = " \
    -DCMAKE_ENABLE_EXPORTS=1 \
    -DCMAKE_BUILD_TYPE=Release \
    -DLLVM_REQUESTED_VERSION=${LLVM_MAJOR_VERSION} \
    -DENABLE_MAN=OFF \
"
EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DBUILD_TESTING=ON', '-DBUILD_TESTING=OFF', d)}"

COMPATIBLE_HOST = "(x86_64.*|aarch64.*|powerpc64.*|riscv64.*)-linux"
COMPATIBLE_HOST:libc-musl = "null"