[PATCH] gnu: Add python-gatt.

  • Done
  • quality assurance status badge
Details
4 participants
  • Jack Hill
  • Wamm K. D
  • Ludovic Courtès
  • Tobias Geerinckx-Rice
Owner
unassigned
Submitted by
Wamm K. D
Severity
normal
W
W
Wamm K. D wrote on 19 May 2022 07:24
(address . guix-patches@gnu.org)(name . Wamm K. D)(address . jaft.r@outlook.com)
BY5PR07MB7029CFFA8132BD551FF0CD0799D09@BY5PR07MB7029.namprd07.prod.outlook.com
---
This isn't the end-goal package to add but a dependency.

'Trying to add Siglo so sending this one, first; Siglo will follow.

gnu/packages/python-xyz.scm | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)

Toggle diff (39 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5094ef068c..ee7850b518 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31177,3 +31177,32 @@ (define-public python-deepmerge
"The @code{deep-merge} Python library provides a toolset to deeply merge
nested data structures in Python like lists and dictionaries.")
(license license:expat)))
+
+(define python-gatt
+ (package
+ (name "python-gatt")
+ (version "0.2.7")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "gatt" version))
+ (sha256 (base32
+ "0fjf066jixk30fr8xwfalwfnhqpr56yv0cccyypnx2qp9bi9svb2"))))
+ (inputs (list python-dbus python-pygobject))
+ (build-system python-build-system)
+ (home-page "https://github.com/getsenic/gatt-python")
+ (synopsis "Bluetooth GATT SDK for Python")
+ (description "The Bluetooth GATT SDK for Python helps you implementing and
+communicating with any Bluetooth Low Energy device that has a GATT profile. It
+supports:
+@itemize @bullet
+@item Discovering nearby Bluetooth Low Energy devices
+@item Connecting and disconnecting devices
+@item Implementing your custom GATT profile
+@item Accessing all GATT services
+@item Accessing all GATT characteristics
+@item Reading characteristic values
+@item Writing characteristic values
+@item Subscribing for characteristic value change notifications
+@end itemize
+Currently Linux is the only platform supported by this library.")
+ (license license:expat)))
--
2.36.0
J
J
Jack Hill wrote on 19 May 2022 07:46
(name . Wamm K. D)(address . jaft.r@outlook.com)(address . 55518@debbugs.gnu.org)
alpine.DEB.2.21.2205190143440.11587@marsh.hcoop.net
On Thu, 19 May 2022, Wamm K. D wrote:

Toggle quote (46 lines)
> ---
> This isn't the end-goal package to add but a dependency.
>
> 'Trying to add Siglo so sending this one, first; Siglo will follow.
>
> gnu/packages/python-xyz.scm | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
> index 5094ef068c..ee7850b518 100644
> --- a/gnu/packages/python-xyz.scm
> +++ b/gnu/packages/python-xyz.scm
> @@ -31177,3 +31177,32 @@ (define-public python-deepmerge
> "The @code{deep-merge} Python library provides a toolset to deeply merge
> nested data structures in Python like lists and dictionaries.")
> (license license:expat)))
> +
> +(define python-gatt
> + (package
> + (name "python-gatt")
> + (version "0.2.7")
> + (source (origin
> + (method url-fetch)
> + (uri (pypi-uri "gatt" version))
> + (sha256 (base32
> + "0fjf066jixk30fr8xwfalwfnhqpr56yv0cccyypnx2qp9bi9svb2"))))
> + (inputs (list python-dbus python-pygobject))
> + (build-system python-build-system)
> + (home-page "https://github.com/getsenic/gatt-python")
> + (synopsis "Bluetooth GATT SDK for Python")
> + (description "The Bluetooth GATT SDK for Python helps you implementing and
> +communicating with any Bluetooth Low Energy device that has a GATT profile. It
> +supports:
> +@itemize @bullet
> +@item Discovering nearby Bluetooth Low Energy devices
> +@item Connecting and disconnecting devices
> +@item Implementing your custom GATT profile
> +@item Accessing all GATT services
> +@item Accessing all GATT characteristics
> +@item Reading characteristic values
> +@item Writing characteristic values
> +@item Subscribing for characteristic value change notifications
> +@end itemize
> +Currently Linux is the only platform supported by this library.")
> + (license license:expat)))

Cool! I haven't reviewed the package, but it looks straight forward, which
is promising. However reading this description made me realize that I
don't know what GATT means. Would it make sense to define it in the
description (perhaps using texinfo's @acronym syntax)?

Best,
Jack
W
W
Wamm K. D wrote on 19 May 2022 07:54
[PATCH] gnu: Add siglo.
(address . 55518@debbugs.gnu.org)
BY5PR07MB70299AB1652D4282FF6A335C99D09@BY5PR07MB7029.namprd07.prod.outlook.com
---
Hmmm; heh, you know, I don't either. I think it makes sense; I'll look it up
and try adding it. I may come back with questions about the @acronym syntax,
just as a heads up.

gnu/packages/firmware.scm | 75 +++++++++++++++++++++++++++++++++++++++
1 file changed, 75 insertions(+)

Toggle diff (106 lines)
diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index b63ad63749..1b81110c91 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -8,6 +8,7 @@
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2020, 2021, 2022 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2022 Wamm K. D. <jaft.r@outlook.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -42,13 +43,19 @@ (define-module (gnu packages firmware)
#:use-module (gnu packages curl)
#:use-module (gnu packages cross-base)
#:use-module (gnu packages flex)
+ #:use-module (gnu packages freedesktop)
#:use-module (gnu packages gcc)
+ #:use-module (gnu packages gettext)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
+ #:use-module (gnu packages gtk)
#:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
#:use-module (gnu packages perl)
#:use-module (gnu packages python)
+ #:use-module (gnu packages python-crypto)
+ #:use-module (gnu packages python-web)
+ #:use-module (gnu packages python-xyz)
#:use-module (gnu packages pkg-config))
(define-public ath9k-htc-firmware
@@ -634,3 +641,71 @@ (define-public arm-trusted-firmware-imx8mq
((#:make-flags flags ''())
;; Adding debug symbols causes the size to exceed limits.
#~(delete "DEBUG=1" #$flags)))))))
+
+(define-public siglo
+ (package
+ (name "siglo")
+ (version "0.9.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url (string-append "https://github.com/alexr4535/" name "/"))
+ (commit (string-append "v" version))))
+ (sha256 (base32
+ "1q241465l0kjirycvhgrm5ylqll6ywqfyg2arad224v47fz7lb8g"))))
+ (build-system meson-build-system)
+ (native-inputs (list gettext-minimal
+ `(,glib "bin") ; for 'glib-compile-resources',
+ ; 'glib-compile-schemas'
+ pkg-config
+ `(,gtk+ "bin") ; for gtk-update-icon-cache
+ ))
+ (inputs (list gtk+
+ desktop-file-utils
+ appstream-glib ; listed as appstream-util, in configure
+ python
+ python-pyxdg
+ python-gatt
+ python-dbus
+ python-pygobject
+ python-requests
+ python-urllib3
+ python-chardet
+ python-certifi
+ python-idna))
+ (arguments `(#:glib-or-gtk? #t
+ #:phases (modify-phases %standard-phases
+ (add-before 'configure 'remove-internet-using-test
+ (lambda _
+ (substitute* "data/meson.build"
+ (("appstream_util.found\\(\\)") "false")
+ (((string-append
+ "install_data[(]'siglo\\.service', "
+ "install_dir: '/etc/systemd/user/'[)]"))
+ ""))))
+ (add-after 'glib-or-gtk-wrap 'python-and-gi-wrap
+ (lambda* (#:key outputs inputs #:allow-other-keys)
+ (wrap-program (string-append
+ (assoc-ref outputs "out")
+ "/bin/siglo")
+ `("GUIX_PYTHONPATH" =
+ ,(map
+ (lambda (python-input)
+ (string-append (cdr python-input)
+ "/lib/python"
+ ,(version-major+minor
+ (package-version python))
+ "/site-packages"))
+ (filter
+ (lambda (input)
+ (string-prefix? "python" (car input)))
+ inputs)))
+ `("GI_TYPELIB_PATH" =
+ (,(getenv "GI_TYPELIB_PATH")))))))))
+ (synopsis "GTK app to sync InfiniTime watch with PinePhone")
+ (description "Siglo is a GTK app. to sync with the InfiniTime watch via
+Bluetooth. With a connection via Siglo, you can check the firmware version of
+your PineTime and sync the date/time. You can, also, update the firmware and
+bootloader of the watch.")
+ (home-page "https://github.com/alexr4535/siglo")
+ (license license:mpl2.0)))
--
2.36.0
W
W
Wamm K. D wrote on 19 May 2022 08:05
[PATCH] gnu: Add python-gatt.
(address . 55518@debbugs.gnu.org)
BY5PR07MB7029E8FB64909DB8D7A9BC3199D09@BY5PR07MB7029.namprd07.prod.outlook.com
---
Here we go; would this work? Do I need to include what the acronym means in
every instance of @acronym or does doing so for just the first instance work?

gnu/packages/python-xyz.scm | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)

Toggle diff (40 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5094ef068c..dcf1bfa9d3 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31177,3 +31177,33 @@ (define-public python-deepmerge
"The @code{deep-merge} Python library provides a toolset to deeply merge
nested data structures in Python like lists and dictionaries.")
(license license:expat)))
+
+(define python-gatt
+ (package
+ (name "python-gatt")
+ (version "0.2.7")
+ (source (origin
+ (method url-fetch)
+ (uri (pypi-uri "gatt" version))
+ (sha256 (base32
+ "0fjf066jixk30fr8xwfalwfnhqpr56yv0cccyypnx2qp9bi9svb2"))))
+ (inputs (list python-dbus python-pygobject))
+ (build-system python-build-system)
+ (home-page "https://github.com/getsenic/gatt-python")
+ (synopsis "Bluetooth GATT SDK for Python")
+ (description "The Bluetooth @acronym{GATT, Generic ATTribute Profile}
+@acronym{SDK, Software Development Kit} for Python helps you implementing and
+communicating with any Bluetooth Low Energy device that has a @acronym{GATT}
+profile. It supports:
+@itemize @bullet
+@item Discovering nearby Bluetooth Low Energy devices
+@item Connecting and disconnecting devices
+@item Implementing your custom @acronym{GATT} profile
+@item Accessing all @acronym{GATT} services
+@item Accessing all @acronym{GATT} characteristics
+@item Reading characteristic values
+@item Writing characteristic values
+@item Subscribing for characteristic value change notifications
+@end itemize
+Currently, Linux is the only platform supported by this library.")
+ (license license:expat)))
--
2.36.0
T
T
Tobias Geerinckx-Rice wrote on 19 May 2022 15:24
(address . jackhill@jackhill.us)
ACA2C1F1-6AE7-429D-A9C7-CC3EEC116D19@tobias.gr
On 19 May 2022 06:05:22 UTC, "Wamm K. D" <jaft.r@outlook.com> wrote:
Toggle quote (4 lines)
>---
>Do I need to include what the acronym means in
>every instance of @acronym or does doing so for just the first instance work?

Just the first occurence in each description. At least how Guix renders Texinfo (simple & stupid), it would repeat the meaning in brackets every single time. Not what you want.



Kind regards,

T G-R

Sent on the go. Excuse or enjoy my brevity.
J
(name . jackhill@jackhill.us)(address . jackhill@jackhill.us)
BY5PR07MB7029FB41FD0BEBFC70C7181A99D59@BY5PR07MB7029.namprd07.prod.outlook.com
Toggle quote (15 lines)
> On Thursday, May 19, 2022, 08:24:43 AM CDT, Tobias Geerinckx-Rice <me@tobias.gr> wrote:
>
>
>
>
>
> On 19 May 2022 06:05:22 UTC, "Wamm K. D" <jaft.r@outlook.com> wrote:
>
> >---
> >Do I need to include what the acronym means in
> >every instance of @acronym or does doing so for just the first instance work?
>
>
> Just the first occurence in each description.  At least how Guix renders Texinfo (simple & stupid), it would repeat the meaning in brackets every single time.  Not what you want.

Gotcha; that's what I was figuring but wanted to double check. Thanks a ton for confirming!

Then I think the necessary changes have been made, Jack; lemme know if there's any other adjustments I ought to make.
L
L
Ludovic Courtès wrote on 28 May 2022 00:02
Re: bug#55518: [PATCH] gnu: Add python-gatt.
(name . Wamm K. D)(address . jaft.r@outlook.com)
87wne6bpms.fsf_-_@gnu.org
Hi,

I added a commit log and applied with the changes below, as suggested by
Tobias (for the description).

The inputs are propagated because, for instance, the code reads:

Toggle snippet (11 lines)
try:
import dbus
import dbus.mainloop.glib
except ImportError:
import sys
print("Module 'dbus' not found")
print("Please run: sudo apt-get install python3-dbus")
print("See also: https://github.com/getsenic/gatt-python#installing-gatt-sdk-for-python")
sys.exit(1)

Thus, if you install python-gatt in a profile, python-dbus should be
propagated as well so it “just works”.

Thanks,
Ludo’.
Toggle diff (49 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d706906a9d..fe1896efca 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -31806,32 +31806,35 @@ (define-public python-srt
composing subtitles in the SRT file format.")
(license license:expat)))
-(define python-gatt
+(define-public python-gatt
(package
(name "python-gatt")
(version "0.2.7")
(source (origin
(method url-fetch)
(uri (pypi-uri "gatt" version))
- (sha256 (base32
- "0fjf066jixk30fr8xwfalwfnhqpr56yv0cccyypnx2qp9bi9svb2"))))
- (inputs (list python-dbus python-pygobject))
+ (sha256
+ (base32
+ "0fjf066jixk30fr8xwfalwfnhqpr56yv0cccyypnx2qp9bi9svb2"))))
+ (propagated-inputs (list python-dbus python-pygobject))
(build-system python-build-system)
(home-page "https://github.com/getsenic/gatt-python")
(synopsis "Bluetooth GATT SDK for Python")
(description "The Bluetooth @acronym{GATT, Generic ATTribute Profile}
-@acronym{SDK, Software Development Kit} for Python helps you implementing and
-communicating with any Bluetooth Low Energy device that has a @acronym{GATT}
+@acronym{SDK, Software Development Kit} for Python helps you implement and
+communicate with any Bluetooth Low Energy device that has a GATT
profile. It supports:
+
@itemize @bullet
@item Discovering nearby Bluetooth Low Energy devices
@item Connecting and disconnecting devices
-@item Implementing your custom @acronym{GATT} profile
-@item Accessing all @acronym{GATT} services
-@item Accessing all @acronym{GATT} characteristics
+@item Implementing your custom GATT profile
+@item Accessing all GATT services
+@item Accessing all GATT characteristics
@item Reading characteristic values
@item Writing characteristic values
@item Subscribing for characteristic value change notifications
@end itemize
+
Currently, Linux is the only platform supported by this library.")
(license license:expat)))
Closed
W
W
Wamm K. D. wrote on 30 May 2022 04:52
(name . Ludovic Courtès)(address . ludo@gnu.org)
BY5PR07MB70298ABC211ACCCA0D2EFB9699DD9@BY5PR07MB7029.namprd07.prod.outlook.com
On Fri. (May 27, 2022) at 06:02:45 PM -04, Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (5 lines)
> Hi,
>
> I added a commit log and applied with the changes below, as suggested by
> Tobias (for the description).

…ah; heh, that was definitely not how I'd read his suggestion. I thought
~@acronym~ was used in every case, with the full acronym spelled out
only in first case, so thought I'd gotten it right in my last
patch. Sorry about that.

Toggle quote (15 lines)
> The inputs are propagated because, for instance, the code reads:
>
> try:
> import dbus
> import dbus.mainloop.glib
> except ImportError:
> import sys
> print("Module 'dbus' not found")
> print("Please run: sudo apt-get install python3-dbus")
> print("See also: https://github.com/getsenic/gatt-python#installing-gatt-sdk-for-python")
> sys.exit(1)
>
> Thus, if you install python-gatt in a profile, python-dbus should be
> propagated as well so it “just works”.

Mmm; O. K. That makes sense. Thanks a ton for explaining, Ludo; it's
super appreciated.
Closed
?