Unverified Commit b9194dda authored by Vladimír Čunát's avatar Vladimír Čunát
Browse files

linuxPackages.system76-acpi: fix build (#407169)

parents 47a2e2a3 4adde8f3
Loading
Loading
Loading
Loading
+14 −10
Original line number Diff line number Diff line
@@ -4,20 +4,17 @@
  fetchFromGitHub,
  kernel,
}:
let
stdenv.mkDerivation (finalAttrs: {
  name = "system76-acpi-module-${finalAttrs.version}-${kernel.version}";
  version = "1.0.2";
  sha256 = "1i7zjn5cdv9h00fgjg46b8yrz4d3dqvfr25g3f13967ycy58m48h";
in
stdenv.mkDerivation {
  name = "system76-acpi-module-${version}-${kernel.version}";

  passthru.moduleName = "system76_acpi";

  src = fetchFromGitHub {
    owner = "pop-os";
    repo = "system76-acpi-dkms";
    rev = version;
    inherit sha256;
    tag = finalAttrs.version;
    hash = "sha256-EJGKimf+mDSCG6+I7DZuo5GfPVqGPPkcADDtxoqV/8Q=";
  };

  hardeningDisable = [ "pic" ];
@@ -29,14 +26,21 @@ stdenv.mkDerivation {
  ];

  installPhase = ''
    runHook preInstall

    install -D system76_acpi.ko $out/lib/modules/${kernel.modDirVersion}/misc/system76_acpi.ko
    mkdir -p $out/lib/udev/hwdb.d
    mv lib/udev/hwdb.d/* $out/lib/udev/hwdb.d

    runHook postInstall
  '';

  meta = with lib; {
  # GCC 14 makes this an error by default, remove when fixed upstream
  env.NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-pointer-types";

  meta = {
    maintainers = with lib.maintainers; [ ahoneybun ];
    license = [ licenses.gpl2Only ];
    license = [ lib.licenses.gpl2Only ];
    platforms = [
      "i686-linux"
      "x86_64-linux"
@@ -48,4 +52,4 @@ stdenv.mkDerivation {
      This provides the system76_acpi in-tree driver for systems missing it.
    '';
  };
}
})