blob: c4a6eef59a0c5fd408f3ec42713f3a0709edd3a6 [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"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080036FILES_${PN}-exporter = "${sysconfdir}/stap-exporter/* \
37 ${sysconfdir}/sysconfig/stap-exporter \
38 ${systemd_unitdir}/system/stap-exporter.service \
39 ${sbindir}/stap-exporter"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080040RDEPENDS_${PN}-exporter = "${PN} python3-core python3-netclient"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080041SYSTEMD_SERVICE_${PN}-exporter = "stap-exporter.service"
42
Andrew Geissler6ce62a22020-11-30 19:58:47 -060043PACKAGES =+ "${PN}-runtime"
44FILES_${PN}-runtime = "\
45 ${bindir}/staprun \
46 ${bindir}/stap-merge \
47 ${bindir}/stapsh \
48 ${libexecdir}/${BPN}/stapio \
49"
50RDEPENDS_${PN}_class-target += "${PN}-runtime"
51
52PACKAGES =+ "${PN}-examples"
53FILES_${PN}-examples = "${datadir}/${BPN}/examples/"
54RDEPENDS_${PN}-examples += "${PN}"
55
56# don't complain that some examples involve bash, perl, php...
57INSANE_SKIP_${PN}-examples += "file-rdeps"
58
59PACKAGES =+ "${PN}-python"
60FILES_${PN}-python += "\
61 ${bindir}/dtrace \
62 ${libdir}/python*/ \
63 ${libexecdir}/${BPN}/python/ \
64"
65# python material requires sdt headers
66RDEPENDS_${PN}-python += "${PN}-dev python3-core"
67INSANE_SKIP_${PN}-python += "dev-deps"
68
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080069do_configure_prepend () {
70 # 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
Brad Bishop316dfdd2018-06-25 12:45:53 -040075do_install_append () {
76 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"