powertop-2.6.ebuild 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI="5"
  4. inherit eutils linux-info autotools
  5. if [[ ${PV} == "9999" ]] ; then
  6. EGIT_REPO_URI="git://github.com/fenrus75/powertop.git"
  7. inherit git-2 autotools
  8. SRC_URI=""
  9. else
  10. SRC_URI="https://01.org/sites/default/files/downloads/${PN}/${P}.tar.gz"
  11. KEYWORDS="amd64 arm ppc sparc x86 ~amd64-linux ~x86-linux"
  12. fi
  13. DESCRIPTION="tool that helps you find what software is using the most power"
  14. HOMEPAGE="https://01.org/powertop/"
  15. LICENSE="GPL-2"
  16. SLOT="0"
  17. IUSE="unicode X"
  18. COMMON_DEPEND="
  19. dev-libs/libnl:3
  20. sys-apps/pciutils
  21. sys-libs/ncurses:*[unicode?]
  22. "
  23. DEPEND="${COMMON_DEPEND}
  24. virtual/pkgconfig
  25. sys-devel/gettext
  26. "
  27. RDEPEND="
  28. ${COMMON_DEPEND}
  29. X? ( x11-apps/xset )
  30. virtual/libintl
  31. "
  32. DOCS=( TODO README )
  33. S="${WORKDIR}/${PN}"
  34. pkg_setup() {
  35. CONFIG_CHECK="
  36. ~X86_MSR
  37. ~DEBUG_FS
  38. ~PERF_EVENTS
  39. ~TRACEPOINTS
  40. ~NO_HZ
  41. ~HIGH_RES_TIMERS
  42. ~HPET_TIMER
  43. ~CPU_FREQ_STAT
  44. ~CPU_FREQ_GOV_ONDEMAND
  45. ~FTRACE
  46. ~BLK_DEV_IO_TRACE
  47. ~TIMER_STATS
  48. ~TRACING
  49. "
  50. ERROR_KERNEL_X86_MSR="X86_MSR is not enabled in the kernel, you almost certainly need it"
  51. ERROR_KERNEL_DEBUG_FS="DEBUG_FS is not enabled in the kernel, you almost certainly need it"
  52. ERROR_KERNEL_PERF_EVENTS="PERF_EVENTS should be enabled in the kernel for full powertop function"
  53. ERROR_KERNEL_TRACEPOINTS="TRACEPOINTS should be enabled in the kernel for full powertop function"
  54. ERROR_KERNEL_NO_HZ="NO_HZ should be enabled in the kernel for full powertop function"
  55. ERROR_KERNEL_HIGH_RES_TIMERS="HIGH_RES_TIMERS should be enabled in the kernel for full powertop function"
  56. ERROR_KERNEL_HPET_TIMER="HPET_TIMER should be enabled in the kernel for full powertop function"
  57. ERROR_KERNEL_CPU_FREQ_STAT="CPU_FREQ_STAT should be enabled in the kernel for full powertop function"
  58. ERROR_KERNEL_CPU_FREQ_GOV_ONDEMAND="CPU_FREQ_GOV_ONDEMAND should be enabled in the kernel for full powertop function"
  59. ERROR_KERNEL_FTRACE="FTRACE needs to be turned on to enable BLK_DEV_IO_TRACE"
  60. ERROR_KERNEL_BLK_DEV_IO_TRACE="BLK_DEV_IO_TRACE needs to be turned on to enable TIMER_STATS, TRACING and EVENT_POWER_TRACING_DEPRECATED"
  61. ERROR_KERNEL_TIMER_STATS="TIMER_STATS should be enabled in the kernel for full powertop function"
  62. ERROR_KERNEL_TRACING="TRACING should be enabled in the kernel for full powertop function"
  63. linux-info_pkg_setup
  64. if linux_config_exists; then
  65. if kernel_is -lt 3 7 0; then
  66. if linux_chkconfig_present SND_HDA_INTEL; then
  67. CONFIG_CHECK="~SND_HDA_POWER_SAVE"
  68. ERROR_KERNEL_SND_HDA_POWER_SAVE="SND_HDA_POWER_SAVE should be enabled in the kernel for full powertop function"
  69. check_extra_config
  70. fi
  71. fi
  72. if kernel_is -lt 3 9 0; then
  73. CONFIG_CHECK="~EVENT_POWER_TRACING_DEPRECATED"
  74. ERROR_KERNEL_EVENT_POWER_TRACING_DEPRECATED="EVENT_POWER_TRACING_DEPRECATED should be enabled in the kernel for full powertop function"
  75. check_extra_config
  76. fi
  77. if kernel_is -lt 3 19; then
  78. CONFIG_CHECK="~PM_RUNTIME"
  79. ERROR_KERNEL_PM_RUNTIME="PM_RUNTIME should be enabled in the kernel for full powertop function"
  80. check_extra_config
  81. else
  82. CONFIG_CHECK="~PM"
  83. ERROR_KERNEL_PM="PM should be enabled in the kernel for full powertop function"
  84. check_extra_config
  85. fi
  86. fi
  87. }
  88. src_prepare() {
  89. epatch "${FILESDIR}"/powertop-2.4-tinfo.patch
  90. eautoreconf
  91. }
  92. src_configure() {
  93. export ac_cv_search_delwin=$(usex unicode -lncursesw -lncurses)
  94. default
  95. }