1{ stdenv, fetchurl, kernel, coreutils, pciutils, gettext }:
2
3stdenv.mkDerivation {
4 name = "cpupower-${kernel.version}";
5
6 src = kernel.src;
7
8 buildInputs = [ coreutils pciutils gettext ];
9
10 configurePhase = ''
11 cd tools/power/cpupower
12 sed -i 's,/bin/true,${coreutils}/bin/true,' Makefile
13 sed -i 's,/bin/pwd,${coreutils}/bin/pwd,' Makefile
14 sed -i 's,/usr/bin/install,${coreutils}/bin/install,' Makefile
15 '';
16
17 buildPhase = ''
18 make
19 '';
20
21 installPhase = ''
22 make \
23 bindir="$out/bin" \
24 sbindir="$out/sbin" \
25 mandir="$out/share/man" \
26 includedir="$out/include" \
27 libdir="$out/lib" \
28 localedir="$out/share/locale" \
29 docdir="$out/share/doc/cpupower" \
30 confdir="$out/etc" \
31 install install-man
32 '';
33
34 enableParallelBuilding = true;
35
36 meta = with stdenv.lib; {
37 description = "Tool to examine and tune power saving features";
38 homepage = https://www.kernel.org.org/;
39 license = licenses.gpl2;
40 platforms = platforms.linux;
41 };
42}