diff mbox series

[bug#56960] * gnu: Add siglo.

Message ID BY5PR07MB70295CC0C994E9AF0BCC5300999C9@BY5PR07MB7029.namprd07.prod.outlook.com
State New
Headers show
Series [bug#56960] * gnu: Add siglo. | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git-branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

Wamm K. D Aug. 3, 2022, 8:23 p.m. UTC
* gnu/packages/flashing-tools.scm (siglo): Add package.
---
 gnu/packages/flashing-tools.scm | 78 +++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)

Comments

Jean Pierre De Jesus DIAZ Aug. 11, 2022, 11:56 a.m. UTC | #1
Hello,

Just a quick review.

>+                    (url (string-append "https://github.com/alexr4535/" name "/"))

`name' is discouraged from being used on the source URL.

If the package name changes, the URL does too. Can't recall where I saw it if
on the documentation or IRC.

>+    (arguments
>+     `(#:glib-or-gtk? #t
>+       #:phases
>+       (modify-phases %standard-phases

You'll probably want to use a list (argument (list ...)) instead of
quasi-quoting, and also, use G-Expressions, see (guix)G-Expressions:

https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html

As the method used for the package is being phased out.

For example:

(arguments
 (list #:glib-or-gtk? #t
       #:phases
       #~(modify-phases %standard-phases
            ...)))

>+             (wrap-program (string-append (assoc-ref outputs "out")
>+                                          "/bin/siglo")

After using G-Expressions, this can be simplified to:

(wrap-program (string-append #$output "/bin/siglo")
  ...)

>+  (synopsis "GTK app to sync InfiniTime watch with PinePhone")

GTK is an implementation detail, no need to be specified, and if necessary,
better suited for the description.

See (guix)Synopses and Descriptions:

https://guix.gnu.org/manual/en/html_node/Synopses-and-Descriptions.html

For example, variations could include:

* "Application to synchronize InfiniTime with PinePhone"
* "Synchronize InifniTime with PinePhone"
* "Smartwatch synchronization application"
* etc.

Keep in mind that synopsis != description. Probably someone with more experience
than me could correct me on this topic.

>+  (description "@code{siglo} is a graphical tool to flash InfiniTime firmware to
>+watches running the InfiniTime operating system, via bluetooth.

flash -> update (non-technical term).
watches -> PineTime watches (or PineTime smartwatches).
bluetooth > Bluetooth.

>+Users can also sync the time of their watch to the time of the device running
>+@code{siglo} as well as check the battery charge of their watch or what version
>+of firmware their watch is running.

sync -> synchronize.

Maybe @itemize or @enumerate could be used to list the features provided, like so:

Siglo (or @code{siglo}) provides the following features:

@itemize
@item Retrieve the version of the InfiniTime firmware running.
@item Check the battery charge.
@item Synchronize the time.
@end itemize

>--- a/gnu/packages/flashing-tools.scm
>+++ b/gnu/packages/flashing-tools.scm

Not entirely sure if this belongs in this category. Or if there's another applicable.

—
Jean-Pierre De Jesus DIAZ
Maxime Devos Aug. 11, 2022, 7 p.m. UTC | #2
On 03-08-2022 22:23, Wamm K. D wrote:

See response by other reviewer (though I'm not sure about the 'name' 
thing, if we change the package name it's easy to adjust the url field 
too), and ...

> +    (propagated-inputs (list gtk+))

... why is it propagated?

> +               `("GI_TYPELIB_PATH" = (,(getenv "GI_TYPELIB_PATH")))))))))

Using getenv in this way is incorrect when cross-compiling because it 
will look in native-inputs instead of inputs, but correcting that can 
wait until gtk+ is actually cross-compilable (and then we could write a 
convenient procedure for that).

For GUIX_PYTHONPATH, search-path-as-list can be useful (and slightly 
less fragile, as it does not depend on labels).

Greetings,
Maxime.
diff mbox series

Patch

diff --git a/gnu/packages/flashing-tools.scm b/gnu/packages/flashing-tools.scm
index 08300cb860..4de3bee294 100644
--- a/gnu/packages/flashing-tools.scm
+++ b/gnu/packages/flashing-tools.scm
@@ -35,6 +35,7 @@  (define-module (gnu packages flashing-tools)
   #:use-module (gnu packages)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system meson)
   #:use-module (guix build-system python)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages admin)
@@ -44,11 +45,19 @@  (define-module (gnu packages flashing-tools)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages elf)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages freedesktop)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages glib)
   #:use-module (gnu packages gnupg)
   #:use-module (gnu packages groff)
+  #:use-module (gnu packages gtk)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages pkg-config)
+  #: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 libusb)
   #:use-module (gnu packages libftdi)
   #:use-module (gnu packages pciutils)
@@ -559,3 +568,72 @@  (define-public uuu
     (description "@code{uuu} is a command line tool, evolved out of MFGTools.
 It can be used to upload images to I.MX SoC's using at least their boot ROM.")
     (license license:bsd-3)))
+
+(define-public siglo
+  (package
+    (name "siglo")
+    (version "0.9.9")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url (string-append "https://github.com/alexr4535/" name "/"))
+                    (commit (string-append "v" version))))
+              (sha256 (base32
+                       "0c08xvr6w77dm5mgzlh6imqdi13bshnp9rxmskvp3j7fki3aqcp2"))))
+    (build-system meson-build-system)
+    (native-inputs (list gettext-minimal
+                         ;; for 'glib-compile-resources', 'glib-compile-schemas'
+                         `(,glib "bin")
+                         pkg-config
+                         ;; for gtk-update-icon-cache
+                         `(,gtk+ "bin")))
+    (inputs (list desktop-file-utils
+                  appstream-glib
+                  python
+                  python-pyxdg
+                  python-gatt
+                  python-dbus
+                  python-pygobject
+                  python-requests
+                  python-urllib3
+                  python-chardet
+                  python-certifi
+                  python-idna))
+    (propagated-inputs (list gtk+))
+    (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 "@code{siglo} is a graphical tool to flash InfiniTime firmware to
+watches running the InfiniTime operating system, via bluetooth.
+
+Users can also sync the time of their watch to the time of the device running
+@code{siglo} as well as check the battery charge of their watch or what version
+of firmware their watch is running.")
+  (home-page "https://github.com/theironrobin/siglo")
+  (license license:mpl2.0)))