all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Evgeny Pisemsky <mail@pisemsky.site>
To: 72635@debbugs.gnu.org
Subject: [bug#72635] [PATCH] gnu: Add python-usbrelay.
Date: Thu, 15 Aug 2024 10:15:38 +0300	[thread overview]
Message-ID: <87sev6i7dx.fsf@pisemsky.site> (raw)

[-- 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





             reply	other threads:[~2024-08-15  7:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15  7:15 Evgeny Pisemsky [this message]
2024-10-02 13:55 ` [bug#72635] [PATCH] gnu: Add python-usbrelay Evgeny Pisemsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sev6i7dx.fsf@pisemsky.site \
    --to=mail@pisemsky.site \
    --cc=72635@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.