powertop: upgraded package to upstream 2.8

Upgraded sys-power/powertop to version 2.8 on amd64, arm, x86

BUG=chromium:565988
TEST=`powertop --version` contains string "2.8"
TEST=no functional regressions
TEST=arm: builds

Change-Id: If6c365c9dc574739b8767c004191000be985dc47
Reviewed-on: https://chromium-review.googlesource.com/315884
Commit-Ready: Joe Konno <joe.konno@linux.intel.com>
Tested-by: Brian Wilson <brian.wilson@intel.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/metadata/md5-cache/sys-power/powertop-2.7-r2 b/metadata/md5-cache/sys-power/powertop-2.8
similarity index 64%
rename from metadata/md5-cache/sys-power/powertop-2.7-r2
rename to metadata/md5-cache/sys-power/powertop-2.8
index 117a168..8f753a5 100644
--- a/metadata/md5-cache/sys-power/powertop-2.7-r2
+++ b/metadata/md5-cache/sys-power/powertop-2.8
@@ -1,13 +1,13 @@
 DEFINED_PHASES=configure prepare setup
-DEPEND=dev-libs/libnl:3 sys-apps/pciutils sys-libs/ncurses[unicode?] virtual/pkgconfig sys-devel/gettext
+DEPEND=dev-libs/libnl:3 sys-apps/pciutils sys-libs/ncurses:=[unicode?] virtual/pkgconfig sys-devel/gettext
 DESCRIPTION=tool that helps you find what software is using the most power
 EAPI=5
 HOMEPAGE=https://01.org/powertop/
 IUSE=nls unicode X
 KEYWORDS=*
 LICENSE=GPL-2
-RDEPEND=dev-libs/libnl:3 sys-apps/pciutils sys-libs/ncurses[unicode?] X? ( x11-apps/xset ) virtual/libintl
+RDEPEND=dev-libs/libnl:3 sys-apps/pciutils sys-libs/ncurses:=[unicode?] X? ( x11-apps/xset ) virtual/libintl
 SLOT=0
-SRC_URI=https://01.org/sites/default/files/downloads/powertop/powertop-2.7.tar.gz
+SRC_URI=https://01.org/sites/default/files/downloads/powertop/powertop-2.8.tar.gz
 _eclasses_=eutils	06133990e861be0fe60c2b428fd025d9	linux-info	a238cd46144175b5f6538caa13bdf180	multilib	3bf24e6abb9b76d9f6c20600f0b716bf	toolchain-funcs	48b38a216afb92db6314d6c3187abea3	versionator	865bc8b2fc9fcfb6d520bdf5a110f5ed
-_md5_=ad0daa5dea99a3071193f84e5976a851
+_md5_=29ead5da98a45e7a7af918830919c0f0
diff --git a/sys-power/powertop/Manifest b/sys-power/powertop/Manifest
index 82a0df6..13bbbe4 100644
--- a/sys-power/powertop/Manifest
+++ b/sys-power/powertop/Manifest
@@ -1 +1 @@
-DIST powertop-2.7.tar.gz 654329 SHA256 8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca SHA512 7a69bee4dd5330d9d5d6da9c47615337cdde27eb1eeb3ffc75297df1a61b5ced9f2ee94684680154e71c0c46fac72e5485cadf7a43e943d8087b1d7b4f33f59d WHIRLPOOL b2323b3222fa45ff1874cca9f2a3121aebd54d4dd9c89a31f7299fac15e30013ae3103f79759e86368efdba528eb3a2f166359cbe15d97022166abc16e6fddad
+DIST powertop-2.8.tar.gz 670000 SHA256 a87b563f73106babfa3e74dcf92f252938c061e309ace20a361358bbfa579c5a SHA512 253d0e15f0972cf8639735c510f4884d49a0da76c31dd2f39603e2297e6c6f0b9fa283c7b3cb04a431c91f8296275c0adaecc4c3e9ea132c0c31064f7f432c80 WHIRLPOOL 87b859b76395d6b1b380c7459b0d918713e94e8fc4ac40fde8b82f2112dec2df3caffb645b082cedd0bba5c232555de26e81fbe8dd3041875c32c864650ef132
diff --git a/sys-power/powertop/powertop-2.7-r2.ebuild b/sys-power/powertop/powertop-2.8.ebuild
similarity index 86%
rename from sys-power/powertop/powertop-2.7-r2.ebuild
rename to sys-power/powertop/powertop-2.8.ebuild
index 0473856..439da74 100644
--- a/sys-power/powertop/powertop-2.7-r2.ebuild
+++ b/sys-power/powertop/powertop-2.8.ebuild
@@ -1,6 +1,6 @@
 # Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-power/powertop/powertop-2.7-r2.ebuild,v 1.1 2015/07/08 11:53:58 vapier Exp $
+# $Id$
 
 EAPI="5"
 
@@ -24,7 +24,7 @@
 COMMON_DEPEND="
 	dev-libs/libnl:3
 	sys-apps/pciutils
-	sys-libs/ncurses[unicode?]
+	sys-libs/ncurses:=[unicode?]
 "
 
 DEPEND="${COMMON_DEPEND}
@@ -50,7 +50,6 @@
 		~HPET_TIMER
 		~CPU_FREQ_STAT
 		~CPU_FREQ_GOV_ONDEMAND
-		~PM_RUNTIME
 		~FTRACE
 		~BLK_DEV_IO_TRACE
 		~TIMER_STATS
@@ -65,7 +64,6 @@
 	ERROR_KERNEL_HPET_TIMER="HPET_TIMER should be enabled in the kernel for full powertop function"
 	ERROR_KERNEL_CPU_FREQ_STAT="CPU_FREQ_STAT should be enabled in the kernel for full powertop function"
 	ERROR_KERNEL_CPU_FREQ_GOV_ONDEMAND="CPU_FREQ_GOV_ONDEMAND should be enabled in the kernel for full powertop function"
-	ERROR_KERNEL_PM_RUNTIME="PM_RUNTIME should be enabled in the kernel for full powertop function"
 	ERROR_KERNEL_FTRACE="FTRACE needs to be turned on to enable BLK_DEV_IO_TRACE"
 	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"
 	ERROR_KERNEL_TIMER_STATS="TIMER_STATS should be enabled in the kernel for full powertop function"
@@ -84,15 +82,24 @@
 			ERROR_KERNEL_EVENT_POWER_TRACING_DEPRECATED="EVENT_POWER_TRACING_DEPRECATED should be enabled in the kernel for full powertop function"
 			check_extra_config
 		fi
+		if kernel_is -lt 3 19; then
+			CONFIG_CHECK="~PM_RUNTIME"
+			ERROR_KERNEL_PM_RUNTIME="PM_RUNTIME should be enabled in the kernel for full powertop function"
+			check_extra_config
+		else
+			CONFIG_CHECK="~PM"
+			ERROR_KERNEL_PM="PM should be enabled in the kernel for full powertop function"
+			check_extra_config
+		fi
 	fi
 }
 
 src_prepare() {
-	epatch "${FILESDIR}"/${P}-baytrail-msr.patch
-	epatch "${FILESDIR}"/${P}-broadwell.patch
-	epatch "${FILESDIR}"/${P}-braswell.patch
-	epatch "${FILESDIR}"/${P}-skylake.patch
-	epatch "${FILESDIR}"/${P}-skylake-2.patch
+	if [[ ${PV} == "9999" ]] ; then
+		eautoreconf
+	else
+		default
+	fi
 }
 
 src_configure() {