dev-util/sysprof: bump to 3.28.1
[gentoo.git] / dev-util / sysprof / sysprof-3.28.1.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit gnome.org gnome2-utils meson systemd xdg
7
8 DESCRIPTION="System-wide Linux Profiler"
9 HOMEPAGE="http://sysprof.com/"
10
11 LICENSE="GPL-3+ GPL-2+"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="gtk systemd"
15
16 RDEPEND="
17         >=dev-libs/glib-2.44:2
18         sys-auth/polkit
19         gtk? ( >=x11-libs/gtk+-3.22.0:3 )
20         systemd? ( >=sys-apps/systemd-222 )
21 "
22 # libxml2 required for glib-compile-resources; appstream-glib for appdata.xml translations
23 DEPEND="${RDEPEND}
24         app-text/yelp-tools
25         dev-libs/appstream-glib
26         dev-libs/libxml2:2
27         >=sys-devel/gettext-0.19.6
28         >=sys-kernel/linux-headers-2.6.32
29         virtual/pkgconfig
30 "
31
32 PATCHES=( "${FILESDIR}"/${PV}-fix-nosystemd-build.patch )
33
34 src_configure() {
35         # -Dwith_sysprofd=host currently unavailable from ebuild
36         local emesonargs=(
37                 $(meson_use gtk enable_gtk)
38                 -Dwith_sysprofd=$(usex systemd bundled none)
39                 -Dsystemdunitdir=$(systemd_get_systemunitdir)
40                 # -Ddebugdir
41         )
42         meson_src_configure
43 }
44
45 pkg_postinst() {
46         xdg_pkg_postinst
47         gnome2_icon_cache_update
48         gnome2_schemas_update
49
50         elog "On many systems, especially amd64, it is typical that with a modern"
51         elog "toolchain -fomit-frame-pointer for gcc is the default, because"
52         elog "debugging is still possible thanks to gcc4/gdb location list feature."
53         elog "However sysprof is not able to construct call trees if frame pointers"
54         elog "are not present. Therefore -fno-omit-frame-pointer CFLAGS is suggested"
55         elog "for the libraries and applications involved in the profiling. That"
56         elog "means a CPU register is used for the frame pointer instead of other"
57         elog "purposes, which means a very minimal performance loss when there is"
58         elog "register pressure."
59         if ! use systemd; then
60                 elog ""
61                 elog "Without systemd, sysprof may not function when launched as a regular user,"
62                 elog "thus suboptimal running from root account may be necessary."
63                 if use gtk; then
64                         elog "Under wayland, that limits the recording usage to sysprof-cli utility."
65                 fi
66         fi
67 }
68
69 pkg_postrm() {
70         xdg_pkg_postrm
71         gnome2_icon_cache_update
72         gnome2_schemas_update
73 }