2015-05-09 01:11:20 +03:00
|
|
|
{ stdenv, fetchurl, kernel, which }:
|
|
|
|
|
|
|
|
assert stdenv.isLinux;
|
2015-05-09 03:49:36 +03:00
|
|
|
# Don't bother with older versions, though some would probably work:
|
2015-12-15 21:14:00 +03:00
|
|
|
assert stdenv.lib.versionAtLeast kernel.version "4.3";
|
2015-05-09 03:49:36 +03:00
|
|
|
# Disable on grsecurity kernels, which break module building:
|
|
|
|
assert !kernel.features ? grsecurity;
|
2015-05-09 01:11:20 +03:00
|
|
|
|
2015-08-31 21:53:41 +03:00
|
|
|
let
|
|
|
|
release = "0.4.0";
|
2015-12-15 21:14:00 +03:00
|
|
|
revbump = "rev19"; # don't forget to change forum download id...
|
2015-08-31 21:53:41 +03:00
|
|
|
version = "${release}-${revbump}";
|
|
|
|
in stdenv.mkDerivation {
|
2015-05-09 01:11:20 +03:00
|
|
|
name = "linux-phc-intel-${version}-${kernel.version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2015-12-15 21:14:00 +03:00
|
|
|
sha256 = "1apvjp2rpaf3acjvsxgk6xiwrx4n9p565gxvra05pvicwikfiqa8";
|
|
|
|
url = "http://www.linux-phc.org/forum/download/file.php?id=168";
|
2015-08-31 21:53:41 +03:00
|
|
|
name = "phc-intel-pack-${revbump}.tar.bz2";
|
2015-05-09 01:11:20 +03:00
|
|
|
};
|
|
|
|
|
2015-08-31 21:53:41 +03:00
|
|
|
buildInputs = [ which ];
|
|
|
|
|
|
|
|
makeFlags = with kernel; [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"KERNELSRC=${dev}/lib/modules/${modDirVersion}/build"
|
|
|
|
];
|
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
make $makeFlags brave
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
|
|
|
installPhase = ''
|
2015-12-17 16:47:25 +03:00
|
|
|
install -m 755 -d $out/lib/modules/${kernel.modDirVersion}/extra/
|
|
|
|
install -m 644 *.ko $out/lib/modules/${kernel.modDirVersion}/extra/
|
2015-08-31 21:53:41 +03:00
|
|
|
'';
|
|
|
|
|
2015-05-09 01:11:20 +03:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
inherit version;
|
|
|
|
description = "Undervolting kernel driver for Intel processors";
|
|
|
|
longDescription = ''
|
|
|
|
PHC is a Linux kernel patch to undervolt processors. This can divide the
|
|
|
|
power consumption of the CPU by two or more, increasing battery life
|
|
|
|
while noticably reducing fan noise. This driver works only on supported
|
|
|
|
Intel architectures.
|
|
|
|
'';
|
|
|
|
homepage = http://www.linux-phc.org/;
|
|
|
|
downloadPage = "http://www.linux-phc.org/forum/viewtopic.php?f=7&t=267";
|
2015-05-28 20:20:29 +03:00
|
|
|
license = licenses.gpl2;
|
2015-08-31 21:53:41 +03:00
|
|
|
platforms = platforms.linux;
|
2015-05-09 01:11:20 +03:00
|
|
|
maintainers = with maintainers; [ nckx ];
|
|
|
|
};
|
|
|
|
}
|