blob: 9e5d3a7a9780890079efc22631ee29dc00d231dd [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Babeltrace - Trace Format Babel Tower"
2DESCRIPTION = "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."
3HOMEPAGE = "http://babeltrace.org/"
4BUGTRACKER = "https://bugs.lttng.org/projects/babeltrace"
5LICENSE = "MIT & GPLv2 & LGPLv2.1"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=76ba15dd76a248e1dd526bca0e2125fa"
7
8DEPENDS = "glib-2.0 util-linux popt bison-native flex-native"
9
Andrew Geissler4ed12e12020-06-05 18:00:41 -050010SRC_URI = "git://git.efficios.com/babeltrace.git;branch=stable-1.5 \
Andrew Geissler82c905d2020-04-13 13:39:40 -050011 file://run-ptest \
12 "
13SRCREV = "054a54ae10b01a271afc4f19496c041b10fb414c"
14UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>1(\.\d+)+)$"
15
16S = "${WORKDIR}/git"
17
18inherit autotools pkgconfig ptest
19
20EXTRA_OECONF = "--disable-debug-info"
21
22ASNEEDED = ""
23
24RDEPENDS_${PN}-ptest += "bash gawk"
25
26addtask do_patch_ptest_path after do_patch before do_configure
27do_patch_ptest_path () {
28 for f in $(grep -l -r abs_top_srcdir ${S}/tests); do
29 sed -i 's:\@abs_top_srcdir\@:${PTEST_PATH}:' ${f}
30 done
31
32 for f in $(grep -l -r abs_top_builddir ${S}/tests); do
33 sed -i 's:\@abs_top_builddir\@:${PTEST_PATH}:' ${f}
34 done
35 for f in $(grep -l -r GREP ${S}/tests); do
36 sed -i 's:\@GREP\@:grep:' ${f}
37 done
38
39 for f in $(grep -l -r SED ${S}/tests); do
40 sed -i 's:\@SED\@:sed:' ${f}
41 done
42}
43
44do_compile_ptest () {
45 make -C tests all
46}
47
48do_install_ptest () {
49 # Copy required files from source directory
50 for f in config/tap-driver.sh config/test-driver; do
51 install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
52 done
53 install -d "$f" "${D}${PTEST_PATH}/tests/ctf-traces/"
54 cp -a ${S}/tests/ctf-traces/* ${D}${PTEST_PATH}/tests/ctf-traces/
55
56 # Copy the tests directory tree and the executables and
57 # Makefiles found within.
58 install -D "${B}/tests/Makefile" "${D}${PTEST_PATH}/tests/"
59 for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
60 install -d "${D}${PTEST_PATH}/tests/$d"
61 find "${B}/tests/$d" -maxdepth 1 -executable -type f \
62 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
63 test -r "${B}/tests/$d/Makefile" && \
64 install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
65 find "${B}/tests/$d" -maxdepth 1 -name *.sh \
66 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} \;
67 done
68
69 for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do
70 for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do
71 cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f
72 done
73 done
74
75 install -D ${B}/formats/ctf/metadata/.libs/ctf-parser-test \
76 ${D}${PTEST_PATH}/formats/ctf/metadata/ctf-parser-test
77
78 # Prevent attempts to update Makefiles during test runs, and
79 # silence "Making check in $SUBDIR" messages.
80 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
81 sed -i \
82 -e '/Makefile:/,/^$/d' \
83 -e '/$(check_SCRIPTS)/s/^/#/' \
84 -e '/%: %.in/,/^$/d' \
85 -e '/echo "Making $$target in $$subdir"; \\/d' \
86 -e 's/^srcdir = \(.*\)/srcdir = ./' \
87 -e 's/^builddir = \(.*\)/builddir = ./' \
88 -e 's/^all-am:.*/all-am:/' \
89 {} +
90
91 # Remove path to babeltrace.
92 for f in $(grep -l -r "^BABELTRACE_BIN" ${D}${PTEST_PATH}); do
93 sed -i 's:^BABELTRACE_BIN.*:BABELTRACE_BIN=/usr/bin/babeltrace:' ${f}
94 done
95 for f in $(grep -l -r "^BTBIN" ${D}${PTEST_PATH}); do
96 sed -i 's:^BTBIN.*:BTBIN=/usr/bin/babeltrace:' ${f}
97 done
98}