Subject: [bug#50663] Add Mycroft - Voice Assistant

From: Efraim Flashner <[email-masked]>
Date: Tue, 25 Jan 2022 12:49:33 +0200

On Mon, Jan 24, 2022 at 11:45:13PM +0100, Nicolas Goaziou wrote:
> Hello,
> 
> phodina via Guix-patches via <[email-masked]> writes:
> 
> > The aim of this patch set is to bring in the MyCroft - private and
> > open Voice Assistant.
> 
> Thank you.
> 
> I fixed some descriptions, removed labels from inputs, fixed compilation
> with GCC 10 (for Mimic). Then I tried to apply the patch set. Alas
> Mycroft core fails to build. You may want to have a look at it.
> 
> I'm sending back the updated patches to you, if that helps.
> 
> Regards,
> -- 
> Nicolas Goaziou

I made some changes to python-mycroft-core but I couldn't get it to pass
the sanity-check or the test suite. I've attached my changes. Also make
sure you sort the inputs alphabetically, I found at least a duplicate
python-pyxdg. Also some of the patches include a line or two of
unrelated indentation changes in other packages.

-- 
Efraim Flashner   <[email-masked]>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 1834152c3c..b9c4529cd5 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -21986,63 +21986,61 @@ (define-public python-mycroft-core
          "02r0vxw0hsihnvviwn4fyspwky3kwq42f9z455q1s70k0snzhb28"))))
     (build-system python-build-system)
     (arguments
-     `(#:phases
+     `(#:tests? #f      ; TODO
+       #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-requirements
            (lambda* (#:key inputs #:allow-other-keys)
-             ;; Use newer version of pkg
+             ;; Use newer version of packages.
+             (setenv "MYCROFT_LOOSE_REQUIREMENTS" "1")
              (substitute* "requirements/requirements.txt"
-               (("mycroft-messagebus-client==") "mycroft-messagebus-client>=")
-               (("tornado==") "tornado>=")
-               (("pyserial==") "pyserial>=")
-               (("psutil==") "psutil>=")
-               (("padaos==") "padaos>=")
-               (("precise-runner==") "precise-runner>=")
-               (("pocketsphinx==") "pocketsphinx>=")
-               (("python-dateutil==") "python-dateutil>=")
-               (("fasteners==") "fasteners>=")
-               (("requests-futures==") "requests-futures>=")
-               (("pillow==") "pillow>=")
-               (("PyYAML==5.4") "PyYAML>=5.3.1")
-               (("pyxdg==") "pyxdg>=")
                (("requests>=2.20.0,<2.26.0") "requests>=2.20.0"))))
+         (replace 'sanity-check
+           (lambda args
+             ;(setenv "PYTHONPATH"
+             ;        (string-append "./build/lib:"
+             ;                       (or (getenv "PYTHONPATH")
+             ;                           "")))
+             (apply (assoc-ref %standard-phases 'sanity-check) args)))
          (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
+           (lambda* (#:key tests? #:allow-other-keys #:rest args)
              (when tests?
                (setenv "PYTHONPATH"
                        (string-append "./build/lib:"
                                       (or (getenv "PYTHONPATH")
-                                          "")))))))))
+                                          "")))
+               (apply (assoc-ref %standard-phases 'check) args)))))))
     (inputs (list mycroft-mimic pocketsphinx))
     (propagated-inputs
-     (list python-fasteners
+     (list python-adapt-parser
+           python-dateutil
+           python-fann2
+           python-fasteners
+           python-gtts
            python-inflection
-           python-pyxdg
+           python-lingua-franca
+           python-msk
+           python-msm
            python-mycroft-messagebus-client
-           python-psutil
-           python-tornado-6
-           python-petact
-           python-precise-runner
            python-padaos
-           python-speech-recognition
            python-padatious
-           python-msk
+           python-petact
            python-pillow
-           python-gtts
-           python-requests-futures
-           python-pyserial
            python-pocketsphinx
-           python-adapt-parser
-           python-lingua-franca
-           python-pyyaml
-           python-fasteners
+           python-psutil
+           python-pyaudio
            python-pyee
-           python-psutil
-           python-fann2
            python-pyxdg
-           python-websocket-client
+           python-pyyaml
+           python-pyserial
+           python-precise-runner
            python-requests
-           python-requests-futures))
+           python-requests-futures
+           python-speech-recognition
+           python-tornado-6
+           python-websocket-client))
+    (native-inputs
+     (list python-pytest))
     (home-page "https://github.com/HelloChatterbox/HolmesIV")
     (synopsis "Mycroft Core, the Mycroft Artificial Intelligence platform")
     (description "This module provides a hackable open source voice assistant - Mycroft")