-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linuxPackages.acpi-call: switch to nix-community fork
This fixes also build against linux 5.6 We also took the opportunity to cleanup the build. (cherry picked from commit 1ae03c9)
- Loading branch information
Showing
1 changed file
with
18 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,33 @@ | ||
{ stdenv, fetchgit, fetchpatch, kernel }: | ||
{ stdenv, fetchFromGitHub, kernel }: | ||
|
||
stdenv.mkDerivation { | ||
name = "acpi-call-${kernel.version}"; | ||
stdenv.mkDerivation rec { | ||
pname = "acpi-call"; | ||
version = "2020-04-07-${kernel.version}"; | ||
|
||
src = fetchgit { | ||
url = "git://github.com/mkottman/acpi_call.git"; | ||
rev = "ac67445bc75ec4fcf46ceb195fb84d74ad350d51"; | ||
sha256 = "0jl19irz9x9pxab2qp4z8c3jijv2m30zhmnzi6ygbrisqqlg4c75"; | ||
src = fetchFromGitHub { | ||
owner = "nix-community"; | ||
repo = "acpi_call"; | ||
rev = "3d7c9fe5ed3fc5ed5bafd39d54b1fdc7a09ce710"; | ||
sha256 = "09kp8zl392h99wjwzqrdw2xcfnsc944hzmfwi8n1y7m2slpdybv3"; | ||
}; | ||
|
||
patches = [ | ||
(fetchpatch { | ||
url = "https://github.com/mkottman/acpi_call/pull/67.patch"; | ||
sha256 = "0z07apvdl8nvl8iwfk1sl1iidfjyx12fc0345bmp2nq1537kpbri"; | ||
}) | ||
]; | ||
|
||
hardeningDisable = [ "pic" ]; | ||
|
||
nativeBuildInputs = kernel.moduleBuildDependencies; | ||
|
||
preBuild = '' | ||
sed -e 's/break/true/' -i examples/turn_off_gpu.sh | ||
sed -e 's@/bin/[email protected]/sh@' -i examples/turn_off_gpu.sh | ||
sed -e "s@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@" -i Makefile | ||
sed -e 's@acpi/acpi[.]h@linux/acpi.h@g' -i acpi_call.c | ||
''; | ||
makeFlags = [ | ||
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" | ||
]; | ||
|
||
installPhase = '' | ||
mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc | ||
cp acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc | ||
mkdir -p $out/bin | ||
cp examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh | ||
chmod a+x $out/bin/test_discrete_video_off.sh | ||
install -D acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc/acpi_call.ko | ||
install -D -m755 examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh | ||
''; | ||
|
||
meta = { | ||
maintainers = [stdenv.lib.maintainers.raskin]; | ||
platforms = stdenv.lib.platforms.linux; | ||
meta = with stdenv.lib; { | ||
maintainers = with maintainers; [ raskin mic92 ]; | ||
inherit (src.meta) homepage; | ||
platforms = platforms.linux; | ||
description = "A module allowing arbitrary ACPI calls; use case: hybrid video"; | ||
}; | ||
} |