2012-02-17 14:32:28 +00:00
|
|
|
{ stdenv, fetchgit, kernel }:
|
2010-11-11 22:00:57 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2012-02-17 14:32:28 +00:00
|
|
|
name = "acpi-call-${kernel.version}";
|
|
|
|
|
2010-11-11 22:00:57 +00:00
|
|
|
src = fetchgit {
|
2012-02-17 14:32:28 +00:00
|
|
|
url = "git://github.com/mkottman/acpi_call.git";
|
2012-08-03 12:20:24 +00:00
|
|
|
rev = "b570c3b6c7016174107558464e864391d8bbd176";
|
|
|
|
sha256 = "a89c62d391b721bb87a094f81cefc77d9c80de4bb314bb6ea449c3ef2decad5e";
|
2010-11-11 22:00:57 +00:00
|
|
|
};
|
2012-02-17 14:32:28 +00:00
|
|
|
|
2010-11-11 22:00:57 +00:00
|
|
|
preBuild = ''
|
|
|
|
sed -e 's/break/true/' -i test_off.sh
|
|
|
|
sed -e 's@/bin/bash@.bin/sh@' -i test_off.sh
|
2012-08-03 12:20:24 +00:00
|
|
|
sed -e "s@/lib/modules/\$(.*)@${kernel}/lib/modules/${kernel.modDirVersion}@" -i Makefile
|
2010-11-11 22:00:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2012-08-03 12:20:24 +00:00
|
|
|
mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc
|
|
|
|
cp acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/bin
|
2010-11-11 22:02:19 +00:00
|
|
|
cp test_off.sh $out/bin/test_discrete_video_off.sh
|
2012-08-03 12:49:57 +00:00
|
|
|
chmod a+x $out/bin/test_discrete_video_off.sh
|
2010-11-11 22:00:57 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
maintainers = [stdenv.lib.maintainers.raskin];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
description = "A module allowing arbitrary ACPI calls; use case: hybrid video";
|
|
|
|
};
|
|
|
|
}
|