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