xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-kernel/lttng/babeltrace2_2.0.4.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunSUMMARY = "Babeltrace2 - Trace Format Babel Tower"
2*4882a593SmuzhiyunDESCRIPTION = "Babeltrace provides trace read and write libraries in host side, as well as a trace converter, which used to convert LTTng 2.0 traces into human-readable log."
3*4882a593SmuzhiyunHOMEPAGE = "http://babeltrace.org/"
4*4882a593SmuzhiyunBUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
5*4882a593SmuzhiyunLICENSE = "MIT & GPL-2.0-only & LGPL-2.1-only & BSD-2-Clause"
6*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE;md5=a6a458c13f18385b7bc5069a6d7b176e"
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunDEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunSRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-2.0 \
11*4882a593Smuzhiyun           file://run-ptest \
12*4882a593Smuzhiyun           file://0001-tests-do-not-run-test-applications-from-.libs.patch \
13*4882a593Smuzhiyun           file://0001-Make-manpages-multilib-identical.patch \
14*4882a593Smuzhiyun           "
15*4882a593SmuzhiyunSRCREV = "23e8cf4e6fdc1d0b230e964dafac08a57e6228e6"
16*4882a593SmuzhiyunUPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>2(\.\d+)+)$"
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunS = "${WORKDIR}/git"
19*4882a593Smuzhiyun
20*4882a593Smuzhiyuninherit autotools pkgconfig ptest python3targetconfig
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunEXTRA_OECONF = "--disable-debug-info --disable-Werror"
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunPACKAGECONFIG ??= "manpages"
25*4882a593SmuzhiyunPACKAGECONFIG[manpages] = ", --disable-man-pages, asciidoc-native xmlto-native"
26*4882a593Smuzhiyun
27*4882a593SmuzhiyunFILES:${PN}-staticdev += "${libdir}/babeltrace2/plugins/*.a"
28*4882a593SmuzhiyunFILES:${PN} += "${libdir}/babeltrace2/plugins/*.so"
29*4882a593Smuzhiyun
30*4882a593SmuzhiyunASNEEDED = ""
31*4882a593Smuzhiyun
32*4882a593SmuzhiyunRDEPENDS:${PN}-ptest += "bash gawk python3"
33*4882a593Smuzhiyun
34*4882a593Smuzhiyundo_compile_ptest () {
35*4882a593Smuzhiyun    make -C tests all
36*4882a593Smuzhiyun}
37*4882a593Smuzhiyun
38*4882a593Smuzhiyundo_install_ptest () {
39*4882a593Smuzhiyun    install -d "${D}${PTEST_PATH}/tests"
40*4882a593Smuzhiyun
41*4882a593Smuzhiyun    # Copy required files from source directory
42*4882a593Smuzhiyun    for d in $(find "${S}/tests" -type d -printf '%P ') ; do
43*4882a593Smuzhiyun	install -d "${D}${PTEST_PATH}/tests/$d"
44*4882a593Smuzhiyun	find "${S}/tests/$d" -maxdepth 1 -executable -type f \
45*4882a593Smuzhiyun	     -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
46*4882a593Smuzhiyun	find "${S}/tests/$d" -maxdepth 1 -name *.sh \
47*4882a593Smuzhiyun	     -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
48*4882a593Smuzhiyun	find "${S}/tests/$d" -maxdepth 1 -name *.py \
49*4882a593Smuzhiyun	     -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
50*4882a593Smuzhiyun	find "${S}/tests/$d" -maxdepth 1 -name *.expect \
51*4882a593Smuzhiyun	     -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
52*4882a593Smuzhiyun    done
53*4882a593Smuzhiyun    install -d "${D}${PTEST_PATH}/tests/data/ctf-traces/"
54*4882a593Smuzhiyun    cp -a ${S}/tests/data/ctf-traces/* ${D}${PTEST_PATH}/tests/data/ctf-traces/
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun    # Copy the tests directory tree and the executables and
57*4882a593Smuzhiyun    # Makefiles found within.
58*4882a593Smuzhiyun    install -D "${B}/tests/Makefile" "${D}${PTEST_PATH}/tests/"
59*4882a593Smuzhiyun    for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
60*4882a593Smuzhiyun	install -d "${D}${PTEST_PATH}/tests/$d"
61*4882a593Smuzhiyun	find "${B}/tests/$d" -maxdepth 1 -executable -type f \
62*4882a593Smuzhiyun	     -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
63*4882a593Smuzhiyun	test -r "${B}/tests/$d/Makefile" && \
64*4882a593Smuzhiyun	    install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
65*4882a593Smuzhiyun	find "${B}/tests/$d" -maxdepth 1 -name *.sh \
66*4882a593Smuzhiyun	     -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
67*4882a593Smuzhiyun    done
68*4882a593Smuzhiyun
69*4882a593Smuzhiyun    for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
70*4882a593Smuzhiyun	for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
71*4882a593Smuzhiyun	    cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
72*4882a593Smuzhiyun	done
73*4882a593Smuzhiyun    done
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun    # Prevent attempts to update Makefiles during test runs, and
76*4882a593Smuzhiyun    # silence "Making check in $SUBDIR" messages.
77*4882a593Smuzhiyun    find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
78*4882a593Smuzhiyun	 sed -i \
79*4882a593Smuzhiyun	 -e '/Makefile:/,/^$/d' \
80*4882a593Smuzhiyun	 -e '/%: %.in/,/^$/d' \
81*4882a593Smuzhiyun	 -e '/echo "Making $$target in $$subdir"; \\/d' \
82*4882a593Smuzhiyun	 -e 's/^srcdir = \(.*\)/srcdir = ./' \
83*4882a593Smuzhiyun	 -e 's/^builddir = \(.*\)/builddir = ./' \
84*4882a593Smuzhiyun	 -e 's/^all-am:.*/all-am:/' \
85*4882a593Smuzhiyun	 {} +
86*4882a593Smuzhiyun
87*4882a593Smuzhiyun    # Substitute links to installed binaries.
88*4882a593Smuzhiyun    install -d "${D}${PTEST_PATH}/src/cli/"
89*4882a593Smuzhiyun    ln -s "${bindir}/babeltrace2" ${D}${PTEST_PATH}/src/cli/
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun    # Remove architechture specific testfiles
92*4882a593Smuzhiyun    rm -rf ${D}${PTEST_PATH}/tests/data/plugins/flt.lttng-utils.debug-info/*
93*4882a593Smuzhiyun}
94