unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#37853] [PATCH] gnu: Add ddcci-driver-linux.
@ 2019-10-21 15:16 Brice Waegeneire
  2019-10-22  9:42 ` Mathieu Othacehe
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Brice Waegeneire @ 2019-10-21 15:16 UTC (permalink / raw)
  To: 37853

* gnu/packages/linux.scm (ddcci-driver-linux): Add variable.
---
 gnu/packages/linux.scm | 59 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 59 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 989d55f8aa..4a98c9e60e 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -968,6 +968,65 @@ and should be used with caution, especially on untested models.")
 between the CDemu userspace daemon and linux kernel.")
     (license license:gpl2+)))
 
+
+(define-public ddcci-driver-linux
+  (package
+    (name "ddcci-driver-linux")
+    (version "0.3.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
+    (build-system linux-module-build-system)
+    (arguments
+     `(#:tests? #f                               ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'build
+           (lambda* (#:key inputs #:allow-other-keys)
+             (for-each (lambda (module)
+                         (invoke "make" "-C"
+                                 (string-append (assoc-ref inputs "linux-module-builder")
+                                                "/lib/modules/build")
+                                 (string-append "M=" (getcwd) "/" module)))
+                       (list "ddcci" "ddcci-backlight"))
+             #t))
+         (replace 'install
+           (lambda* (#:key inputs native-inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (moddir (string-append out "/lib/modules"))
+                    (kmod (assoc-ref (or native-inputs inputs) "kmod")))
+               ;; Install kernel modules
+               (mkdir-p moddir)
+               (for-each (lambda (module)
+                           (invoke "make" "-C"
+                                   (string-append
+                                    (assoc-ref inputs "linux-module-builder")
+                                    "/lib/modules/build")
+                                   (string-append "M=" (getcwd) "/" module)
+                                   (string-append "DEPMOD=" kmod "/bin/depmod")
+                                   (string-append "MODULE_DIR=" moddir)
+                                   (string-append "INSTALL_PATH=" out)
+                                   (string-append "INSTALL_MOD_PATH=" out)
+                                   "INSTALL_MOD_STRIP=1"
+                                   "modules_install"))
+                         (list "ddcci" "ddcci-backlight")))
+             #t)))))
+    (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
+    (synopsis "A pair of Linux kernel drivers for DDC/CI monitors")
+    (description "Two Linux kernel drivers, ddcci and ddcci-backlight, that
+allow the control of DDC/CI monitors through the sysfs interface. ddcci create
+a character device for each DDC/CI monitors in @file{/dev/bus/ddcci/[I²C bus number]}.
+ddcci-backlight allow the control of the backlight level or luminance property when supported
+under @file{/sys/class/backlight/}.")
+    (license license:gpl2+)))
+
 \f
 ;;;
 ;;; Pluggable authentication modules (PAM).
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#37853] [PATCH] gnu: Add ddcci-driver-linux.
  2019-10-21 15:16 [bug#37853] [PATCH] gnu: Add ddcci-driver-linux Brice Waegeneire
@ 2019-10-22  9:42 ` Mathieu Othacehe
  2019-10-22 13:06   ` Danny Milosavljevic
  2019-10-25  9:32 ` [bug#37853] Brice Waegeneire
  2019-10-25 10:24 ` [bug#37853] Brice Waegeneire
  2 siblings, 1 reply; 9+ messages in thread
From: Mathieu Othacehe @ 2019-10-22  9:42 UTC (permalink / raw)
  To: 37853


Hello Brice,

> +             (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")

This line is too long. You can add a line break after "uri" so that it
fits under 78 columns.

> +         (replace 'build
> +           (lambda* (#:key inputs #:allow-other-keys)
> +             (for-each (lambda (module)
> +                         (invoke "make" "-C"
> +                                 (string-append (assoc-ref inputs "linux-module-builder")
> +                                                "/lib/modules/build")
> +                                 (string-append "M=" (getcwd) "/" module)))
> +                       (list "ddcci" "ddcci-backlight"))

It is a bit sad that we have to replicate 'build and 'install phases
because of those two subfolders. However, I can't see an easy way to
overcome this. Anyone?

> +a character device for each DDC/CI monitors in @file{/dev/bus/ddcci/[I²C bus number]}.
> +ddcci-backlight allow the control of the backlight level or luminance property when supported

As reported by guix lint, this line is too long. Also make sure that the
description starts by a full sentence, for instance: "This package
provides a pair of ...".

Can you send an updated patch?

Thanks,

Mathieu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#37853] [PATCH] gnu: Add ddcci-driver-linux.
  2019-10-22  9:42 ` Mathieu Othacehe
@ 2019-10-22 13:06   ` Danny Milosavljevic
  0 siblings, 0 replies; 9+ messages in thread
From: Danny Milosavljevic @ 2019-10-22 13:06 UTC (permalink / raw)
  To: 37853, Brice Waegeneire; +Cc: Mathieu Othacehe

[-- Attachment #1: Type: text/plain, Size: 2371 bytes --]

Hi,

On Tue, 22 Oct 2019 11:42:58 +0200
Mathieu Othacehe <m.othacehe@gmail.com> wrote:

> It is a bit sad that we have to replicate 'build and 'install phases
> because of those two subfolders. However, I can't see an easy way to
> overcome this. Anyone?

You could get the existing phase via (assoc-ref %standard-phases 'build) and call
it twice (and I would).

Also, you could create two packages and chdir in an extra phase before "build"
(I wouldn't do that).

The former:

(define-public ddcci-driver-linux
  (package
    (name "ddcci-driver-linux")
    (version "0.3.3")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32
         "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
    (build-system linux-module-build-system)
    (arguments
     `(#:tests? #f                               ; no tests
       #:phases
       (modify-phases %standard-phases
         (replace 'build
           (lambda args
             (for-each (lambda (module)
                         (with-directory-excursion module
                           (apply (assoc-ref %standard-phases 'build) args)))
                       '("ddcci" "ddcci-backlight"))
             #t))
         (replace 'install
           (lambda args
             (for-each (lambda (module)
                         (with-directory-excursion module
                           (apply (assoc-ref %standard-phases 'install) args)))
                       '("ddcci" "ddcci-backlight"))
             #t)))))
    (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
    (synopsis "Linux kernel drivers for DDC/CI monitors")
    (description "Two Linux kernel drivers, ddcci and ddcci-backlight, that
allow the control of DDC/CI monitors through the sysfs interface. ddcci create
a character device for each DDC/CI monitors in @file{/dev/bus/ddcci/[I²C bus number]}.
ddcci-backlight allow the control of the backlight level or luminance property when supported
under @file{/sys/class/backlight/}.")
    (license license:gpl2+)))

@Brice:

Could you send an updated patch along those lines?

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#37853]
  2019-10-21 15:16 [bug#37853] [PATCH] gnu: Add ddcci-driver-linux Brice Waegeneire
  2019-10-22  9:42 ` Mathieu Othacehe
@ 2019-10-25  9:32 ` Brice Waegeneire
  2019-10-25  9:32   ` [bug#37853] [PATCH v2] gnu: Add ddcci-driver-linux Brice Waegeneire
  2019-10-25 10:24 ` [bug#37853] Brice Waegeneire
  2 siblings, 1 reply; 9+ messages in thread
From: Brice Waegeneire @ 2019-10-25  9:32 UTC (permalink / raw)
  To: 37853


In this patch version I have taken into account the remarks of Mathieu on
line lenght and description phrasing. And followed Danny's take on the
modified phases; it's *much* nicer than my copy/paste from the
linux-module-build-system.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#37853] [PATCH v2] gnu: Add ddcci-driver-linux.
  2019-10-25  9:32 ` [bug#37853] Brice Waegeneire
@ 2019-10-25  9:32   ` Brice Waegeneire
  2019-10-25  9:50     ` Mathieu Othacehe
  0 siblings, 1 reply; 9+ messages in thread
From: Brice Waegeneire @ 2019-10-25  9:32 UTC (permalink / raw)
  To: 37853

* gnu/packages/linux.scm (ddcci-driver-linux): Add variable.
---
 gnu/packages/linux.scm | 46 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 989d55f8aa..ce448d9940 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -968,6 +968,52 @@ and should be used with caution, especially on untested models.")
 between the CDemu userspace daemon and linux kernel.")
     (license license:gpl2+)))
 
+(define-public ddcci-driver-linux
+  (package
+    (name "ddcci-driver-linux")
+    (version "0.3.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
+         (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
+    (build-system linux-module-build-system)
+    (arguments
+     `(#:tests? #f                               ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'build
+           (lambda args
+             (for-each
+              (lambda (module)
+                (with-directory-excursion module
+                  (apply (assoc-ref %standard-phases 'build) args)))
+              '("ddcci" "ddcci-backlight"))
+             #t))
+         (replace 'install
+           (lambda args
+             (for-each
+              (lambda (module)
+                (with-directory-excursion module
+                  (apply (assoc-ref %standard-phases 'install) args)))
+              '("ddcci" "ddcci-backlight"))
+             #t)))))
+    (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
+    (synopsis "A pair of Linux kernel drivers for DDC/CI monitors")
+    (description "This package provide two Linux kernel drivers, ddcci and
+ddcci-backlight, that allow the control of DDC/CI monitors through the sysfs
+interface. The ddcci module create a character device for each DDC/CI monitors
+in @file{/dev/bus/ddcci/[I²C busnumber]}. While the ddcci-backlight module
+allow the control of the backlight level or luminance property when supported
+under @file{/sys/class/backlight/}.")
+    (license license:gpl2+)))
+
 \f
 ;;;
 ;;; Pluggable authentication modules (PAM).
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#37853] [PATCH v2] gnu: Add ddcci-driver-linux.
  2019-10-25  9:32   ` [bug#37853] [PATCH v2] gnu: Add ddcci-driver-linux Brice Waegeneire
@ 2019-10-25  9:50     ` Mathieu Othacehe
  0 siblings, 0 replies; 9+ messages in thread
From: Mathieu Othacehe @ 2019-10-25  9:50 UTC (permalink / raw)
  To: 37853


Hey Brice,

That's indeed much better this way ;) You still have two small guix lint
warnings to fix:

gnu/packages/linux.scm:979:17: ddcci-driver-linux@0.3.3: sentences in description should be followed by two spaces; possible infractions at 143, 253
gnu/packages/linux.scm:978:14: ddcci-driver-linux@0.3.3: no article allowed at the beginning of the synopsis

Otherwise this LGTM.

Mathieu

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#37853]
  2019-10-21 15:16 [bug#37853] [PATCH] gnu: Add ddcci-driver-linux Brice Waegeneire
  2019-10-22  9:42 ` Mathieu Othacehe
  2019-10-25  9:32 ` [bug#37853] Brice Waegeneire
@ 2019-10-25 10:24 ` Brice Waegeneire
  2019-10-25 10:24   ` [bug#37853] [PATCH v3] gnu: Add ddcci-driver-linux Brice Waegeneire
  2019-10-25 11:34   ` [bug#37853] Mathieu Othacehe
  2 siblings, 2 replies; 9+ messages in thread
From: Brice Waegeneire @ 2019-10-25 10:24 UTC (permalink / raw)
  To: 37853


Hopefully this version is the last one needed.

Sorry for the trivial lint issue Mathieu. I have troble running it on my
forgin distro (NixOS), it always complain about certificates and stop
abruptly without reporting relevant information.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#37853] [PATCH v3] gnu: Add ddcci-driver-linux.
  2019-10-25 10:24 ` [bug#37853] Brice Waegeneire
@ 2019-10-25 10:24   ` Brice Waegeneire
  2019-10-25 11:34   ` [bug#37853] Mathieu Othacehe
  1 sibling, 0 replies; 9+ messages in thread
From: Brice Waegeneire @ 2019-10-25 10:24 UTC (permalink / raw)
  To: 37853

* gnu/packages/linux.scm (ddcci-driver-linux): Add variable.
---
 gnu/packages/linux.scm | 46 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 989d55f8aa..d061f866d9 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -968,6 +968,52 @@ and should be used with caution, especially on untested models.")
 between the CDemu userspace daemon and linux kernel.")
     (license license:gpl2+)))
 
+(define-public ddcci-driver-linux
+  (package
+    (name "ddcci-driver-linux")
+    (version "0.3.3")
+    (source
+     (origin
+       (method git-fetch)
+       (uri
+        (git-reference
+         (url "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux.git")
+         (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32
+         "0vkkja3ykjil783zjpwp0vz7jy2fp9ccazzi3afd4fjk8gldin7f"))))
+    (build-system linux-module-build-system)
+    (arguments
+     `(#:tests? #f                               ; no tests
+       #:phases
+       (modify-phases %standard-phases
+         (replace 'build
+           (lambda args
+             (for-each
+              (lambda (module)
+                (with-directory-excursion module
+                  (apply (assoc-ref %standard-phases 'build) args)))
+              '("ddcci" "ddcci-backlight"))
+             #t))
+         (replace 'install
+           (lambda args
+             (for-each
+              (lambda (module)
+                (with-directory-excursion module
+                  (apply (assoc-ref %standard-phases 'install) args)))
+              '("ddcci" "ddcci-backlight"))
+             #t)))))
+    (home-page "https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux")
+    (synopsis "Pair of Linux kernel drivers for DDC/CI monitors")
+    (description "This package provide two Linux kernel drivers, ddcci and
+ddcci-backlight, that allow the control of DDC/CI monitors through the sysfs
+interface.  The ddcci module create a character device for each DDC/CI monitors
+in @file{/dev/bus/ddcci/[I²C busnumber]}.  While the ddcci-backlight module
+allow the control of the backlight level or luminance property when supported
+under @file{/sys/class/backlight/}.")
+    (license license:gpl2+)))
+
 \f
 ;;;
 ;;; Pluggable authentication modules (PAM).
-- 
2.19.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#37853]
  2019-10-25 10:24 ` [bug#37853] Brice Waegeneire
  2019-10-25 10:24   ` [bug#37853] [PATCH v3] gnu: Add ddcci-driver-linux Brice Waegeneire
@ 2019-10-25 11:34   ` Mathieu Othacehe
  1 sibling, 0 replies; 9+ messages in thread
From: Mathieu Othacehe @ 2019-10-25 11:34 UTC (permalink / raw)
  To: 37853; +Cc: 37853-done


> Sorry for the trivial lint issue Mathieu. I have troble running it on my
> forgin distro (NixOS), it always complain about certificates and stop
> abruptly without reporting relevant information.

No problem, I fixed some typos in description and pushed this patch.

Thanks,

Mathieu

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-10-25 11:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-21 15:16 [bug#37853] [PATCH] gnu: Add ddcci-driver-linux Brice Waegeneire
2019-10-22  9:42 ` Mathieu Othacehe
2019-10-22 13:06   ` Danny Milosavljevic
2019-10-25  9:32 ` [bug#37853] Brice Waegeneire
2019-10-25  9:32   ` [bug#37853] [PATCH v2] gnu: Add ddcci-driver-linux Brice Waegeneire
2019-10-25  9:50     ` Mathieu Othacehe
2019-10-25 10:24 ` [bug#37853] Brice Waegeneire
2019-10-25 10:24   ` [bug#37853] [PATCH v3] gnu: Add ddcci-driver-linux Brice Waegeneire
2019-10-25 11:34   ` [bug#37853] Mathieu Othacehe

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).