Subject: [bug#65548] [PATCH] gnu: Add rtl8852au-linux-module.

From: gemmaro <[email-masked]>
Date: Sat, 26 Aug 2023 16:24:21 +0900

* gnu/packages/linux.scm (rtl8852au-linux-module): New variable.
---
I tried to build with --rounds=2 for this patch and it failed.
Maybe something needs to be done to make it reproducible.

 gnu/packages/linux.scm | 51 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 10babc8f7e..b8e32ae4d6 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -74,6 +74,7 @@
 ;;; Copyright © 2023 Bruno Victal <[email-masked]>
 ;;; Copyright © 2023 Yovan Naumovski <[email-masked]>
 ;;; Copyright © 2023 Zheng Junjie <[email-masked]>
+;;; Copyright © 2023 gemmaro <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1722,6 +1723,56 @@ (define-public ddcci-driver-linux
 supported under @file{/sys/class/backlight/}.")
     (license license:gpl2+)))
 
+(define-public rtl8852au-linux-module
+  (package
+    (name "rtl8852au-linux-module")
+    (version "20230801-716e525")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/lwfinger/rtl8852au")
+                    (commit "716e52567d7a4d1b665a09bea08125fd10c59bf6")))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1i1idqiwqzvxkjnkmlrr23bnvi59iimp09ng66jsfawf8kn9j9g1"))))
+    (build-system linux-module-build-system)
+    (arguments
+     (list #:tests? #f ;no tests
+           #:make-flags #~(list (string-append "CC="
+                                               #$(cc-for-target))
+                                (string-append "KSRC="
+                                               (assoc-ref %build-inputs
+                                                "linux-module-builder")
+                                               "/lib/modules/build"))
+           #:phases #~(modify-phases %standard-phases
+                        (replace 'build
+                          (lambda* (#:key outputs #:allow-other-keys)
+                            (substitute* "Makefile"
+                              (("\\$\\(KSRC\\)")
+                               (string-append (assoc-ref %build-inputs
+                                               "linux-module-builder")
+                                              "/lib/modules/build"))
+                              (("\\$\\(CC\\)")
+                               (string-append #$(cc-for-target))))
+                            (invoke "make")))
+                        (add-after 'build 'strip
+                          (lambda _
+                            (invoke "make" "strip"))))))
+    (home-page "https://github.com/lwfinger/rtl8852au")
+    (synopsis "Driver for RTL8862AU tipsets")
+    (description
+     "@samp{rtl8852au} is a driver for RTL8862AU tipsets, and was started
+with the code from the Realtek USB driver
+@samp{RTL8852AU_WiFi_linux_v1.15.0.1-0-g487ee886.20210714}.  The
+devices handled by this driver include BUFFALO
+`@samp{WI-U3-1200AX2(/N)} with USB ID @samp{0411:0312}', for example.
+
+You might want to add this package to the
+@code{kernel-loadable-modules} field in the @code{operating-system}
+declaraiton.")
+    (license license:gpl2)))
+
 (define-public v4l2loopback-linux-module
   (package
     (name "v4l2loopback-linux-module")

base-commit: eeb71d778f149834015858467fbeeb1276d96d1d
-- 
2.41.0