Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | SECTION = "devel" |
| 2 | SUMMARY = "Linux Trace Toolkit Control" |
| 3 | DESCRIPTION = "The Linux trace toolkit is a suite of tools designed \ |
| 4 | to extract program execution details from the Linux operating system \ |
| 5 | and interpret them." |
| 6 | |
| 7 | LICENSE = "GPLv2 & LGPLv2.1" |
| 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=01d7fc4496aacf37d90df90b90b0cac1 \ |
| 9 | file://gpl-2.0.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ |
| 10 | file://lgpl-2.1.txt;md5=0f0d71500e6a57fd24d825f33242b9ca" |
| 11 | |
| 12 | DEPENDS = "liburcu popt libxml2 util-linux" |
| 13 | RDEPENDS_${PN} = "libgcc" |
Brad Bishop | f3fd288 | 2019-06-21 08:06:37 -0400 | [diff] [blame] | 14 | RDEPENDS_${PN}-ptest += "make perl bash gawk babeltrace procps perl-module-overloading coreutils util-linux kmod lttng-modules sed" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 15 | RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-utils" |
| 16 | RDEPENDS_${PN}-ptest_append_libc-musl = " musl-utils" |
| 17 | # babelstats.pl wants getopt-long |
| 18 | RDEPENDS_${PN}-ptest += "perl-module-getopt-long" |
| 19 | |
| 20 | PYTHON_OPTION = "am_cv_python_pyexecdir='${PYTHON_SITEPACKAGES_DIR}' \ |
| 21 | am_cv_python_pythondir='${PYTHON_SITEPACKAGES_DIR}' \ |
| 22 | PYTHON_INCLUDE='-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}${PYTHON_ABI}' \ |
| 23 | " |
| 24 | PACKAGECONFIG ??= "lttng-ust" |
| 25 | PACKAGECONFIG[python] = "--enable-python-bindings ${PYTHON_OPTION},,python3 swig-native" |
| 26 | PACKAGECONFIG[lttng-ust] = "--with-lttng-ust, --without-lttng-ust, lttng-ust" |
| 27 | PACKAGECONFIG[kmod] = "--with-kmod, --without-kmod, kmod" |
| 28 | PACKAGECONFIG[manpages] = "--enable-man-pages, --disable-man-pages, asciidoc-native xmlto-native libxslt-native" |
| 29 | PACKAGECONFIG_remove_arc = "lttng-ust" |
| 30 | |
| 31 | SRC_URI = "https://lttng.org/files/lttng-tools/lttng-tools-${PV}.tar.bz2 \ |
| 32 | file://x32.patch \ |
| 33 | file://run-ptest \ |
| 34 | file://lttng-sessiond.service \ |
Brad Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 35 | file://0001-Skip-when-testapp-is-not-present.patch \ |
| 36 | file://0002-Fix-check-for-lttng-modules-presence-before-testing.patch \ |
Brad Bishop | 08902b0 | 2019-08-20 09:16:51 -0400 | [diff] [blame^] | 37 | file://0001-check-for-gettid-API-during-configure.patch \ |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 38 | " |
| 39 | |
Brad Bishop | c8f4712 | 2019-06-24 09:36:18 -0400 | [diff] [blame] | 40 | SRC_URI[md5sum] = "e7804d10e4cade381e241601f6047373" |
| 41 | SRC_URI[sha256sum] = "ed71ebe00c5d985c74f30e97b614e909573cbd9276c85e05d9557a0b817a1312" |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 42 | |
| 43 | inherit autotools ptest pkgconfig useradd python3-dir manpages systemd |
| 44 | |
| 45 | SYSTEMD_SERVICE_${PN} = "lttng-sessiond.service" |
| 46 | SYSTEMD_AUTO_ENABLE = "disable" |
| 47 | |
| 48 | USERADD_PACKAGES = "${PN}" |
| 49 | GROUPADD_PARAM_${PN} = "tracing" |
| 50 | |
| 51 | FILES_${PN} += "${libdir}/lttng/libexec/* ${datadir}/xml/lttng \ |
| 52 | ${PYTHON_SITEPACKAGES_DIR}/*" |
| 53 | FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" |
| 54 | FILES_${PN}-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la" |
| 55 | |
| 56 | # Since files are installed into ${libdir}/lttng/libexec we match |
| 57 | # the libexec insane test so skip it. |
| 58 | # Python module needs to keep _lttng.so |
| 59 | INSANE_SKIP_${PN} = "libexec dev-so" |
| 60 | INSANE_SKIP_${PN}-dbg = "libexec" |
| 61 | |
| 62 | do_install_append () { |
| 63 | # install systemd unit file |
| 64 | install -d ${D}${systemd_unitdir}/system |
| 65 | install -m 0644 ${WORKDIR}/lttng-sessiond.service ${D}${systemd_unitdir}/system |
| 66 | } |
| 67 | |
| 68 | do_install_ptest () { |
| 69 | for f in Makefile tests/Makefile tests/utils/utils.sh tests/regression/tools/save-load/load-42*.lttng tests/regression/tools/save-load/configuration/load-42*.lttng ; do |
| 70 | install -D "${B}/$f" "${D}${PTEST_PATH}/$f" |
| 71 | done |
| 72 | |
| 73 | for f in config/tap-driver.sh config/test-driver src/common/config/session.xsd src/common/mi-lttng-3.0.xsd; do |
| 74 | install -D "${S}/$f" "${D}${PTEST_PATH}/$f" |
| 75 | done |
| 76 | |
| 77 | # Prevent 'make check' from recursing into non-test subdirectories. |
| 78 | sed -i -e 's!^SUBDIRS = .*!SUBDIRS = tests!' "${D}${PTEST_PATH}/Makefile" |
| 79 | |
| 80 | # We don't need these |
| 81 | sed -i -e '/dist_noinst_SCRIPTS = /,/^$/d' "${D}${PTEST_PATH}/tests/Makefile" |
| 82 | |
| 83 | # We shouldn't need to build anything in tests/utils |
| 84 | sed -i -e 's!am__append_1 = . utils!am__append_1 = . !' \ |
| 85 | "${D}${PTEST_PATH}/tests/Makefile" |
| 86 | |
| 87 | # Copy the tests directory tree and the executables and |
| 88 | # Makefiles found within. |
| 89 | for d in $(find "${B}/tests" -type d -not -name .libs -printf '%P ') ; do |
| 90 | install -d "${D}${PTEST_PATH}/tests/$d" |
| 91 | find "${B}/tests/$d" -maxdepth 1 -executable -type f \ |
| 92 | -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + |
| 93 | # Take all .py scripts for tests using the python bindings. |
| 94 | find "${B}/tests/$d" -maxdepth 1 -type f -name "*.py" \ |
| 95 | -exec install -t "${D}${PTEST_PATH}/tests/$d" {} + |
| 96 | test -r "${B}/tests/$d/Makefile" && \ |
| 97 | install -t "${D}${PTEST_PATH}/tests/$d" "${B}/tests/$d/Makefile" |
| 98 | done |
| 99 | |
| 100 | for d in $(find "${B}/tests" -type d -name .libs -printf '%P ') ; do |
| 101 | for f in $(find "${B}/tests/$d" -maxdepth 1 -executable -type f -printf '%P ') ; do |
| 102 | cp ${B}/tests/$d/$f ${D}${PTEST_PATH}/tests/`dirname $d`/$f |
| 103 | case $f in |
| 104 | *.so) |
| 105 | install -d ${D}${PTEST_PATH}/tests/$d/ |
| 106 | ln -s ../$f ${D}${PTEST_PATH}/tests/$d/$f |
| 107 | # Remove any rpath/runpath to pass QA check. |
| 108 | chrpath --delete ${D}${PTEST_PATH}/tests/$d/$f |
| 109 | ;; |
| 110 | esac |
| 111 | done |
| 112 | done |
| 113 | |
| 114 | # |
| 115 | # Use the versioned libs of liblttng-ust-dl. |
| 116 | # |
| 117 | ustdl="${D}${PTEST_PATH}/tests/regression/ust/ust-dl/test_ust-dl.py" |
| 118 | if [ -e $ustdl ]; then |
| 119 | sed -i -e 's!:liblttng-ust-dl.so!:liblttng-ust-dl.so.0!' $ustdl |
| 120 | fi |
| 121 | |
| 122 | install ${B}/tests/unit/ini_config/sample.ini ${D}${PTEST_PATH}/tests/unit/ini_config/ |
| 123 | |
| 124 | # We shouldn't need to build anything in tests/regression/tools |
| 125 | sed -i -e 's!^SUBDIRS = tools !SUBDIRS = !' \ |
| 126 | "${D}${PTEST_PATH}/tests/regression/Makefile" |
| 127 | |
| 128 | # Prevent attempts to update Makefiles during test runs, and |
| 129 | # silence "Making check in $SUBDIR" messages. |
| 130 | find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ |
| 131 | sed -i -e '/Makefile:/,/^$/d' -e '/%: %.in/,/^$/d' \ |
| 132 | -e '/echo "Making $$target in $$subdir"; \\/d' \ |
| 133 | -e 's/^srcdir = \(.*\)/srcdir = ./' \ |
| 134 | -e 's/^builddir = \(.*\)/builddir = ./' \ |
| 135 | -e 's/^all-am:.*/all-am:/' \ |
| 136 | {} + |
| 137 | |
| 138 | find "${D}${PTEST_PATH}" -name Makefile -type f -exec \ |
| 139 | touch -r "${B}/Makefile" {} + |
| 140 | |
| 141 | # |
| 142 | # Need to stop generated binaries from rebuilding by removing their source dependencies |
| 143 | # |
| 144 | sed -e 's#\(^test.*OBJECTS.=\)#disable\1#g' \ |
| 145 | -e 's#\(^test.*DEPENDENCIES.=\)#disable\1#g' \ |
| 146 | -e 's#\(^test.*SOURCES.=\)#disable\1#g' \ |
| 147 | -e 's#\(^test.*LDADD.=\)#disable\1#g' \ |
| 148 | -i ${D}${PTEST_PATH}/tests/unit/Makefile |
| 149 | |
| 150 | # Substitute links to installed binaries. |
| 151 | for prog in lttng lttng-relayd lttng-sessiond lttng-consumerd lttng-crash; do |
| 152 | exedir="${D}${PTEST_PATH}/src/bin/${prog}" |
| 153 | install -d "$exedir" |
| 154 | case "$prog" in |
| 155 | lttng-consumerd) |
| 156 | ln -s "${libdir}/lttng/libexec/$prog" "$exedir" |
| 157 | ;; |
| 158 | *) |
| 159 | ln -s "${bindir}/$prog" "$exedir" |
| 160 | ;; |
| 161 | esac |
| 162 | done |
| 163 | } |