all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: phodina via Guix-patches via <guix-patches@gnu.org>
To: "50663@debbugs.gnu.org" <50663@debbugs.gnu.org>
Subject: [bug#50663] [PATCH v3 1/2] gnu: Add python-xdg.
Date: Tue, 15 Feb 2022 14:37:10 +0000	[thread overview]
Message-ID: <buIpKGDFKHj2syAWDtX3ittSW7KKIKhFmkhKpJ8U8GhWEjoWaqY0tvW7qq-IhbINsxXSjH8DpNPF2S37xjw4dlDgZ2lu_h8SkhfzuO4r120=@protonmail.com> (raw)
In-Reply-To: <qQ-NMjrokukHQud2psYiSbCZ9IpYwa0oatHWsznaPmngNBwHWaDqjE-NIb4plR7BF0snEHpfSGWL_RFYn5_fJ7kdg8lhZNDcW4O5YTfwwOE=@protonmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 557 bytes --]

Hi,

here are updated patches based on the review. Also I manged to fix the issues in the sanity-check phase.

However, there are still some points to be solved
https://github.com/MycroftAI/mycroft-core/issues/3074 as the ALSA lib error blocks the tests. I also don't know how to mock the audio subsystem in tests properly.

FIY I renamed the package from python-mycroft-core to mycroft-core and move it to gnu/packages/speech.scm as this IMHO reflect more the purpose of this package.

Python module xdg was added as it's referenced in the code.

----
Petr

[-- Attachment #1.2: Type: text/html, Size: 919 bytes --]

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: v3-0001-gnu-Add-python-xdg.patch --]
[-- Type: text/x-patch; name=v3-0001-gnu-Add-python-xdg.patch, Size: 1192 bytes --]

From c5a8653641595e549369a9ff008194a4a749f98e Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Tue, 15 Feb 2022 09:07:15 +0100
Subject: [PATCH v3 1/2] gnu: Add python-xdg.

* gnu/packages/python-xyz.scm (python-xdg): New variable.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index feab9c7b50..d95fc12465 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -14511,6 +14511,23 @@ (define-public python-pyfiglet
 in pure Python.")
     (license license:expat)))
 
+(define-public python-xdg
+  (package
+    (name "python-xdg")
+    (version "5.1.1")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (pypi-uri "xdg" version))
+        (sha256
+          (base32 "0v6hmhjqlc6km284lr14kc4h5rl6xva231q1lsr8hq7crhk9yqda"))))
+    (build-system python-build-system)
+    (home-page "https://github.com/srstevenson/xdg")
+    (synopsis "Implementation of the XDG Base Directory Specification")
+    (description "This package provides implementation of the XDG Base Directory
+Specification.")
+    (license license:isc)))
+
 (define-public python-xdo
   (package
     (name "python-xdo")
-- 
2.34.0


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: v3-0002-gnu-Add-mycroft-core.patch --]
[-- Type: text/x-patch; name=v3-0002-gnu-Add-mycroft-core.patch, Size: 9497 bytes --]

From 25a9106faf2d9bd34fb48b689d39232a01a90cba Mon Sep 17 00:00:00 2001
From: Petr Hodina <phodina@protonmail.com>
Date: Fri, 30 Jul 2021 17:21:07 +0200
Subject: [PATCH v3 2/2] gnu: Add mycroft-core.

* gnu/packages/speech.scm (mycroft-core): New variable.

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index d95fc12465..020855fb2a 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -210,6 +210,7 @@ (define-module (gnu packages python-xyz)
   #:use-module (gnu packages search)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages shells)
+  #:use-module (gnu packages speech)
   #:use-module (gnu packages sphinx)
   #:use-module (gnu packages ssh)
   #:use-module (gnu packages swig)
diff --git a/gnu/packages/speech.scm b/gnu/packages/speech.scm
index 98b6ebffe2..1851728d72 100644
--- a/gnu/packages/speech.scm
+++ b/gnu/packages/speech.scm
@@ -8,7 +8,7 @@
 ;;; Copyright © 2020 Nicolas Goaziou <mail@nicolasgoaziou.fr>
 ;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2021 qblade <qblade@protonmail.com>
-;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
+;;; Copyright © 2021, 2022 Petr Hodina <phodina@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -32,28 +32,43 @@ (define-module (gnu packages speech)
   #:use-module (guix git-download)
   #:use-module (guix utils)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)            ;for 'which'
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages check)
   #:use-module (gnu packages compression)
+  #:use-module (gnu packages curl)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages emacs)
+  #:use-module (gnu packages freedesktop)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gstreamer)
+  #:use-module (gnu packages icu4c)
+  #:use-module (gnu packages image)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages libffi)
   #:use-module (gnu packages ncurses)
+  #:use-module (gnu packages machine-learning)
+  #:use-module (gnu packages mp3)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages pulseaudio)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
+  #:use-module (gnu packages python-web)
+  #:use-module (gnu packages screen)
+  #:use-module (gnu packages sphinx)
   #:use-module (gnu packages swig)
   #:use-module (gnu packages texinfo)
-  #:use-module (gnu packages textutils))
+  #:use-module (gnu packages textutils)
+  #:use-module (gnu packages time)
+  #:use-module (gnu packages xiph))
 
 (define-public flite
   (package
@@ -652,6 +667,127 @@ (define-public sphinxbase
 manipulating acoustic feature and audio files.")
     (license license:bsd-4)))
 
+(define-public mycroft-core
+  (package
+    (name "mycroft-core")
+    (version "21.2.2")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/MycroftAI/mycroft-core")
+                    (commit (string-append "release/v" version))))
+              (file-name (git-file-name name version))
+              (patches (search-patches "mycroft-core-remove-venv.patch"))
+              (sha256
+               (base32
+                "02r0vxw0hsihnvviwn4fyspwky3kwq42f9z455q1s70k0snzhb28"))))
+    (build-system python-build-system)
+    (arguments
+     `(#:tests? #f ; Currently failing due to ALSA lib
+	               ; https://github.com/MycroftAI/mycroft-core/issues/3074
+       #:phases (modify-phases %standard-phases
+                  (add-after 'unpack 'patch-requirements
+                    (lambda* (#:key inputs outputs #:allow-other-keys)
+                      (let ((mycroft-home (string-append (assoc-ref outputs
+                                                                    "out")
+                                                         "/opt/mycroft")))
+                        (mkdir-p mycroft-home)
+                        ;; Fix home Mycroft directory (used for e.g. skills)
+                        (substitute* "scripts/mycroft-use.sh"
+                          (("/opt/mycroft") mycroft-home))
+                        (substitute* "scripts/my-info.sh"
+                          (("/opt/mycroft") mycroft-home))
+                        (substitute* "mycroft/skills/mycroft_skill/mycroft_skill.py"
+                          (("/opt/mycroft") mycroft-home))
+                        (substitute* "mycroft/configuration/mycroft.conf"
+                          (("/opt/mycroft") mycroft-home))
+                        (substitute* "mycroft/util/file_utils.py"
+                          (("/opt/mycroft") mycroft-home))
+                        (substitute* "test/unittests/tts/test_mimic_tts.py"
+                          (("/opt/mycroft") mycroft-home))
+                        (substitute* "test/unittests/api/test_api.py"
+                          (("/opt/mycroft") mycroft-home))
+                        (substitute* "test/integrationtests/skills/test_all_skills.py"
+                          (("/opt/mycroft") mycroft-home))
+                        (substitute* "README.md"
+                          (("/opt/mycroft") mycroft-home))
+                        ;; Fix mimic binary path
+                        (substitute* "mycroft/tts/mimic_tts.py"
+                          (("bin_ = config.*") (string-append "bin_ = \""
+                                                              (assoc-ref
+                                                               inputs
+                                                               "mycroft-mimic")
+                                                              "/bin/mimic\"
+"))
+                          (("os.path.join\\(MYCROFT_ROOT_PATH.*") ""))
+                        ;; Fix sanity-check errors
+                        (substitute* "setup.py"
+                          (("client\\.ws") "client.client"))
+                        (substitute* "mycroft/client/text/text_client.py"
+                          (("\\.gui_server") "mycroft.client.text.gui_server"))
+                        (substitute* "mycroft/client/text/__main__.py"
+                          (("\\.text_client")
+                           "mycroft.client.text.text_client"))
+                        ;; Use newer version of pkg
+                        (setenv "MYCROFT_LOOSE_REQUIREMENTS" "1")
+                        (substitute* "requirements/requirements.txt"
+                          (("requests>=2.20.0,<2.26.0") "requests>=2.20.0")))))
+                  (replace 'check
+                    (lambda* (#:key tests? #:allow-other-keys
+                              #:rest args)
+                      (when tests?
+                        (setenv "HOME" "/tmp")
+                        (setenv "PYTHONPATH"
+                                (string-append "./build/lib:"
+                                               (or (getenv "PYTHONPATH") "")))
+                        (apply (assoc-ref %standard-phases
+                                          'check) args)))))))
+    (native-inputs (list python-pytest swig))
+    (inputs (list curl
+                  fann
+                  flac
+                  icu4c
+                  libffi
+                  libjpeg-turbo
+                  mpg123
+                  mycroft-mimic
+                  portaudio
+                  pocketsphinx
+                  pulseaudio
+                  screen))
+    (propagated-inputs (list python-adapt-parser
+                             python-dateutil
+                             python-fann2
+                             python-fasteners
+                             python-gtts
+                             python-inflection
+                             python-lingua-franca
+                             python-msk
+                             python-msm
+                             python-mycroft-messagebus-client
+                             python-padaos
+                             python-padatious
+                             python-petact
+                             python-pillow
+                             python-pocketsphinx
+                             python-precise-runner
+                             python-psutil
+                             python-pyaudio
+                             python-pyee
+                             python-pyserial
+                             python-pyxdg
+                             python-pyyaml
+                             python-requests
+                             python-requests-futures
+                             python-speech-recognition
+                             python-tornado-6
+                             python-websocket-client
+                             python-xdg))
+    (home-page "https://github.com/HelloChatterbox/HolmesIV")
+    (synopsis "Mycroft Core, the Mycroft Artificial Intelligence platform")
+    (description "This module provides a hackable voice assistant - Mycroft")
+    (license license:asl2.0)))
+
 (define-public pocketsphinx
   (package
     (name "pocketsphinx")
-- 
2.34.0


      parent reply	other threads:[~2022-02-15 14:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-18 17:01 [bug#50663] [PATCH 01/18] gnu: Add python-pyee phodina via Guix-patches via
2021-09-18 17:04 ` [bug#50663] [PATCH 02/18] gnu: Add python-fann2 phodina via Guix-patches via
2021-09-18 18:58 ` [bug#50663] [PATCH 03/19] gnu: Add python-padaos phodina via Guix-patches via
2021-09-18 18:59 ` [bug#50663] [PATCH 04/19] gnu: Add python-precise-runner phodina via Guix-patches via
2021-09-18 18:59 ` [bug#50663] [PATCH 05/19] gnu: Add python-petact phodina via Guix-patches via
2021-09-18 19:00 ` [bug#50663] [PATCH 06/19] gnu: Add python-padatious phodina via Guix-patches via
2021-09-18 19:01 ` [bug#50663] [PATCH 07/19] gnu: Add python-lazy phodina via Guix-patches via
2021-09-18 19:01 ` [bug#50663] [PATCH 08/19] gnu: Add python-pako phodina via Guix-patches via
2021-09-18 19:02 ` [bug#50663] [PATCH 09/19] gnu: Add python-adapt-parser phodina via Guix-patches via
2021-09-18 19:03 ` [bug#50663] [PATCH 10/19] gnu: Add python-msm phodina via Guix-patches via
2021-09-18 19:03 ` [bug#50663] [PATCH 11/19] gnu: Add python-msk phodina via Guix-patches via
2021-09-18 19:03 ` [bug#50663] [PATCH 12/19] gnu: Add python-lingua-franca phodina via Guix-patches via
2021-09-18 19:04 ` [bug#50663] [PATCH 13/19] gnu: Add python-pocketsphinx phodina via Guix-patches via
2021-09-18 19:04 ` [bug#50663] [PATCH 14/19] gnu: Add python-gtts phodina via Guix-patches via
2021-09-18 19:11 ` [bug#50663] [PATCH 16/19] gnu: Add python-mycroft-messagebus-client phodina via Guix-patches via
2021-09-18 19:11 ` [bug#50663] [PATCH 17/19] gnu: Add mycroft-mimic phodina via Guix-patches via
2021-09-18 19:12 ` [bug#50663] [PATCH 18/19] gnu: Add python-speech-recognition phodina via Guix-patches via
2021-09-18 19:12 ` [bug#50663] [PATCH 19/19] gnu: Add python-mycroft-core phodina via Guix-patches via
2021-09-18 19:16 ` [bug#50663] [PATCH 02/19] gnu: Add python-pyee phodina via Guix-patches via
2021-12-08 11:48 ` [bug#50663] Add Mycroft - Voice Assistant phodina via Guix-patches via
2022-01-24 22:45   ` Nicolas Goaziou
2022-01-25 10:49     ` Efraim Flashner
2022-01-26 12:53       ` phodina via Guix-patches via
2022-02-15 14:37 ` phodina via Guix-patches via [this message]

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='buIpKGDFKHj2syAWDtX3ittSW7KKIKhFmkhKpJ8U8GhWEjoWaqY0tvW7qq-IhbINsxXSjH8DpNPF2S37xjw4dlDgZ2lu_h8SkhfzuO4r120=@protonmail.com' \
    --to=guix-patches@gnu.org \
    --cc=50663@debbugs.gnu.org \
    --cc=phodina@protonmail.com \
    /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.