1{ stdenv, fetchurl, gettext, libnl, ncurses, pciutils, pkgconfig, zlib }:
2
3stdenv.mkDerivation rec {
4 name = "powertop-2.7";
5
6 src = fetchurl {
7 url = "https://01.org/sites/default/files/downloads/powertop/${name}.tar.gz";
8 sha256 = "1jkqqr3l1x98m7rgin1dgfzxqwj4vciw9lyyq1kl9bdswa818jwd";
9 };
10
11 buildInputs = [ gettext libnl ncurses pciutils pkgconfig zlib ];
12
13 # Fix --auto-tune bug:
14 # https://lists.01.org/pipermail/powertop/2014-December/001727.html
15 patches = [ ./auto-tune.patch ];
16
17 postPatch = ''
18 substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe"
19 '';
20
21 meta = {
22 description = "Analyze power consumption on Intel-based laptops";
23 license = stdenv.lib.licenses.gpl2;
24 maintainers = [ stdenv.lib.maintainers.chaoflow ];
25 platforms = stdenv.lib.platforms.linux;
26 };
27}