linuxPackages_5_12.rtl88xxau-aircrack: fix build

This commit is contained in:
fortuneteller2k 2021-05-21 07:33:08 +08:00 committed by Jonathan Ringer
parent d42cd445dd
commit 8cb96583e2

@ -1,15 +1,17 @@
{ lib, stdenv, fetchFromGitHub, kernel }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, kernel }:
let
rev = "3a64331a1c809bbbc21eca63b825970f213ec5ac";
in
stdenv.mkDerivation rec {
name = "rtl88xxau-aircrack-${kernel.version}-${version}";
rev = "c0ce81745eb3471a639f0efd4d556975153c666e";
version = "${builtins.substring 0 6 rev}";
pname = "rtl88xxau-aircrack";
version = "${kernel.version}-${builtins.substring 0 6 rev}";
src = fetchFromGitHub {
owner = "aircrack-ng";
repo = "rtl8812au";
inherit rev;
sha256 = "131cwwg3czq0i1xray20j71n836g93ac064nvf8wi13c2wr36ppc";
sha256 = "sha256-goaN80imfCeUwiHokJd10CFKskE3iL5BO/xOQk6PtHE=";
};
buildInputs = kernel.moduleBuildDependencies;
@ -18,6 +20,14 @@ stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE="-Wno-error=incompatible-pointer-types";
# Fix build for 5.12 kernels
patches = [
(fetchpatch {
url = "https://github.com/aircrack-ng/rtl8812au/commit/9b4c60a89c2a55f36454b950a86246b6b86a9681.patch";
sha256 = "sha256-HPhTLstqAePF3H6WeM9Fu4/8UjNL+9xl4L8xq3NOWuM=";
})
];
prePatch = ''
substituteInPlace ./Makefile \
--replace /lib/modules/ "${kernel.dev}/lib/modules/" \
@ -33,7 +43,7 @@ stdenv.mkDerivation rec {
meta = with lib; {
description = "Aircrack-ng kernel module for Realtek 88XXau network cards\n(8811au, 8812au, 8814au and 8821au chipsets) with monitor mode and injection support.";
homepage = "https://github.com/aircrack-ng/rtl8812au";
license = licenses.gpl2;
license = licenses.gpl2Only;
maintainers = [ maintainers.jethro ];
platforms = [ "x86_64-linux" "i686-linux" ];
};