blob: 8f0de5f0f0de4ff07b4a0d798ca8a2df1622c88a [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
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08009SRC_URI += "file://0001-improve-reproducibility-for-c-compiling.patch"
10
Brad Bishop316dfdd2018-06-25 12:45:53 -040011DEPENDS = "elfutils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012
13EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
14 --without-nss --without-avahi --without-dyninst \
15 --disable-server --disable-grapher --enable-prologues \
Brad Bishop37a0e4d2017-12-04 01:01:44 -050016 --with-python3 --without-python2-probes \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050017 ac_cv_prog_have_javac=no \
18 ac_cv_prog_have_jar=no "
19
20STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs"
21
22EXTRA_OECONF += "${STAP_DOCS} "
23
Brad Bishop316dfdd2018-06-25 12:45:53 -040024PACKAGECONFIG ??= "translator sqlite monitor python3-probes"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060025PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050026PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060027PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3"
28PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c"
Brad Bishop37a0e4d2017-12-04 01:01:44 -050029PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050030
Andrew Geissler6ce62a22020-11-30 19:58:47 -060031inherit autotools gettext pkgconfig systemd
32inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'distutils3-base', '', d)}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033
Andrew Geissler6ce62a22020-11-30 19:58:47 -060034# exporter comes with python3-probes
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080035PACKAGES =+ "${PN}-exporter"
Patrick Williams213cb262021-08-07 19:21:33 -050036FILES:${PN}-exporter = "${sysconfdir}/stap-exporter/* \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037 ${sysconfdir}/sysconfig/stap-exporter \
Andrew Geissler5199d832021-09-24 16:47:35 -050038 ${systemd_system_unitdir}/stap-exporter.service \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080039 ${sbindir}/stap-exporter"
Patrick Williams213cb262021-08-07 19:21:33 -050040RDEPENDS:${PN}-exporter = "${PN} python3-core python3-netclient"
41SYSTEMD_SERVICE:${PN}-exporter = "stap-exporter.service"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080042
Andrew Geissler6ce62a22020-11-30 19:58:47 -060043PACKAGES =+ "${PN}-runtime"
Patrick Williams213cb262021-08-07 19:21:33 -050044FILES:${PN}-runtime = "\
Andrew Geissler6ce62a22020-11-30 19:58:47 -060045 ${bindir}/staprun \
46 ${bindir}/stap-merge \
47 ${bindir}/stapsh \
48 ${libexecdir}/${BPN}/stapio \
49"
Patrick Williams213cb262021-08-07 19:21:33 -050050RDEPENDS:${PN}:class-target += "${PN}-runtime"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060051
52PACKAGES =+ "${PN}-examples"
Patrick Williams213cb262021-08-07 19:21:33 -050053FILES:${PN}-examples = "${datadir}/${BPN}/examples/"
54RDEPENDS:${PN}-examples += "${PN}"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060055
56# don't complain that some examples involve bash, perl, php...
Patrick Williams213cb262021-08-07 19:21:33 -050057INSANE_SKIP:${PN}-examples += "file-rdeps"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060058
59PACKAGES =+ "${PN}-python"
Patrick Williams213cb262021-08-07 19:21:33 -050060FILES:${PN}-python += "\
Andrew Geissler6ce62a22020-11-30 19:58:47 -060061 ${bindir}/dtrace \
62 ${libdir}/python*/ \
63 ${libexecdir}/${BPN}/python/ \
64"
65# python material requires sdt headers
Patrick Williams213cb262021-08-07 19:21:33 -050066RDEPENDS:${PN}-python += "${PN}-dev python3-core"
67INSANE_SKIP:${PN}-python += "dev-deps"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060068
Patrick Williams213cb262021-08-07 19:21:33 -050069do_configure:prepend () {
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080070 # Improve reproducibility for c++ object files
71 reltivepath="${@os.path.relpath(d.getVar('STAGING_INCDIR'), d.getVar('S'))}"
72 sed -i "s:@RELATIVE_STAGING_INCDIR@:$reltivepath:g" ${S}/stringtable.h
73}
Patrick Williamsc124f4f2015-09-15 14:41:29 -050074
Patrick Williams213cb262021-08-07 19:21:33 -050075do_install:append () {
Brad Bishop316dfdd2018-06-25 12:45:53 -040076 if [ ! -f ${D}${bindir}/stap ]; then
77 # translator disabled case, need to leave only minimal runtime
78 rm -rf ${D}${datadir}/${PN}
79 rm ${D}${libexecdir}/${PN}/stap-env
80 fi
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080081
Andrew Geissler6ce62a22020-11-30 19:58:47 -060082 if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then
Brad Bishop64c979e2019-11-04 13:55:29 -050083 # Fix makefile hardcoded path assumptions for systemd (assumes $prefix)
84 # without usrmerge distro feature enabled
85 install -d `dirname ${D}${systemd_unitdir}`
86 mv ${D}${prefix}/lib/systemd `dirname ${D}${systemd_unitdir}`
87 rmdir ${D}${prefix}/lib --ignore-fail-on-non-empty
88 fi
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080089
90 # Ensure correct ownership for files copied in
Andrew Geissler6ce62a22020-11-30 19:58:47 -060091 if [ -d ${D}${sysconfdir}/stap-exporter ]; then
92 chown root:root ${D}${sysconfdir}/stap-exporter/* -R
93 fi
Brad Bishop316dfdd2018-06-25 12:45:53 -040094}
95
Brad Bishop6e60e8b2018-02-01 10:27:11 -050096BBCLASSEXTEND = "nativesdk"