Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ab328ab

Browse files
committedApr 7, 2020
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.
1 parent 7183053 commit ab328ab

File tree

1 file changed

+15
-27
lines changed

1 file changed

+15
-27
lines changed
 
+15-27
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,31 @@
1-
{ stdenv, fetchgit, fetchpatch, kernel }:
1+
{ stdenv, fetchFromGitHub, fetchpatch, kernel }:
22

33
stdenv.mkDerivation {
4-
name = "acpi-call-${kernel.version}";
4+
name = "acpi-call-2020-04-07-${kernel.version}";
55

6-
src = fetchgit {
7-
url = "git://github.com/mkottman/acpi_call.git";
8-
rev = "ac67445bc75ec4fcf46ceb195fb84d74ad350d51";
9-
sha256 = "0jl19irz9x9pxab2qp4z8c3jijv2m30zhmnzi6ygbrisqqlg4c75";
6+
src = fetchFromGitHub {
7+
owner = "Mic92";
8+
repo = "acpi_call";
9+
rev = "3d7c9fe5ed3fc5ed5bafd39d54b1fdc7a09ce710";
10+
sha256 = "09kp8zl392h99wjwzqrdw2xcfnsc944hzmfwi8n1y7m2slpdybv3";
1011
};
1112

12-
patches = [
13-
(fetchpatch {
14-
url = "https://github.com/mkottman/acpi_call/pull/67.patch";
15-
sha256 = "0z07apvdl8nvl8iwfk1sl1iidfjyx12fc0345bmp2nq1537kpbri";
16-
})
17-
];
18-
1913
hardeningDisable = [ "pic" ];
2014

2115
nativeBuildInputs = kernel.moduleBuildDependencies;
2216

23-
preBuild = ''
24-
sed -e 's/break/true/' -i examples/turn_off_gpu.sh
25-
sed -e 's@/bin/bash@.bin/sh@' -i examples/turn_off_gpu.sh
26-
sed -e "s@/lib/modules/\$(.*)@${kernel.dev}/lib/modules/${kernel.modDirVersion}@" -i Makefile
27-
sed -e 's@acpi/acpi[.]h@linux/acpi.h@g' -i acpi_call.c
28-
'';
17+
makeFlags = [
18+
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
19+
];
2920

3021
installPhase = ''
31-
mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc
32-
cp acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc
33-
mkdir -p $out/bin
34-
cp examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh
35-
chmod a+x $out/bin/test_discrete_video_off.sh
22+
install -D acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc/acpi_call.ko
23+
install -D -m755 examples/turn_off_gpu.sh $out/bin/test_discrete_video_off.sh
3624
'';
3725

38-
meta = {
39-
maintainers = [stdenv.lib.maintainers.raskin];
40-
platforms = stdenv.lib.platforms.linux;
26+
meta = with stdenv.lib; {
27+
maintainers = with maintainers; [ raskin mic92 ];
28+
platforms = platforms.linux;
4129
description = "A module allowing arbitrary ACPI calls; use case: hybrid video";
4230
};
4331
}

0 commit comments

Comments
 (0)
Please sign in to comment.