diff mbox series

[bug#65911,1/4] gnu: Add python-smbus.

Message ID 20230913095559.12676-1-jean@foundationdevices.com
State New
Headers show
Series gnu: Add liquidctl. | expand

Commit Message

Jean-Pierre De Jesus DIAZ Sept. 13, 2023, 9:55 a.m. UTC
* gnu/packages/linux.scm (python-smbus): New variable.

Signed-off-by: Jean-Pierre De Jesus DIAZ <jean@foundationdevices.com>
---
 gnu/packages/linux.scm | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

Comments

Bruno Victal Sept. 13, 2023, 11:01 a.m. UTC | #1
Hi Jean-Pierre,

On 2023-09-13 10:55, Jean-Pierre De Jesus DIAZ via Guix-patches via wrote:
> +               (add-after 'change-directory 'set-library-path
> +                 (lambda _
> +                   (substitute* "setup.py"
> +                     (("-L\\.\\./lib")
> +                      (string-append "-L" #$i2c-tools "/lib"))))))))

Rather than
	#$i2c-tools
do
	#$(this-package-input "i2c-tools"
Jean-Pierre De Jesus DIAZ Sept. 20, 2023, 10:07 a.m. UTC | #2
Hi Bruno,

>Rather than
>        #$i2c-tools
>do
>         #$(this-package-input "i2c-tools"

Sent updated patches fixing this issue.

Thanks for pointing it out.

Cheers,


On Wed, Sep 13, 2023 at 1:01 PM Bruno Victal <mirai@makinata.eu> wrote:
>
> Hi Jean-Pierre,
>
> On 2023-09-13 10:55, Jean-Pierre De Jesus DIAZ via Guix-patches via wrote:
> > +               (add-after 'change-directory 'set-library-path
> > +                 (lambda _
> > +                   (substitute* "setup.py"
> > +                     (("-L\\.\\./lib")
> > +                      (string-append "-L" #$i2c-tools "/lib"))))))))
>
> Rather than
>         #$i2c-tools
> do
>         #$(this-package-input "i2c-tools"
>
> --
> Furthermore, I consider that nonfree software must be eradicated.
>
> Cheers,
> Bruno.
>
diff mbox series

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 36354b4d82..e57ab866c6 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -75,6 +75,7 @@ 
 ;;; Copyright © 2023 Yovan Naumovski <yovan@gorski.stream>
 ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com>
 ;;; Copyright © 2023 dan <i@dan.games>
+;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -188,6 +189,7 @@  (define-module (gnu packages linux)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system go)
   #:use-module (guix build-system meson)
+  #:use-module (guix build-system pyproject)
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system linux-module)
@@ -4921,6 +4923,28 @@  (define-public i2c-tools-3
         #~(list (string-append "prefix=" #$output)
                 (string-append "CC=" #$(cc-for-target))))))))
 
+(define-public python-smbus
+  (package
+    (inherit i2c-tools)
+    (name "python-smbus")
+    (build-system pyproject-build-system)
+    (arguments
+     (list #:tests? #f ;; No test suite.
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'change-directory
+                 (lambda _ (chdir "py-smbus")))
+               (add-after 'change-directory 'set-library-path
+                 (lambda _
+                   (substitute* "setup.py"
+                     (("-L\\.\\./lib")
+                      (string-append "-L" #$i2c-tools "/lib"))))))))
+    (inputs (list i2c-tools))
+    (synopsis "I2C/SMBus access for Python")
+    (description "This package provides a Python library to access
+@acronym{I2C, Inter-Integrated Circuit} and @acronym{SMBus, System
+Management Bus} devices on Linux.")))
+
 (define-public xsensors
   (package
     (name "xsensors")