2014-01-05 02:57:21 +01:00
|
|
|
{ stdenv, fetchgit, kernel }:
|
2010-11-11 23:00:57 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2014-01-05 02:57:21 +01:00
|
|
|
name = "acpi-call-${kernel.version}";
|
2012-02-17 15:32:28 +01:00
|
|
|
|
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";
|
2013-07-02 15:05:19 +02:00
|
|
|
rev = "46dd97e115ddc7219c88b0818c4d5b235162fe6e";
|
|
|
|
sha256 = "1bi0azd7xxhrivjhnmxllj2sfj12br56mxii20mnqdpqwyz0rhni";
|
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 = ''
|
2013-07-02 15:05:19 +02:00
|
|
|
sed -e 's/break/true/' -i examples/turn_off_gpu.sh
|
|
|
|
sed -e 's@/bin/bash@.bin/sh@' -i examples/turn_off_gpu.sh
|
2014-01-05 02:57:21 +01:00
|
|
|
sed -e "s@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@" -i Makefile
|
2010-11-11 23:00:57 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-01-05 02:57:21 +01:00
|
|
|
mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc
|
|
|
|
cp acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc
|
2012-01-18 21:16:00 +01:00
|
|
|
mkdir -p $out/bin
|
2013-07-02 15:05:19 +02:00
|
|
|
cp examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh
|
2012-08-03 14:49:57 +02:00
|
|
|
chmod a+x $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";
|
|
|
|
};
|
|
|
|
}
|