diff mbox series

[bug#40568] gnu: Add rtl8821ce-linux-module.

Message ID 87r1wte2ub.fsf@rohleder.de
State Accepted
Headers show
Series [bug#40568] gnu: Add rtl8821ce-linux-module. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

Michael Rohleder April 12, 2020, 4:37 a.m. UTC
My girlfriend's laptop has this chip, so I needed this to spread the
love of guix (to her already endless sea of love).

Im not sure about the naming, it could also be something like
rtl8821ce-driver-linux.

So far (2 days), it works very well.

Comments

vasilii.smirnov--- via Guix-patches" via April 12, 2020, 5:51 a.m. UTC | #1
Good morning,

Michael Rohleder 写道:
> My girlfriend's laptop has this chip, so I needed this to spread 
> the
> love of guix (to her already endless sea of love).

Yay!  Thank her for the patch.

> Im not sure about the naming, it could also be something like
> rtl8821ce-driver-linux.

-linux-module's better.  The currently random names should 
 probably be standardised.

> + (define-public rtl8821ce-linux-module

This can go under the existing rtl8812au-aircrack-ng-linux-module. 
I knew that chip number looked familiar.

> +      (version (git-version "0.0.1" revision commit))

This should be 0.0.0 unless there's some 0.0.1 release of which 
I'm unaware.

> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url 
> "https://github.com/tomaspinho/rtl8821ce.git")
> +               (commit commit)))
> +         (sha256
> +          (base32
> + 
> "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))

Git check-outs should have a

  (file-name (git-file-name name version))

field to make the store file name a bit nicer (and easier to 
recognise).

> +      (arguments
> +       `(#:phases
> +         (modify-phases %standard-phases
> +           (replace 'build
> +             (lambda* (#:key inputs make-flags 
> #:allow-other-keys)

OK, I'm going to add #:make-flags support to l-m-b-s.

> +               (setenv "CC" "gcc")
> +               (apply invoke "make"
> +                      (string-append "KSRC="
> +                                     (assoc-ref inputs 
> "linux-module-builder")
> +                                     "/lib/modules/build")
> +                      (or make-flags '())))))

If you copied this from rtl8812au-aircrack-ng-linux-module I 
apologise :-)  I (and Guix) prefer specifying the default up-front 
like so:

  (lambda* (#:key (make-flags '()) … #:allow-other-keys) …

Then you can use it without ceremony.

> +      (synopsis "Linux Driver for Realtek RTL8821CE wireless 
> network adapters")

‘driver’

> +      (description "This is Realtek's RTL8821CE Linux driver 
> for wireless

Invisible trailing space.

> +network adapters.")

This ought to be a little longer.  I can throw something together 
if you're without inspiration.

The AUR package says ‘with firmware’, which would be problematic 
if I'd actually found any.  The README also mentions firmware at 
the very end.  Do you know what they mean?  Does this package work 
out of the box with Linux-Libre?  Is that only for Bluetooth?

Kind regards,

T G-R
diff mbox series

Patch

From 6332e69b7fedb614c404a434bcf35e217ce3a953 Mon Sep 17 00:00:00 2001
From: Michael Rohleder <mike@rohleder.de>
Date: Sun, 12 Apr 2020 06:33:23 +0200
Subject: [PATCH] gnu: Add rtl8821ce-linux-module.

* gnu/packages/linux.scm (rtl8821ce-linux-module): New variable.
---
 gnu/packages/linux.scm | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 0be50c11e0..a833aae236 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -42,6 +42,7 @@ 
 ;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
 ;;; Copyright © 2020 Chris Marusich <cmmarusich@gmail.com>
 ;;; Copyright © 2020 Vincent Legoll <vincent.legoll@gmail.com>
+;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1125,6 +1126,40 @@  module allows the control of the backlight level or luminance property when
 supported under @file{/sys/class/backlight/}.")
     (license license:gpl2+)))
 
+(define-public rtl8821ce-linux-module
+  (let ((commit "69765eb288a8dfad3b055b906760b53e02ab1dea")
+        (revision "0"))
+    (package
+      (name "rtl8821ce-linux-module")
+      (version (git-version "0.0.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/tomaspinho/rtl8821ce.git")
+               (commit commit)))
+         (sha256
+          (base32
+           "17jiw25k74kv5lnvgycvj2g1n06hbrpjz6p4znk4a62g136rhn4s"))))
+      (build-system linux-module-build-system)
+      (arguments
+       `(#:phases
+         (modify-phases %standard-phases
+           (replace 'build
+             (lambda* (#:key inputs make-flags #:allow-other-keys)
+               (setenv "CC" "gcc")
+               (apply invoke "make"
+                      (string-append "KSRC="
+                                     (assoc-ref inputs "linux-module-builder")
+                                     "/lib/modules/build")
+                      (or make-flags '())))))
+         #:tests? #f))
+      (home-page "https://github.com/tomaspinho/rtl8821ce")
+      (synopsis "Linux Driver for Realtek RTL8821CE wireless network adapters")
+      (description "This is Realtek's RTL8821CE Linux driver for wireless 
+network adapters.")
+      (license license:gpl2))))
+
 
 ;;;
 ;;; Pluggable authentication modules (PAM).
-- 
2.26.0