summary refs log tree commit diff
path: root/pkgs/os-specific/linux/powertop
diff options
context:
space:
mode:
authorFlorian Friesdorf <flo@chaoflow.net>2012-06-11 10:28:21 +0000
committerFlorian Friesdorf <flo@chaoflow.net>2012-06-11 10:28:21 +0000
commita44af6bbc1286ac62f9c7e0db4c722bc0676f2f5 (patch)
tree3647838cc8f615189492073ecaf551802e121841 /pkgs/os-specific/linux/powertop
parent22da1866a7d3050f6265c59b8ed6b8d6f4e7809c (diff)
downloadnixpkgs-a44af6bbc1286ac62f9c7e0db4c722bc0676f2f5.tar
nixpkgs-a44af6bbc1286ac62f9c7e0db4c722bc0676f2f5.tar.gz
nixpkgs-a44af6bbc1286ac62f9c7e0db4c722bc0676f2f5.tar.bz2
nixpkgs-a44af6bbc1286ac62f9c7e0db4c722bc0676f2f5.tar.lz
nixpkgs-a44af6bbc1286ac62f9c7e0db4c722bc0676f2f5.tar.xz
nixpkgs-a44af6bbc1286ac62f9c7e0db4c722bc0676f2f5.tar.zst
nixpkgs-a44af6bbc1286ac62f9c7e0db4c722bc0676f2f5.zip
powertop-2.0
svn path=/nixpkgs/trunk/; revision=34451
Diffstat (limited to 'pkgs/os-specific/linux/powertop')
-rw-r--r--pkgs/os-specific/linux/powertop/default.nix19
-rw-r--r--pkgs/os-specific/linux/powertop/inotify_user.patch28
-rw-r--r--pkgs/os-specific/linux/powertop/modprobe_configs.patch28
-rw-r--r--pkgs/os-specific/linux/powertop/powertop-1.13.patch15
4 files changed, 8 insertions, 82 deletions
diff --git a/pkgs/os-specific/linux/powertop/default.nix b/pkgs/os-specific/linux/powertop/default.nix
index 3d8ca36c3ed..d175c5f0478 100644
--- a/pkgs/os-specific/linux/powertop/default.nix
+++ b/pkgs/os-specific/linux/powertop/default.nix
@@ -1,17 +1,14 @@
-{stdenv, fetchurl, ncurses, gettext}:
+{ stdenv, fetchurl, gettext, libnl1, ncurses, pciutils, pkgconfig, zlib }:
 
-stdenv.mkDerivation {
-  name = "powertop-1.13";
+stdenv.mkDerivation rec {
+  name = "powertop-2.0";
   src = fetchurl {
-    url = http://www.lesswatts.org/projects/powertop/download/powertop-1.13.tar.gz;
-    sha256 = "164dqp6msdaxpi2bmvwawasyrf1sfvanlc9ddp97v1wnjh46dj1b";
+    url = "https://01.org/powertop/sites/default/files/downloads/${name}.tar.bz2";
+    sha256 = "7af51d320856b3446bcc314c9414385f3b05b9360f650883b0210cd3b12c5c1c";
   };
-  patches = [
-    ./powertop-1.13.patch
-    ./inotify_user.patch
-    ./modprobe_configs.patch
-  ];
-  buildInputs = [ncurses gettext];
+
+  buildInputs = [ gettext libnl1 ncurses pciutils pkgconfig zlib ];
+
   meta = {
     description = "Analyze power consumption on Intel-based laptops";
     license = "GPLv2";
diff --git a/pkgs/os-specific/linux/powertop/inotify_user.patch b/pkgs/os-specific/linux/powertop/inotify_user.patch
deleted file mode 100644
index 46caed050f4..00000000000
--- a/pkgs/os-specific/linux/powertop/inotify_user.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 89e46f3270e3b6d704959c4d0f44ae6bab8f7616 Mon Sep 17 00:00:00 2001
-From: Florian Friesdorf <flo@chaoflow.net>
-Date: Thu, 13 Oct 2011 10:14:34 +0200
-Subject: [PATCH] CONFIG_INOTIFY_USER instead of CONFIG_INOTIFY
-
-since 2.6.36 the former fully replaced the latter
----
- powertop.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/powertop.c b/powertop.c
-index 74eb328..8df3652 100644
---- a/powertop.c
-+++ b/powertop.c
-@@ -1191,8 +1191,8 @@ int main(int argc, char **argv)
- 		suggest_kernel_config("CONFIG_CPU_FREQ_STAT", 1,
- 				    _("Suggestion: Enable the CONFIG_CPU_FREQ_STAT kernel configuration option.\n"
- 				      "This option allows PowerTOP to show P-state percentages \n" "P-states correspond to CPU frequencies."), 2);
--		suggest_kernel_config("CONFIG_INOTIFY", 1,
--				    _("Suggestion: Enable the CONFIG_INOTIFY kernel configuration option.\n"
-+		suggest_kernel_config("CONFIG_INOTIFY_USER", 1,
-+				    _("Suggestion: Enable the CONFIG_INOTIFY_USER kernel configuration option.\n"
- 				      "This option allows programs to wait for changes in files and directories\n"
- 				      "instead of having to poll for these changes"), 5);
- 
--- 
-1.7.6
-
diff --git a/pkgs/os-specific/linux/powertop/modprobe_configs.patch b/pkgs/os-specific/linux/powertop/modprobe_configs.patch
deleted file mode 100644
index 3d6e2a28761..00000000000
--- a/pkgs/os-specific/linux/powertop/modprobe_configs.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From 0002a70b83221a8a831d776836d13105ac886323 Mon Sep 17 00:00:00 2001
-From: Florian Friesdorf <flo@chaoflow.net>
-Date: Thu, 13 Oct 2011 14:57:02 +0200
-Subject: [PATCH] powertop tries to load configs, if /proc/config.gz is
- missing
-
----
- config.c |    4 ++++
- 1 files changed, 4 insertions(+), 0 deletions(-)
-
-diff --git a/config.c b/config.c
-index b2567f2..62ac978 100644
---- a/config.c
-+++ b/config.c
-@@ -44,6 +44,10 @@ static void read_kernel_config(void)
- 	char filename[100];
- 	if (configcount)
- 		return;
-+	if (access("/proc/config.gz", R_OK) != 0) {
-+		file = popen("modprobe configs >/dev/null 2>&1", "r");
-+		pclose(file);
-+	}
- 	if (access("/proc/config.gz", R_OK) == 0) {
- 		file = popen("zcat /proc/config.gz 2> /dev/null", "r");
- 		while (file && !feof(file)) {
--- 
-1.7.6
-
diff --git a/pkgs/os-specific/linux/powertop/powertop-1.13.patch b/pkgs/os-specific/linux/powertop/powertop-1.13.patch
deleted file mode 100644
index cf66b297190..00000000000
--- a/pkgs/os-specific/linux/powertop/powertop-1.13.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru powertop-1.13/Makefile powertop-1.13.new/Makefile
---- powertop-1.13/Makefile
-+++ powertop-1.13.new/Makefile
-@@ -1,8 +1,8 @@
- VERSION = 1.13
- 
--BINDIR=/usr/bin
--LOCALESDIR=/usr/share/locale
--MANDIR=/usr/share/man/man8
-+BINDIR=${out}/bin
-+LOCALESDIR=${out}/share/locale
-+MANDIR=${out}/share/man/man8
- WARNFLAGS=-Wall -Wshadow -W -Wformat -Wimplicit-function-declaration -Wimplicit-int
- CFLAGS?=-Os -g ${WARNFLAGS}
- CC?=gcc