blob: 68f5c764282f77aeca610e36f1f0874cfdf1f68a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002DESCRIPTION = "It provides free software infrastructure to simplify the \
3gathering of information about the running Linux system. This assists \
4diagnosis of a performance or functional problem."
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005HOMEPAGE = "https://sourceware.org/systemtap/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006
7require systemtap_git.inc
8
Andrew Geisslerd5838332022-05-27 11:33:10 -05009SRC_URI += " \
10 file://0001-improve-reproducibility-for-c-compiling.patch \
11 file://0001-staprun-address-ncurses-6.3-failures.patch \
Andrew Geisslereff27472021-10-29 15:35:00 -050012 "
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080013
Brad Bishop316dfdd2018-06-25 12:45:53 -040014DEPENDS = "elfutils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015
16EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
17 --without-nss --without-avahi --without-dyninst \
18 --disable-server --disable-grapher --enable-prologues \
Brad Bishop37a0e4d2017-12-04 01:01:44 -050019 --with-python3 --without-python2-probes \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020 ac_cv_prog_have_javac=no \
21 ac_cv_prog_have_jar=no "
22
23STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs"
24
25EXTRA_OECONF += "${STAP_DOCS} "
26
Patrick Williams169d7bc2024-01-05 11:33:25 -060027PACKAGECONFIG ??= "translator sqlite monitor python3-probes ${@bb.utils.filter('DISTRO_FEATURES', 'debuginfod', d)}"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060028PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050029PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060030PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3"
31PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c"
Brad Bishop37a0e4d2017-12-04 01:01:44 -050032PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native"
Patrick Williams169d7bc2024-01-05 11:33:25 -060033PACKAGECONFIG[debuginfod] = "--with-debuginfod, --without-debuginfod"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050034
Andrew Geissler6ce62a22020-11-30 19:58:47 -060035inherit autotools gettext pkgconfig systemd
Patrick Williams56b44a92024-01-19 08:49:29 -060036inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'setuptools3-base', '', d)}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050038# | ../git/elaborate.cxx:2601:21: error: storing the address of local variable 'sym' in '*s.systemtap_session::symbol_resolver' [-Werror=dangling-pointer=]
39CXXFLAGS += "-Wno-dangling-pointer"
40
Andrew Geissler6ce62a22020-11-30 19:58:47 -060041# exporter comes with python3-probes
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080042PACKAGES =+ "${PN}-exporter"
Patrick Williams213cb262021-08-07 19:21:33 -050043FILES:${PN}-exporter = "${sysconfdir}/stap-exporter/* \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080044 ${sysconfdir}/sysconfig/stap-exporter \
Andrew Geissler5199d832021-09-24 16:47:35 -050045 ${systemd_system_unitdir}/stap-exporter.service \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080046 ${sbindir}/stap-exporter"
Patrick Williams213cb262021-08-07 19:21:33 -050047RDEPENDS:${PN}-exporter = "${PN} python3-core python3-netclient"
48SYSTEMD_SERVICE:${PN}-exporter = "stap-exporter.service"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080049
Andrew Geissler6ce62a22020-11-30 19:58:47 -060050PACKAGES =+ "${PN}-runtime"
Patrick Williams213cb262021-08-07 19:21:33 -050051FILES:${PN}-runtime = "\
Andrew Geissler6ce62a22020-11-30 19:58:47 -060052 ${bindir}/staprun \
53 ${bindir}/stap-merge \
54 ${bindir}/stapsh \
55 ${libexecdir}/${BPN}/stapio \
56"
Patrick Williams213cb262021-08-07 19:21:33 -050057RDEPENDS:${PN}:class-target += "${PN}-runtime"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060058
59PACKAGES =+ "${PN}-examples"
Patrick Williams213cb262021-08-07 19:21:33 -050060FILES:${PN}-examples = "${datadir}/${BPN}/examples/"
61RDEPENDS:${PN}-examples += "${PN}"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060062
63# don't complain that some examples involve bash, perl, php...
Patrick Williams213cb262021-08-07 19:21:33 -050064INSANE_SKIP:${PN}-examples += "file-rdeps"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060065
66PACKAGES =+ "${PN}-python"
Patrick Williams213cb262021-08-07 19:21:33 -050067FILES:${PN}-python += "\
Andrew Geissler6ce62a22020-11-30 19:58:47 -060068 ${bindir}/dtrace \
69 ${libdir}/python*/ \
70 ${libexecdir}/${BPN}/python/ \
71"
72# python material requires sdt headers
Patrick Williams213cb262021-08-07 19:21:33 -050073RDEPENDS:${PN}-python += "${PN}-dev python3-core"
74INSANE_SKIP:${PN}-python += "dev-deps"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060075
Patrick Williams213cb262021-08-07 19:21:33 -050076do_configure:prepend () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080077 # Improve reproducibility for c++ object files
78 reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}"
79 sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h
80}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050081
Patrick Williams213cb262021-08-07 19:21:33 -050082do_install:append () {
Brad Bishop316dfdd2018-06-25 12:45:53 -040083 if [ ! -f ${D}${bindir}/stap ]; then
84 # translator disabled case, need to leave only minimal runtime
85 rm -rf ${D}${datadir}/${PN}
86 rm ${D}${libexecdir}/${PN}/stap-env
87 fi
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080088
Andrew Geissler6ce62a22020-11-30 19:58:47 -060089 if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then
Brad Bishop64c979e2019-11-04 13:55:29 -050090 # Fix makefile hardcoded path assumptions for systemd (assumes $prefix)
91 # without usrmerge distro feature enabled
92 install -d `dirname ${D}${systemd_unitdir}`
93 mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}`
94 rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty
95 fi
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080096
97 # Ensure correct ownership for files copied in
Andrew Geissler6ce62a22020-11-30 19:58:47 -060098 if [ -d ${D}${sysconfdir}/stap-exporter ]; then
99 chown root:root ${D}${sysconfdir}/stap-exporter/* -R
100 fi
Brad Bishop316dfdd2018-06-25 12:45:53 -0400101}
102
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500103BBCLASSEXTEND = "nativesdk"