nixpkgs/pkgs/os-specific/linux/acpi-call/default.nix
Shea Levy 4fa4ab3a6e Partially revert my recent kernelPackages changes
First, pass in `self' again so that overriding works properly (thanks
for pointing that out, @edolstra)

Second, instead of having linuxPackages*.kernel mean something different
inside the set and out, add a new attribute linuxPackages*.kernelDev,
which for the generic kernel is simply linuxPackages*.kernel but for the
manual-config kernel is the `dev' output (which has the build tree,
source tree, etc.)

The second change required trivial modifications in a bunch of
expressions, I verified that all of the linuxPackages* sets defined in
all-packages.nix have the same drv paths before and after the change.

Signed-off-by: Shea Levy <shea@shealevy.com>
2013-03-24 07:45:00 -04:00

32 lines
1,012 B
Nix

{ stdenv, fetchgit, kernelDev }:
stdenv.mkDerivation {
name = "acpi-call-${kernelDev.version}";
src = fetchgit {
url = "git://github.com/mkottman/acpi_call.git";
rev = "b570c3b6c7016174107558464e864391d8bbd176";
sha256 = "a89c62d391b721bb87a094f81cefc77d9c80de4bb314bb6ea449c3ef2decad5e";
};
preBuild = ''
sed -e 's/break/true/' -i test_off.sh
sed -e 's@/bin/bash@.bin/sh@' -i test_off.sh
sed -e "s@/lib/modules/\$(.*)@${kernelDev}/lib/modules/${kernelDev.modDirVersion}@" -i Makefile
'';
installPhase = ''
mkdir -p $out/lib/modules/${kernelDev.modDirVersion}/misc
cp acpi_call.ko $out/lib/modules/${kernelDev.modDirVersion}/misc
mkdir -p $out/bin
cp test_off.sh $out/bin/test_discrete_video_off.sh
chmod a+x $out/bin/test_discrete_video_off.sh
'';
meta = {
maintainers = [stdenv.lib.maintainers.raskin];
platforms = stdenv.lib.platforms.linux;
description = "A module allowing arbitrary ACPI calls; use case: hybrid video";
};
}