blob: 93626dd4b5fa5aadc2c7476e3e43a7a30572069c [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001SECTION = "devel"
2SUMMARY = "Linux Trace Toolkit Control"
3DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \
4to extract program execution details from the Linux operating system \
5and interpret them."
6
7LICENSE = "GPLv2 & LGPLv2.1"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \
9 file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
10 file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca"
11
12DEPENDS = "liburcu popt libxml2 util-linux"
13RDEPENDS_${PN} = "libgcc"
14RDEPENDS_${PN}-ptest += "make perl bash gawk ${PN} babeltrace procps"
15# babelstats.pl wants getopt-long
16RDEPENDS_${PN}-ptest += "perl-module-getopt-long"
17
18PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \
19 am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \
20 PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \
21"
22PACKAGECONFIG ??= "lttng-ust"
23PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native"
24PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust"
25PACKAGECONFIG[kmod] = "--enable-kmod, --disable-kmod, kmod"
26PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native"
27PACKAGECONFIG_remove_libc-musl = "lttng-ust"
Brad Bishop316dfdd2018-06-25 12:45:53 -040028PACKAGECONFIG_remove_riscv64 = "lttng-ust"
Brad Bishopd7bf8c12018-02-25 22:55:05 -050029
30SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \
31 file://x32.patch \
32 file://run-ptest \
33 "
34
35SRC_URI[md5sum] = "051224eb991aee07f8721ff1877d0b96"
36SRC_URI[sha256sum] = "77839eb6fc6c652125f08acfd9369701c2516eb05cc2084160e7efc7a3fb731c"
37
38inherit autotools ptest pkgconfig useradd python3-dir manpages
39
40USERADD_PACKAGES = "${PN}"
41GROUPADD_PARAM_${PN} = "tracing"
42
43FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \
44 ${PYTHON_SITEPACKAGES_DIR}/*"
45FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
46FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
47
48# Since files are installed into ${libdir}/lttng/libexec we match
49# the libexec insane test so skip it.
50# Python module needs to keep _lttng.so
51INSANE_SKIP_${PN} = "libexec dev-so"
52INSANE_SKIP_${PN}-dbg = "libexec"
53
54do_install_ptest () {
55 for f in Makefile tests/Makefile tests/utils/utils.sh ; do
56 install -D "${B}/$f" "${D}${PTEST_PATH}/$f"
57 done
58
59 for f in config/tap-driver.sh config/test-driver ; do
60 install -D "${S}/$f" "${D}${PTEST_PATH}/$f"
61 done
62
63 # Prevent 'make check' from recursing into non-test subdirectories.
64 sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile"
65
66 # We don't need these
67 sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile"
68
69 # We shouldn't need to build anything in tests/utils
70 sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \
71 "${D}${PTEST_PATH}/tests/Makefile"
72
73 # Copy the tests directory tree and the executables and
74 # Makefiles found within.
75 for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do
76 install -d "${D}${PTEST_PATH}/tests/$d"
77 find "${B}/tests/$d" -maxdepth 1 -executable -type f \
78 -exec install -t "${D}${PTEST_PATH}/tests/$d" {} +
79 test -r "${B}/tests/$d/Makefile" && \
80 install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile"
81 done
82
83 # We shouldn't need to build anything in tests/regression/tools
84 sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \
85 "${D}${PTEST_PATH}/tests/regression/Makefile"
86
87 # Prevent attempts to update Makefiles during test runs, and
88 # silence "Making check in $SUBDIR" messages.
89 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
90 sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \
91 -e '/echo "Making $$target in $$subdir"; \\/d' \
92 -e 's/^srcdir = \(.*\)/srcdir = ./' \
93 -e 's/^builddir = \(.*\)/builddir = ./' \
94 -e 's/^all-am:.*/all-am:/' \
95 {} +
96
97 # These objects trigger [rpaths] QA checks; the test harness
98 # skips the associated tests if they're missing, so delete
99 # them.
100 objs=""
101 objs="$objs regression/ust/ust-dl/libbar.so"
102 objs="$objs regression/ust/ust-dl/libfoo.so"
103 for obj in $objs ; do
104 rm -f "${D}${PTEST_PATH}/tests/${obj}"
105 done
106
107 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
108 touch -r "${B}/Makefile" {} +
109
110 # Substitute links to installed binaries.
111 for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd ; do
112 exedir="${D}${PTEST_PATH}/src/bin/${prog}"
113 install -d "$exedir"
114 case "$prog" in
115 lttng-consumerd)
116 ln -s "${libdir}/lttng/libexec/$prog" "$exedir"
117 ;;
118 *)
119 ln -s "${bindir}/$prog" "$exedir"
120 ;;
121 esac
122 done
123}