blob: 923d64b975b92f6acba72df0c610536efd140043 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Script-directed dynamic tracing and performance analysis tool for Linux"
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002HOMEPAGE = "https://sourceware.org/systemtap/"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05003
4require systemtap_git.inc
5
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08006SRC_URI += "file://0001-improve-reproducibility-for-c-compiling.patch"
7
Brad Bishop316dfdd2018-06-25 12:45:53 -04008DEPENDS = "elfutils"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009
10EXTRA_OECONF += "--with-libelf=${STAGING_DIR_TARGET} --without-rpm \
11 --without-nss --without-avahi --without-dyninst \
12 --disable-server --disable-grapher --enable-prologues \
Brad Bishop37a0e4d2017-12-04 01:01:44 -050013 --with-python3 --without-python2-probes \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014 ac_cv_prog_have_javac=no \
15 ac_cv_prog_have_jar=no "
16
17STAP_DOCS ?= "--disable-docs --disable-publican --disable-refdocs"
18
19EXTRA_OECONF += "${STAP_DOCS} "
20
Brad Bishop316dfdd2018-06-25 12:45:53 -040021PACKAGECONFIG ??= "translator sqlite monitor python3-probes"
Andrew Geissler6ce62a22020-11-30 19:58:47 -060022PACKAGECONFIG[translator] = "--enable-translator,--disable-translator,boost,bash"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050023PACKAGECONFIG[libvirt] = "--enable-libvirt,--disable-libvirt,libvirt"
Patrick Williamsc0f7c042017-02-23 20:41:17 -060024PACKAGECONFIG[sqlite] = "--enable-sqlite,--disable-sqlite,sqlite3"
25PACKAGECONFIG[monitor] = "--enable-monitor,--disable-monitor,ncurses json-c"
Brad Bishop37a0e4d2017-12-04 01:01:44 -050026PACKAGECONFIG[python3-probes] = "--with-python3-probes,--without-python3-probes,python3-setuptools-native"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027
Andrew Geissler6ce62a22020-11-30 19:58:47 -060028inherit autotools gettext pkgconfig systemd
29inherit ${@bb.utils.contains('PACKAGECONFIG', 'python3-probes', 'distutils3-base', '', d)}
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080030
Andrew Geissler6ce62a22020-11-30 19:58:47 -060031# exporter comes with python3-probes
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032PACKAGES =+ "${PN}-exporter"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080033FILES_${PN}-exporter = "${sysconfdir}/stap-exporter/* \
34 ${sysconfdir}/sysconfig/stap-exporter \
35 ${systemd_unitdir}/system/stap-exporter.service \
36 ${sbindir}/stap-exporter"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037RDEPENDS_${PN}-exporter = "${PN} python3-core python3-netclient"
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080038SYSTEMD_SERVICE_${PN}-exporter = "stap-exporter.service"
39
Andrew Geissler6ce62a22020-11-30 19:58:47 -060040PACKAGES =+ "${PN}-runtime"
41FILES_${PN}-runtime = "\
42 ${bindir}/staprun \
43 ${bindir}/stap-merge \
44 ${bindir}/stapsh \
45 ${libexecdir}/${BPN}/stapio \
46"
47RDEPENDS_${PN}_class-target += "${PN}-runtime"
48
49PACKAGES =+ "${PN}-examples"
50FILES_${PN}-examples = "${datadir}/${BPN}/examples/"
51RDEPENDS_${PN}-examples += "${PN}"
52
53# don't complain that some examples involve bash, perl, php...
54INSANE_SKIP_${PN}-examples += "file-rdeps"
55
56PACKAGES =+ "${PN}-python"
57FILES_${PN}-python += "\
58 ${bindir}/dtrace \
59 ${libdir}/python*/ \
60 ${libexecdir}/${BPN}/python/ \
61"
62# python material requires sdt headers
63RDEPENDS_${PN}-python += "${PN}-dev python3-core"
64INSANE_SKIP_${PN}-python += "dev-deps"
65
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080066do_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 Williamsc124f4f2015-09-15 14:41:29 -050071
Brad Bishop316dfdd2018-06-25 12:45:53 -040072do_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 Bishop1a4b7ee2018-12-16 17:11:34 -080078
Andrew Geissler6ce62a22020-11-30 19:58:47 -060079 if [ -d ${D}${prefix}/lib/systemd -a ${D}${prefix}/lib != `dirname ${D}${systemd_unitdir}` ]; then
Brad Bishop64c979e2019-11-04 13:55:29 -050080 # 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 Bishop1a4b7ee2018-12-16 17:11:34 -080086
87 # Ensure correct ownership for files copied in
Andrew Geissler6ce62a22020-11-30 19:58:47 -060088 if [ -d ${D}${sysconfdir}/stap-exporter ]; then
89 chown root:root ${D}${sysconfdir}/stap-exporter/* -R
90 fi
Brad Bishop316dfdd2018-06-25 12:45:53 -040091}
92
Brad Bishop6e60e8b2018-02-01 10:27:11 -050093BBCLASSEXTEND = "nativesdk"