From patchwork Tue Feb 15 14:37:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: phodina X-Patchwork-Id: 37247 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A75C027BBEA; Tue, 15 Feb 2022 14:38:22 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D2B6427BBE9 for ; Tue, 15 Feb 2022 14:38:21 +0000 (GMT) Received: from localhost ([::1]:56872 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJyyD-0002fE-0V for patchwork@mira.cbaines.net; Tue, 15 Feb 2022 09:38:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJyy3-0002eh-3C for guix-patches@gnu.org; Tue, 15 Feb 2022 09:38:11 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50041) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJyxu-0000vz-20 for guix-patches@gnu.org; Tue, 15 Feb 2022 09:38:10 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJyxt-0005fL-MZ for guix-patches@gnu.org; Tue, 15 Feb 2022 09:38:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#50663] [PATCH v3 1/2] gnu: Add python-xdg. References: In-Reply-To: Resent-From: phodina Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 15 Feb 2022 14:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50663 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "50663@debbugs.gnu.org" <50663@debbugs.gnu.org> Received: via spool by 50663-submit@debbugs.gnu.org id=B50663.164493585721742 (code B ref 50663); Tue, 15 Feb 2022 14:38:01 +0000 Received: (at 50663) by debbugs.gnu.org; 15 Feb 2022 14:37:37 +0000 Received: from localhost ([127.0.0.1]:43938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJyxJ-0005eR-Ph for submit@debbugs.gnu.org; Tue, 15 Feb 2022 09:37:37 -0500 Received: from mail-4316.protonmail.ch ([185.70.43.16]:52651) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJyxG-0005eA-Pk for 50663@debbugs.gnu.org; Tue, 15 Feb 2022 09:37:24 -0500 Date: Tue, 15 Feb 2022 14:37:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1644935834; bh=+32TLl4H10MvDD25ZhdXRsWS8/UjiE6f9drFJXqsmpY=; h=Date:To:From:Reply-To:Subject:Message-ID:From:To:Cc:Date:Subject: Reply-To:Feedback-ID:Message-ID; b=LharENnmWzuV9EIca5PGPwV2DYIN5dOJA8nt3DTWFjOfJKnfEUDi9899OX5jpukec +bG2Qo/uek+pqUjkRBH9F3bDjNdnkKZu9ja3lgMbaMbo0AIibNuU7+0OqzqOrwr4fy JiFkGJSsj+i0Qcwf+mF+145KHyN+DQG6b+AAfUxljL8RN5wxjvx+HII1QYWZI+mM8J UwF7q/SKDQ8r/8UOa/TLM6as0fW97gCSYAstTZsxg3lAGfiln0QPk/XxGVq+UBW97j hVmCZ6VOgawsPcU7OxUPW7pIrlKdd9khByLUoGLmXJJKyS3cVvtDXdtwzFfU3BINWP gwNDFEtVuNvQA== Message-ID: MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: phodina X-ACL-Warn: , phodina via Guix-patches X-Patchwork-Original-From: phodina via Guix-patches via From: phodina X-getmail-retrieved-from-mailbox: Patches 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 From 25a9106faf2d9bd34fb48b689d39232a01a90cba Mon Sep 17 00:00:00 2001 From: Petr Hodina 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 ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2021 qblade -;;; Copyright © 2021 Petr Hodina +;;; Copyright © 2021, 2022 Petr Hodina ;;; ;;; 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