summaryrefslogtreecommitdiffstats
path: root/package/powertop
diff options
context:
space:
mode:
authorSteven Noonan <steven@uplinklabs.net>2015-03-18 22:40:21 -0700
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-03-20 16:28:27 +0100
commit0adc0e24eed72efca0097c7567319f07b8af6d94 (patch)
tree6be60335228f0cd9231c6a5f1c60fce201a9d7af /package/powertop
parent4c6bc6f2cdce3eaf51d6529dd7b493857b4b20e0 (diff)
downloadbuildroot-0adc0e24eed72efca0097c7567319f07b8af6d94.tar.gz
buildroot-0adc0e24eed72efca0097c7567319f07b8af6d94.zip
powertop: new package
[Thomas: - fix commit title - powertop wants libintl unconditionally, so make sure BR2_PACKAGE_GETTEXT is selected when BR2_NEEDS_GETTEXT is set, and add gettext to the dependencies. - add missing comment about thread dependency. - add missing dependency on host-pkgconf, without which powertop cannot find libnl. - patch src/Makefile.am to not pass -fstack-protector, which fails to build if the toolchain does not have SSP support. - rename patch powertop-autotune.patch to confirm to the patch naming convention.] Signed-off-by: Steven Noonan <steven@uplinklabs.net> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/powertop')
-rw-r--r--package/powertop/0001-autotune-fix-use-after-close.patch15
-rw-r--r--package/powertop/0002-dont-force-stack-smashing-protection.patch18
-rw-r--r--package/powertop/Config.in18
-rw-r--r--package/powertop/powertop.hash2
-rw-r--r--package/powertop/powertop.mk20
5 files changed, 73 insertions, 0 deletions
diff --git a/package/powertop/0001-autotune-fix-use-after-close.patch b/package/powertop/0001-autotune-fix-use-after-close.patch
new file mode 100644
index 0000000000..f2b3dff102
--- /dev/null
+++ b/package/powertop/0001-autotune-fix-use-after-close.patch
@@ -0,0 +1,15 @@
+Patch pulled from https://projects.archlinux.org/svntogit/community.git/tree/trunk?h=packages/powertop&id=37469c47b885c50365f57044e4ad72e0e3512b91
+
+Fixes a use-after-close bug in create_all_devfreq_devices().
+
+Signed-off-by: Steven Noonan <steven@uplinklabs.net>
+
+--- a/src/devices/devfreq.cpp
++++ b/src/devices/devfreq.cpp
+@@ -247,6 +247,7 @@ void create_all_devfreq_devices(void)
+ fprintf(stderr, "Devfreq not enabled\n");
+ is_enabled = false;
+ closedir(dir);
++ dir = NULL;
+ return;
+ }
diff --git a/package/powertop/0002-dont-force-stack-smashing-protection.patch b/package/powertop/0002-dont-force-stack-smashing-protection.patch
new file mode 100644
index 0000000000..75ed2d1c24
--- /dev/null
+++ b/package/powertop/0002-dont-force-stack-smashing-protection.patch
@@ -0,0 +1,18 @@
+Do not pass -fstack-protector unconditionally
+
+Using -fstack-protector only works when the toolchain has SSP support.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/src/Makefile.am
+===================================================================
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -127,7 +127,6 @@
+ -Wformat \
+ -Wshadow \
+ -fno-omit-frame-pointer \
+- -fstack-protector \
+ $(GLIB2_CFLAGS) \
+ $(LIBNL_CFLAGS) \
+ $(NCURSES_CFLAGS) \
diff --git a/package/powertop/Config.in b/package/powertop/Config.in
new file mode 100644
index 0000000000..f157f4618a
--- /dev/null
+++ b/package/powertop/Config.in
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_POWERTOP
+ bool "powertop"
+ # pciutils dependency
+ depends on !BR2_bfin
+ # libnl dependency
+ depends on BR2_TOOLCHAIN_HAS_THREADS
+ select BR2_PACKAGE_NCURSES
+ select BR2_PACKAGE_PCIUTILS
+ select BR2_PACKAGE_LIBNL
+ select BR2_PACKAGE_GETTEXT if BR2_NEEDS_GETTEXT
+ help
+ A tool to diagnose issues with power consumption and power management
+
+ https://01.org/powertop/
+
+comment "powertop needs a toolchain w/ threads"
+ depends on !BR2_bfin
+ depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/powertop/powertop.hash b/package/powertop/powertop.hash
new file mode 100644
index 0000000000..b64981ea7a
--- /dev/null
+++ b/package/powertop/powertop.hash
@@ -0,0 +1,2 @@
+# Locally-generated hash
+sha256 8d4b1490e2baad4467c0ded3c423db4472dcbf7b2dd8f8f2a928f54047c678ca powertop-2.7.tar.gz
diff --git a/package/powertop/powertop.mk b/package/powertop/powertop.mk
new file mode 100644
index 0000000000..43d70a30ad
--- /dev/null
+++ b/package/powertop/powertop.mk
@@ -0,0 +1,20 @@
+################################################################################
+#
+# powertop
+#
+################################################################################
+
+POWERTOP_VERSION = 2.7
+POWERTOP_SITE = https://01.org/sites/default/files/downloads/powertop/
+POWERTOP_DEPENDENCIES = pciutils ncurses libnl host-pkgconf
+POWERTOP_LICENSE = GPLv2
+POWERTOP_LICENSE_FILES = COPYING
+# We're patching Makefile.am
+POWERTOP_AUTORECONF = YES
+
+ifeq ($(BR2_PACKAGE_GETTEXT),y)
+POWERTOP_DEPENDENCIES += gettext
+POWERTOP_CONF_ENV += LIBS='-lintl'
+endif
+
+$(eval $(autotools-package))
OpenPOWER on IntegriCloud