1SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
2DESCRIPTION = "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."
5HOMEPAGE = "https://sourceware.org/systemtap/"
6
7require systemtap_git.inc
8
9SRC_URI += "file://0001-improve-reproducibility-for-c-compiling.patch"
10
11DEPENDS = "elfutils"
12
13EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
14            --without-nss --without-avahi --without-dyninst \
15            --disable-server --disable-grapher --enable-prologues \
16            --with-python3 --without-python2-probes \
17            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
24PACKAGECONFIG ??= "translator sqlite monitor python3-probes"
25PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash"
26PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
27PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3"
28PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c"
29PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native"
30
31inherit autotools gettext pkgconfig systemd
32inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'distutils3-base', '', d)}
33
34# exporter comes with python3-probes
35PACKAGES =+ "${PN}-exporter"
36FILES:${PN}-exporter = "${sysconfdir}/stap-exporter/* \
37                        ${sysconfdir}/sysconfig/stap-exporter \
38                        ${systemd_unitdir}/system/stap-exporter.service \
39                        ${sbindir}/stap-exporter"
40RDEPENDS:${PN}-exporter = "${PN} python3-core python3-netclient"
41SYSTEMD_SERVICE:${PN}-exporter = "stap-exporter.service"
42
43PACKAGES =+ "${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
69do_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}
74
75do_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
81
82   if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then
83      # 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
89
90   # Ensure correct ownership for files copied in
91   if [ -d ${D}${sysconfdir}/stap-exporter ]; then
92       chown root:root ${D}${sysconfdir}/stap-exporter/* -R
93   fi
94}
95
96BBCLASSEXTEND = "nativesdk"
97