lol
1{ stdenv, fetchurl, gettext, libnl, ncurses, pciutils, pkgconfig, zlib }:
2
3stdenv.mkDerivation rec {
4 name = "powertop-${version}";
5 version = "2.9";
6
7 src = fetchurl {
8 url = "https://01.org/sites/default/files/downloads/powertop/powertop-v${version}.tar.gz";
9 sha256 = "0l4jjlf05li2mc6g8nrss3h435wjhmnqd8m7v3kha3x0x7cbfzxa";
10 };
11
12 nativeBuildInputs = [ pkgconfig ];
13 buildInputs = [ gettext libnl ncurses pciutils zlib ];
14
15 postPatch = ''
16 substituteInPlace src/main.cpp --replace "/sbin/modprobe" "modprobe"
17 substituteInPlace src/calibrate/calibrate.cpp --replace "/usr/bin/xset" "xset"
18 '';
19
20 meta = with stdenv.lib; {
21 description = "Analyze power consumption on Intel-based laptops";
22 homepage = https://01.org/powertop;
23 license = licenses.gpl2;
24 maintainers = with maintainers; [ chaoflow fpletz ];
25 platforms = platforms.linux;
26 };
27}