Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8cbe9f03f9d1
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: fe8875a363fc
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Apr 8, 2020

  1. 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.
    Mic92 committed Apr 8, 2020
    Copy the full SHA
    1ae03c9 View commit details
  2. Merge pull request #84597 from NixOS/acpi-call

    linuxPackages.acpi-call: switch to nix-community fork
    Mic92 authored Apr 8, 2020
    Copy the full SHA
    fe8875a View commit details
Showing with 18 additions and 28 deletions.
  1. +18 −28 pkgs/os-specific/linux/acpi-call/default.nix
46 changes: 18 additions & 28 deletions pkgs/os-specific/linux/acpi-call/default.nix
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/bash@.bin/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";
};
}