all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#72635] [PATCH] gnu: Add python-usbrelay.
@ 2024-08-15  7:15 Evgeny Pisemsky
  2024-10-02 13:55 ` Evgeny Pisemsky
  0 siblings, 1 reply; 2+ messages in thread
From: Evgeny Pisemsky @ 2024-08-15  7:15 UTC (permalink / raw)
  To: 72635

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-python-usbrelay.patch --]
[-- Type: text/x-patch, Size: 2597 bytes --]

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(+)

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





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

* [bug#72635] [PATCH] gnu: Add python-usbrelay.
  2024-08-15  7:15 [bug#72635] [PATCH] gnu: Add python-usbrelay Evgeny Pisemsky
@ 2024-10-02 13:55 ` Evgeny Pisemsky
  0 siblings, 0 replies; 2+ messages in thread
From: Evgeny Pisemsky @ 2024-10-02 13:55 UTC (permalink / raw)
  To: 72635

Any problems with this patch?

Packaged using python-capstone and capstone as example.

Substitutions set actual version since upstream does not care.




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

end of thread, other threads:[~2024-10-02 13:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15  7:15 [bug#72635] [PATCH] gnu: Add python-usbrelay Evgeny Pisemsky
2024-10-02 13:55 ` Evgeny Pisemsky

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.