GNU bug report logs - #63211
[PATCH] gnu: Add usbrelay.

Previous Next

Package: guix-patches;

Reported by: Evgeny Pisemsky <evgeny <at> pisemsky.com>

Date: Mon, 1 May 2023 18:27:02 UTC

Severity: normal

Tags: patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63211 in the body.
You can then email your comments to 63211 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#63211; Package guix-patches. (Mon, 01 May 2023 18:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Evgeny Pisemsky <evgeny <at> pisemsky.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 01 May 2023 18:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Evgeny Pisemsky <evgeny <at> pisemsky.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: Add usbrelay.
Date: Mon, 01 May 2023 21:25:46 +0300
[0001-gnu-Add-usbrelay.patch (text/x-patch, attachment)]
From dacf7010defa351fae323786a5112904215b5478 Mon Sep 17 00:00:00 2001
From: Evgeny Pisemsky <evgeny <at> pisemsky.com>
Date: Mon, 1 May 2023 21:09:42 +0300
Subject: [PATCH] gnu: Add usbrelay.

* gnu/packages/hardware.scm (usbrelay): New variable.
---
 gnu/packages/hardware.scm | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index 5b85ad9b2e..365fb88ae0 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
 ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
-;;; Copyright © 2021 Evgeny Pisemsky <evgeny <at> pisemsky.com>
+;;; Copyright © 2021, 2023 Evgeny Pisemsky <evgeny <at> pisemsky.com>
 ;;; Copyright © 2021 Léo Le Bouter <lle-bout <at> zaclys.net>
 ;;; Copyright © 2021 Denis Carikli <GNUtoo <at> cyberdimension.org>
 ;;; Copyright © 2021, 2022 Petr Hodina <phodina <at> protonmail.com>
@@ -1438,3 +1438,37 @@ (define-public lxi-tools
 on the LXI Consortium standard which defines the communication protocols for
 modern instrumentation and data acquision systems using Ethernet.")
     (license license:bsd-3)))
+
+(define-public usbrelay
+  (package
+    (name "usbrelay")
+    (version "1.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/darrylb123/usbrelay")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0fr3wglr2c6myg4k6ai2p5z38prclcnk2ngik15sq16fnp6qg750"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases (modify-phases %standard-phases
+                  (delete 'configure))
+       #:make-flags (let* ((out (assoc-ref %outputs "out"))
+                           (lib (string-append out "/lib")))
+                      (list (string-append "CC=" ,(cc-for-target))
+                            (string-append "PREFIX=" out)
+                            (string-append "LDFLAGS=-Wl,-rpath=" lib)
+                            "LDCONFIG=true"
+                            "USBMAJOR=$(USBLIBVER)"))
+       #:tests? #f))
+    (inputs (list hidapi))
+    (home-page "https://github.com/darrylb123/usbrelay")
+    (synopsis "Control USB relay modules")
+    (description
+     "This is a Linux driver based on hidapi for a variety of inexpensive
+HID compatible USB relay modules available with different number of
+output relays.")
+    (license license:gpl2+)))

base-commit: 23552fb2fbcb78757e8b563de9466831f6386105
-- 
2.39.2





Information forwarded to guix-patches <at> gnu.org:
bug#63211; Package guix-patches. (Thu, 01 Jun 2023 09:01:02 GMT) Full text and rfc822 format available.

Message #8 received at 63211 <at> debbugs.gnu.org (full text, mbox):

From: Evgeny Pisemsky <evgeny <at> pisemsky.com>
To: 63211 <at> debbugs.gnu.org
Subject: Reminder
Date: Thu, 01 Jun 2023 12:00:46 +0300
Month passed... Any problems?

The string "USBMAJOR=$(USBLIBVER)" may be questionable - if these
values don't match, the build fails because the library that the
binary references to and the actual library named differently. Not
sure why, probably it is an error in Makefile - this versioning was
introduced relatively recently.

Anyway, with this hack the package builds successfully, and I actually
tested it with a real usb relay module (with 2 relays), and it worked.




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Fri, 01 Sep 2023 14:11:02 GMT) Full text and rfc822 format available.

Notification sent to Evgeny Pisemsky <evgeny <at> pisemsky.com>:
bug acknowledged by developer. (Fri, 01 Sep 2023 14:11:02 GMT) Full text and rfc822 format available.

Message #13 received at 63211-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Evgeny Pisemsky <evgeny <at> pisemsky.com>
Cc: 63211-done <at> debbugs.gnu.org
Subject: Re: bug#63211: [PATCH] gnu: Add usbrelay.
Date: Fri, 01 Sep 2023 10:10:07 -0400
Hi!

Evgeny Pisemsky <evgeny <at> pisemsky.com> writes:

>>From dacf7010defa351fae323786a5112904215b5478 Mon Sep 17 00:00:00 2001
> From: Evgeny Pisemsky <evgeny <at> pisemsky.com>
> Date: Mon, 1 May 2023 21:09:42 +0300
> Subject: [PATCH] gnu: Add usbrelay.
>
> * gnu/packages/hardware.scm (usbrelay): New variable.
> ---
>  gnu/packages/hardware.scm | 36 +++++++++++++++++++++++++++++++++++-
>  1 file changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
> index 5b85ad9b2e..365fb88ae0 100644
> --- a/gnu/packages/hardware.scm
> +++ b/gnu/packages/hardware.scm
> @@ -2,7 +2,7 @@
>  ;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me <at> tobias.gr>
>  ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke <at> gnu.org>
>  ;;; Copyright © 2020 Brice Waegeneire <brice <at> waegenei.re>
> -;;; Copyright © 2021 Evgeny Pisemsky <evgeny <at> pisemsky.com>
> +;;; Copyright © 2021, 2023 Evgeny Pisemsky <evgeny <at> pisemsky.com>
>  ;;; Copyright © 2021 Léo Le Bouter <lle-bout <at> zaclys.net>
>  ;;; Copyright © 2021 Denis Carikli <GNUtoo <at> cyberdimension.org>
>  ;;; Copyright © 2021, 2022 Petr Hodina <phodina <at> protonmail.com>
> @@ -1438,3 +1438,37 @@ (define-public lxi-tools
>  on the LXI Consortium standard which defines the communication protocols for
>  modern instrumentation and data acquision systems using Ethernet.")
>      (license license:bsd-3)))
> +
> +(define-public usbrelay
> +  (package
> +    (name "usbrelay")
> +    (version "1.2")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/darrylb123/usbrelay")
> +                    (commit version)))
> +              (file-name (git-file-name name version))
> +              (sha256
> +               (base32
> +                "0fr3wglr2c6myg4k6ai2p5z38prclcnk2ngik15sq16fnp6qg750"))))
> +    (build-system gnu-build-system)
> +    (arguments
> +     `(#:phases (modify-phases %standard-phases
> +                  (delete 'configure))
> +       #:make-flags (let* ((out (assoc-ref %outputs "out"))
> +                           (lib (string-append out "/lib")))
> +                      (list (string-append "CC=" ,(cc-for-target))
> +                            (string-append "PREFIX=" out)
> +                            (string-append "LDFLAGS=-Wl,-rpath=" lib)
> +                            "LDCONFIG=true"
> +                            "USBMAJOR=$(USBLIBVER)"))
> +       #:tests? #f))
> +    (inputs (list hidapi))
> +    (home-page "https://github.com/darrylb123/usbrelay")
> +    (synopsis "Control USB relay modules")
> +    (description
> +     "This is a Linux driver based on hidapi for a variety of inexpensive
> +HID compatible USB relay modules available with different number of
> +output relays.")
> +    (license license:gpl2+)))

I've made the following changes, to use the more modern gexp approach,
and added comments next to the configure phase deletion and disabling of
tests:

--8<---------------cut here---------------start------------->8---
modified   gnu/packages/hardware.scm
@@ -1475,16 +1475,16 @@ (define-public usbrelay
                 "0fr3wglr2c6myg4k6ai2p5z38prclcnk2ngik15sq16fnp6qg750"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:phases (modify-phases %standard-phases
-                  (delete 'configure))
-       #:make-flags (let* ((out (assoc-ref %outputs "out"))
-                           (lib (string-append out "/lib")))
-                      (list (string-append "CC=" ,(cc-for-target))
-                            (string-append "PREFIX=" out)
-                            (string-append "LDFLAGS=-Wl,-rpath=" lib)
-                            "LDCONFIG=true"
-                            "USBMAJOR=$(USBLIBVER)"))
-       #:tests? #f))
+     (list
+      #:phases #~(modify-phases %standard-phases
+                   (delete 'configure)) ;no configure script
+      #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+                           (string-append "PREFIX=" #$output)
+                           (string-append "LDFLAGS=-Wl,-rpath="
+                                          (string-append #$output "/lib"))
+                           "LDCONFIG=true"
+                           "USBMAJOR=$(USBLIBVER)")
+      #:tests? #f))                     ;no test suite
     (inputs (list hidapi))
     (home-page "https://github.com/darrylb123/usbrelay")
     (synopsis "Control USB relay modules")
--8<---------------cut here---------------end--------------->8---

Will install shortly, thank you.

-- 
Thanks,
Maxim




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 30 Sep 2023 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 208 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.