Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | HOMEPAGE = "https://sourceware.org/systemtap/" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 3 | |
| 4 | require systemtap_git.inc |
| 5 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 6 | SRC_URI += "file://0001-improve-reproducibility-for-c-compiling.patch" |
| 7 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 8 | DEPENDS = "elfutils" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | |
| 10 | EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \ |
| 11 | --without-nss --without-avahi --without-dyninst \ |
| 12 | --disable-server --disable-grapher --enable-prologues \ |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 13 | --with-python3 --without-python2-probes \ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | ac_cv_prog_have_javac=no \ |
| 15 | ac_cv_prog_have_jar=no " |
| 16 | |
| 17 | STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs" |
| 18 | |
| 19 | EXTRA_OECONF += "${STAP_DOCS} " |
| 20 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 21 | PACKAGECONFIG ??= "translator sqlite monitor python3-probes" |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 22 | PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 23 | PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt" |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 24 | PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3" |
| 25 | PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c" |
Brad Bishop | 37a0e4d | 2017-12-04 01:01:44 -0500 | [diff] [blame] | 26 | PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 27 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 28 | inherit autotools gettext pkgconfig systemd |
| 29 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'distutils3-base', '', d)} |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 30 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 31 | # exporter comes with python3-probes |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 32 | PACKAGES =+ "${PN}-exporter" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 33 | FILES_${PN}-exporter = "${sysconfdir}/stap-exporter/* \ |
| 34 | ${sysconfdir}/sysconfig/stap-exporter \ |
| 35 | ${systemd_unitdir}/system/stap-exporter.service \ |
| 36 | ${sbindir}/stap-exporter" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 37 | RDEPENDS_${PN}-exporter = "${PN} python3-core python3-netclient" |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 38 | SYSTEMD_SERVICE_${PN}-exporter = "stap-exporter.service" |
| 39 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 40 | PACKAGES =+ "${PN}-runtime" |
| 41 | FILES_${PN}-runtime = "\ |
| 42 | ${bindir}/staprun \ |
| 43 | ${bindir}/stap-merge \ |
| 44 | ${bindir}/stapsh \ |
| 45 | ${libexecdir}/${BPN}/stapio \ |
| 46 | " |
| 47 | RDEPENDS_${PN}_class-target += "${PN}-runtime" |
| 48 | |
| 49 | PACKAGES =+ "${PN}-examples" |
| 50 | FILES_${PN}-examples = "${datadir}/${BPN}/examples/" |
| 51 | RDEPENDS_${PN}-examples += "${PN}" |
| 52 | |
| 53 | # don't complain that some examples involve bash, perl, php... |
| 54 | INSANE_SKIP_${PN}-examples += "file-rdeps" |
| 55 | |
| 56 | PACKAGES =+ "${PN}-python" |
| 57 | FILES_${PN}-python += "\ |
| 58 | ${bindir}/dtrace \ |
| 59 | ${libdir}/python*/ \ |
| 60 | ${libexecdir}/${BPN}/python/ \ |
| 61 | " |
| 62 | # python material requires sdt headers |
| 63 | RDEPENDS_${PN}-python += "${PN}-dev python3-core" |
| 64 | INSANE_SKIP_${PN}-python += "dev-deps" |
| 65 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 66 | do_configure_prepend () { |
| 67 | # Improve reproducibility for c++ object files |
| 68 | reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}" |
| 69 | sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h |
| 70 | } |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 71 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 72 | do_install_append () { |
| 73 | if [ ! -f ${D}${bindir}/stap ]; then |
| 74 | # translator disabled case, need to leave only minimal runtime |
| 75 | rm -rf ${D}${datadir}/${PN} |
| 76 | rm ${D}${libexecdir}/${PN}/stap-env |
| 77 | fi |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 78 | |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 79 | if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then |
Brad Bishop | 64c979e | 2019-11-04 13:55:29 -0500 | [diff] [blame] | 80 | # Fix makefile hardcoded path assumptions for systemd (assumes $prefix) |
| 81 | # without usrmerge distro feature enabled |
| 82 | install -d `dirname ${D}${systemd_unitdir}` |
| 83 | mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}` |
| 84 | rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty |
| 85 | fi |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 86 | |
| 87 | # Ensure correct ownership for files copied in |
Andrew Geissler | 6ce62a2 | 2020-11-30 19:58:47 -0600 | [diff] [blame] | 88 | if [ -d ${D}${sysconfdir}/stap-exporter ]; then |
| 89 | chown root:root ${D}${sysconfdir}/stap-exporter/* -R |
| 90 | fi |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 91 | } |
| 92 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 93 | BBCLASSEXTEND = "nativesdk" |