[PATCH] gnu: Add python-usbrelay.

  • Open
  • quality assurance status badge
Details
One participant
  • Evgeny Pisemsky
Owner
unassigned
Submitted by
Evgeny Pisemsky
Severity
normal
E
E
Evgeny Pisemsky wrote on 15 Aug 2024 09:15
(address . guix-patches@gnu.org)
87sev6i7dx.fsf@pisemsky.site
From 7848f0db92bee6fa523661d4599a294df1668b0c Mon Sep 17 00:00:00 2001
Message-ID: <7848f0db92bee6fa523661d4599a294df1668b0c.1723705343.git.mail@pisemsky.site>
From: Evgeny Pisemsky <mail@pisemsky.site>
Date: Thu, 15 Aug 2024 10:00:00 +0300
Subject: [PATCH] gnu: Add python-usbrelay.

* gnu/packages/hardware.scm (python-usbrelay): New variable.

Change-Id: Icc389604a9bbc8f91fd7b00c1f5cebe3faac3e09
---
gnu/packages/hardware.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index d8530f8705..5c82f02255 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -70,6 +70,7 @@ (define-module (gnu packages hardware)
#:use-module (gnu packages linux)
#:use-module (gnu packages lua)
#:use-module (gnu packages lxqt)
+ #:use-module (gnu packages messaging)
#:use-module (gnu packages mtools)
#:use-module (gnu packages package-management)
#:use-module (gnu packages ncurses)
@@ -1622,3 +1623,32 @@ (define-public usbrelay
HID compatible USB relay modules available with different number of
output relays.")
(license license:gpl2+)))
+
+(define-public python-usbrelay
+ (package
+ (inherit usbrelay)
+ (name "python-usbrelay")
+ (build-system python-build-system)
+ (inputs (list usbrelay))
+ (propagated-inputs (list python-paho-mqtt))
+ (arguments
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'unpack 'install-daemon
+ (lambda _
+ (install-file "usbrelayd.8"
+ (string-append #$output "/share/man/man8"))
+ (install-file "usbrelayd"
+ (string-append #$output "/sbin"))
+ (chmod (string-append #$output "/sbin/usbrelayd") #o555)))
+ (add-after 'install-daemon 'chdir-and-set-version
+ (lambda _
+ (chdir "usbrelay_py")
+ (substitute* "setup.py"
+ ((" version = .*")
+ (string-append " version = '"
+ #$(package-version usbrelay) "',\n")))
+ (substitute* "src/__init__.py"
+ (("__version__ = .*")
+ (string-append "__version__ = \""
+ #$(package-version usbrelay) "\"\n"))))))))))

base-commit: 936928fe38946a7496273e636ca8888914d100a9
--
2.45.2
E
E
Evgeny Pisemsky wrote on 2 Oct 2024 15:55
(address . 72635@debbugs.gnu.org)
878qv6fw2c.fsf@pisemsky.site
Any problems with this patch?

Packaged using python-capstone and capstone as example.

Substitutions set actual version since upstream does not care.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 72635@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 72635
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch