aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Ribbers <bribbers@disroot.org>2021-12-18 15:13:27 +0100
committerBart Ribbers <bribbers@disroot.org>2021-12-18 14:14:12 +0000
commitd0abbae812cf1d5e28f30a69cec138c93abc5997 (patch)
treec7a1930bb6fc26427c74ea01b95654c12086b68e
parent54e016a6a5ec17e76af5fa84c89570555a090494 (diff)
community/mycroft-core: upgrade to 21.2.2
-rw-r--r--community/mycroft-core/0001-Upgrade-websocket-client-to-1.2.1.patch82
-rw-r--r--community/mycroft-core/0001-loose-requirements.patch12
-rw-r--r--community/mycroft-core/0003-system-wide-setups.patch213
-rw-r--r--community/mycroft-core/APKBUILD12
4 files changed, 200 insertions, 119 deletions
diff --git a/community/mycroft-core/0001-Upgrade-websocket-client-to-1.2.1.patch b/community/mycroft-core/0001-Upgrade-websocket-client-to-1.2.1.patch
deleted file mode 100644
index 263d2e86680..00000000000
--- a/community/mycroft-core/0001-Upgrade-websocket-client-to-1.2.1.patch
+++ /dev/null
@@ -1,82 +0,0 @@
-From 84d56c3f14be00c4d1d91a05512c64c27bd3d480 Mon Sep 17 00:00:00 2001
-From: Bart Ribbers <bribbers@disroot.org>
-Date: Sun, 4 Apr 2021 12:52:12 +0200
-Subject: [PATCH] Upgrade websocket-client to 1.2.1
-
-core equivalent of https://github.com/MycroftAI/mycroft-messagebus-client/pull/21
-There was an incompability with the latest websocket-client and the
-messagebus which needed fixing for Linux distro compatibility. Since
-messagebus-client was going to depend on websocket-client 1.2.1, let's
-do the same in core
----
- mycroft/client/enclosure/base.py | 4 ++--
- requirements/requirements.txt | 4 ++--
- test/integrationtests/voight_kampff/features/environment.py | 4 ++--
- 3 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/mycroft/client/enclosure/base.py b/mycroft/client/enclosure/base.py
-index 4d26a42f43fa..ae4ea7edcb63 100644
---- a/mycroft/client/enclosure/base.py
-+++ b/mycroft/client/enclosure/base.py
-@@ -493,7 +493,7 @@ def open(self):
- LOG.info('New Connection opened!')
- self.synchronize()
-
-- def on_close(self):
-+ def on_close(self, _):
- LOG.info('Closing {}'.format(id(self)))
- GUIWebsocketHandler.clients.remove(self)
-
-@@ -525,7 +525,7 @@ def synchronize(self):
- })
- namespace_pos += 1
-
-- def on_message(self, message):
-+ def on_message(self, _, message):
- LOG.info("Received: {}".format(message))
- msg = json.loads(message)
- if (msg.get('type') == "mycroft.events.triggered" and
-diff --git a/requirements/requirements.txt b/requirements/requirements.txt
-index 0c7c8197a2dd..c1808c7ce59b 100644
---- a/requirements/requirements.txt
-+++ b/requirements/requirements.txt
-@@ -4,7 +4,7 @@ PyAudio==0.2.11
- pyee==8.1.0
- SpeechRecognition==3.8.1
- tornado==6.0.3
--websocket-client==0.54.0
-+websocket-client~=1.2.1
- requests-futures==0.9.5
- pyserial==3.0
- psutil==5.6.6
-@@ -18,7 +18,7 @@ PyYAML==5.4
- lingua-franca==0.4.2
- msm==0.8.9
- msk==0.3.16
--mycroft-messagebus-client==0.9.1
-+mycroft-messagebus-client==0.9.3
- adapt-parser==0.5.1
- padatious==0.4.8
- fann2==1.0.7
-diff --git a/test/integrationtests/voight_kampff/features/environment.py b/test/integrationtests/voight_kampff/features/environment.py
-index 2c2bebb98551..96abf8ad40e6 100644
---- a/test/integrationtests/voight_kampff/features/environment.py
-+++ b/test/integrationtests/voight_kampff/features/environment.py
-@@ -49,7 +49,7 @@ def __init__(self):
- self.new_message_available = Event()
- self._processed_messages = 0
-
-- def on_message(self, message):
-+ def on_message(self, _, message):
- """Extends normal operation by storing the recieved message.
-
- Args:
-@@ -58,7 +58,7 @@ def on_message(self, message):
- with self.message_lock:
- self.messages.append(Message.deserialize(message))
- self.new_message_available.set()
-- super().on_message(message)
-+ super().on_message(_, message)
-
- def get_messages(self, msg_type):
- """Get messages from received list of messages.
diff --git a/community/mycroft-core/0001-loose-requirements.patch b/community/mycroft-core/0001-loose-requirements.patch
new file mode 100644
index 00000000000..26656912f95
--- /dev/null
+++ b/community/mycroft-core/0001-loose-requirements.patch
@@ -0,0 +1,12 @@
+diff --git a/requirements/requirements.txt b/requirements/requirements.txt
+index b7693ec2242..d8e28fdccc2 100644
+--- a/requirements/requirements.txt
++++ b/requirements/requirements.txt
+@@ -1,5 +1,5 @@
+-requests>=2.20.0,<2.26.0
+-gTTS>=2.2.2,<2.3.0
++requests>=2.20.0
++gTTS>=2.2.2
+ PyAudio==0.2.11
+ pyee==8.1.0
+ SpeechRecognition==3.8.1
diff --git a/community/mycroft-core/0003-system-wide-setups.patch b/community/mycroft-core/0003-system-wide-setups.patch
index 166791a641b..3f8125eaa12 100644
--- a/community/mycroft-core/0003-system-wide-setups.patch
+++ b/community/mycroft-core/0003-system-wide-setups.patch
@@ -1,4 +1,4 @@
-From b970ba2f07116813640324301089d203200096f6 Mon Sep 17 00:00:00 2001
+From 927c812c3a2a7be503d929070c189b9aaac97896 Mon Sep 17 00:00:00 2001
From: Bart Ribbers <bribbers@disroot.org>
Date: Fri, 15 Jan 2021 12:59:25 +0100
Subject: [PATCH 1/2] Replace mycroft-{start,stop} with scripts that can launch
@@ -19,12 +19,13 @@ installable with pip.
---
bin/mycroft-start | 153 +++++++++++++++++++++++++++++++++++++++--
bin/mycroft-stop | 109 +++++++++++++++++++++++++++--
- requirements/tests.txt | 2 +-
- setup.py | 7 +-
- 5 files changed, 270 insertions(+), 55 deletions(-)
+ dev_setup.sh | 82 ++++------------------
+ requirements/tests.txt | 4 +-
+ setup.py | 9 ++-
+ 5 files changed, 276 insertions(+), 81 deletions(-)
diff --git a/bin/mycroft-start b/bin/mycroft-start
-index 65723c2c3734..30cd1ecfdbbb 100755
+index cec59efaec8..94fedf9a7a3 100755
--- a/bin/mycroft-start
+++ b/bin/mycroft-start
@@ -1,4 +1,4 @@
@@ -38,12 +39,12 @@ index 65723c2c3734..30cd1ecfdbbb 100755
# limitations under the License.
-SOURCE="${BASH_SOURCE[0]}"
--cd -P "$( dirname "$SOURCE" )"/..
+-cd -P "$( dirname "$SOURCE" )"/.. || exit
-DIR="$( pwd )"
+script=${0}
+script=${script##*/}
--. "$DIR/start-mycroft.sh" $@
+-. "$DIR/start-mycroft.sh" "$@"
+help() {
+ echo "${script}: Mycroft command/service launcher"
+ echo "usage: ${script} [COMMAND] [restart] [params]"
@@ -97,7 +98,7 @@ index 65723c2c3734..30cd1ecfdbbb 100755
+launch_process() {
+ name_to_script_path "${1}"
+
-+ # Luanch process in foreground
++ # Launch process in foreground
+ echo "Starting $1"
+ python3 -m ${_module} "$_params"
+}
@@ -190,7 +191,7 @@ index 65723c2c3734..30cd1ecfdbbb 100755
+ ;;
+esac
diff --git a/bin/mycroft-stop b/bin/mycroft-stop
-index b86b0ea65577..289c736959ae 100755
+index dc79ca34a8b..289c736959a 100755
--- a/bin/mycroft-stop
+++ b/bin/mycroft-stop
@@ -1,4 +1,4 @@
@@ -204,12 +205,12 @@ index b86b0ea65577..289c736959ae 100755
# limitations under the License.
-SOURCE="${BASH_SOURCE[0]}"
--cd -P "$( dirname "$SOURCE" )"/..
+-cd -P "$( dirname "$SOURCE" )"/.. || exit
-DIR="$( pwd )"
+script=${0}
+script=${script##*/}
--. "$DIR/stop-mycroft.sh" $@
+-. "$DIR/stop-mycroft.sh" "$@"
+help() {
+ echo "${script}: Mycroft service stopper"
+ echo "usage: ${script} [service]"
@@ -311,31 +312,181 @@ index b86b0ea65577..289c736959ae 100755
+# 100 at least one process was stopped
+# 120 if any process had to be killed
+exit $result
+diff --git a/dev_setup.sh b/dev_setup.sh
+index 4cfe6ca05a1..5d0eef22604 100755
+--- a/dev_setup.sh
++++ b/dev_setup.sh
+@@ -25,6 +25,8 @@ set -Ee
+ cd $(dirname $0)
+ TOP=$(pwd -L)
+
++logdir="${XDG_CACHE_HOME:-$HOME/.cache}/mycroft"
++
+ function clean_mycroft_files() {
+ echo '
+ This will completely remove any files installed by mycroft (including pairing
+@@ -34,11 +36,20 @@ Do you wish to continue? (y/n)'
+ read -N1 -s key
+ case $key in
+ [Yy])
+- sudo rm -rf /var/log/mycroft
++ rm -rf $logdir
+ rm -f /var/tmp/mycroft_web_cache.json
+ rm -rf "${TMPDIR:-/tmp}/mycroft"
+ rm -rf "$HOME/.mycroft"
+- sudo rm -rf "/opt/mycroft"
++
++ # If the following directories don't exist anyway we don't have to use sudo
++ # These directories aren't used anymore anyway and are only leftovers
++ if [ -d "/var/log/mycroft" ]; then
++ sudo rm -rf /var/log/mycroft
++ fi
++ if [ -d "/opt/mycroft" ]; then
++ sudo rm -rf /opt/mycroft
++ fi
++ ${VIRTUALENV}/bin/pip uninstall .
+ exit 0
+ ;;
+ [Nn])
+@@ -253,33 +264,6 @@ locally?'
+ fi
+
+ echo
+- # Add mycroft-core/bin to the .bashrc PATH?
+- sleep 0.5
+- echo '
+-There are several Mycroft helper commands in the bin folder. These
+-can be added to your system PATH, making it simpler to use Mycroft.
+-Would you like this to be added to your PATH in the .profile?'
+- if get_YN ; then
+- echo -e "$HIGHLIGHT Y - Adding Mycroft commands to your PATH $RESET"
+-
+- if [[ ! -f ~/.profile_mycroft ]] ; then
+- # Only add the following to the .profile if .profile_mycroft
+- # doesn't exist, indicating this script has not been run before
+- echo '' >> ~/.profile
+- echo '# include Mycroft commands' >> ~/.profile
+- echo 'source ~/.profile_mycroft' >> ~/.profile
+- fi
+-
+- echo "
+-# WARNING: This file may be replaced in future, do not customize.
+-# set path so it includes Mycroft utilities
+-if [ -d \"${TOP}/bin\" ] ; then
+- PATH=\"\$PATH:${TOP}/bin\"
+-fi" > ~/.profile_mycroft
+- echo -e "Type ${CYAN}mycroft-help$RESET to see available commands."
+- else
+- echo -e "$HIGHLIGHT N - PATH left unchanged $RESET"
+- fi
+
+ # Create a link to the 'skills' folder.
+ sleep 0.5
+@@ -358,18 +342,15 @@ Please review the following package changes carefully."
+ fi
+ }
+
+-
+ function open_suse_install() {
+ $SUDO zypper install -y git python3 python3-devel libtool libffi-devel libopenssl-devel autoconf automake bison swig portaudio-devel mpg123 flac curl libicu-devel pkg-config libjpeg-devel libfann-devel python3-curses pulseaudio
+ $SUDO zypper install -y -t pattern devel_C_C++
+ }
+
+-
+ function fedora_install() {
+ $SUDO dnf install -y git python3 python3-devel python3-pip python3-setuptools python3-virtualenv pygobject3-devel libtool libffi-devel openssl-devel autoconf bison swig glib2-devel portaudio-devel mpg123 mpg123-plugins-pulseaudio screen curl pkgconfig libicu-devel automake libjpeg-turbo-devel fann-devel gcc-c++ redhat-rpm-config jq make pulseaudio-utils
+ }
+
+-
+ function arch_install() {
+ $SUDO pacman -S --needed --noconfirm git python python-pip python-setuptools python-virtualenv python-gobject libffi swig portaudio mpg123 screen flac curl icu libjpeg-turbo base-devel jq pulseaudio pulseaudio-alsa
+
+@@ -382,7 +363,6 @@ function arch_install() {
+ )
+ }
+
+-
+ function centos_install() {
+ $SUDO yum install epel-release
+ redhat_common_install
+@@ -545,30 +525,8 @@ if ! grep -q "$TOP" $VENV_PATH_FILE ; then
+ ' "$VENV_PATH_FILE"
+ fi
+
+-# install required python modules
+-if ! pip install -r requirements/requirements.txt ; then
+- echo 'Warning: Failed to install required dependencies. Continue? y/N'
+- read -n1 continue
+- if [[ $continue != 'y' ]] ; then
+- exit 1
+- fi
+-fi
+-
+-# install optional python modules
+-if [[ ! $(pip install -r requirements/extra-audiobackend.txt) ||
+- ! $(pip install -r requirements/extra-stt.txt) ||
+- ! $(pip install -r requirements/extra-mark1.txt) ]] ; then
+- echo 'Warning: Failed to install some optional dependencies. Continue? y/N'
+- read -n1 continue
+- if [[ $continue != 'y' ]] ; then
+- exit 1
+- fi
+-fi
+-
+-
+-if ! pip install -r requirements/tests.txt ; then
+- echo "Warning: Test requirements failed to install. Note: normal operation should still work fine..."
+-fi
++# Actually install Mycroft and it's deps
++pip install -e ".[test,audio-backend,stt,mark1]"
+
+ SYSMEM=$(free | awk '/^Mem:/ { print $2 }')
+ MAXCORES=$(($SYSMEM / 2202010))
+@@ -614,15 +572,5 @@ chmod +x bin/mycroft-say-to
+ chmod +x bin/mycroft-skill-testrunner
+ chmod +x bin/mycroft-speak
+
+-# create and set permissions for logging
+-if [[ ! -w /var/log/mycroft/ ]] ; then
+- # Creating and setting permissions
+- echo 'Creating /var/log/mycroft/ directory'
+- if [[ ! -d /var/log/mycroft/ ]] ; then
+- $SUDO mkdir /var/log/mycroft/
+- fi
+- $SUDO chmod 777 /var/log/mycroft/
+-fi
+-
+ #Store a fingerprint of setup
+ md5sum requirements/requirements.txt requirements/extra-audiobackend.txt requirements/extra-stt.txt requirements/extra-mark1.txt requirements/tests.txt dev_setup.sh > .installed
diff --git a/requirements/tests.txt b/requirements/tests.txt
-index 9e038123e51a..306320db3e8b 100644
+index ca6addcc0d6..69c1ad42938 100644
--- a/requirements/tests.txt
+++ b/requirements/tests.txt
-@@ -5,7 +5,7 @@ pytest-cov==2.8.1
+@@ -5,8 +5,8 @@ pytest-cov==2.8.1
cov-core==1.15.0
sphinx==2.2.1
sphinx-rtd-theme==0.4.3
--git+https://github.com/behave/behave@v1.2.7.dev1
-+behave @ git+https://github.com/behave/behave@v1.2.7.dev1
+-https://github.com/krisgesling/tag-expressions-python/tarball/master/
+-https://github.com/krisgesling/behave/tarball/master/
++cucumber-tag-expressions @ git+https://github.com/krisgesling/tag-expressions-python@master
++behave @ git+https://github.com/krisgesling/behave@master
allure-behave==2.8.10
python-vlc==1.1.2
diff --git a/setup.py b/setup.py
-index 963c503e4d2f..815fceaa4c65 100644
+index 963c503e4d2..afd950a97cb 100644
--- a/setup.py
+++ b/setup.py
-@@ -66,6 +66,7 @@ def required(requirements_file):
+@@ -64,7 +64,8 @@ def required(requirements_file):
+ extras_require={
+ 'audio-backend': required('requirements/extra-audiobackend.txt'),
'mark1': required('requirements/extra-mark1.txt'),
- 'stt': required('requirements/extra-stt.txt')
+- 'stt': required('requirements/extra-stt.txt')
++ 'stt': required('requirements/extra-stt.txt'),
++ 'test': required('requirements/tests.txt')
},
-+ tests_require=required('requirements/tests.txt'),
packages=find_packages(include=['mycroft*']),
include_package_data=True,
-
@@ -80,5 +81,9 @@ def required(requirements_file):
'mycroft-enclosure-client=mycroft.client.enclosure.__main__:main',
'mycroft-cli-client=mycroft.client.text.__main__:main'
@@ -348,20 +499,20 @@ index 963c503e4d2f..815fceaa4c65 100644
+ ]
)
-From 55956b7c30106ec3a903d6544982a051929ecf10 Mon Sep 17 00:00:00 2001
+From eef76c203703239dc07281849df38995e43009f7 Mon Sep 17 00:00:00 2001
From: Bart Ribbers <bribbers@disroot.org>
Date: Fri, 15 Jan 2021 13:18:35 +0100
Subject: [PATCH 2/2] Update README to reflect properly installed setups
---
- README.md | 43 ++++++++++++++++++++++++++++++++-----------
- 1 file changed, 32 insertions(+), 11 deletions(-)
+ README.md | 44 ++++++++++++++++++++++++++++++++------------
+ 1 file changed, 32 insertions(+), 12 deletions(-)
diff --git a/README.md b/README.md
-index d34d08e3474b..ad8be331fe15 100644
+index d34d08e3474..6e69434d340 100644
--- a/README.md
+++ b/README.md
-@@ -32,29 +32,50 @@ Mycroft is a hackable open source voice assistant.
+@@ -32,29 +32,49 @@ Mycroft is a hackable open source voice assistant.
## Getting Started
@@ -372,23 +523,23 @@ index d34d08e3474b..ad8be331fe15 100644
-- `bash dev_setup.sh`
+Mycroft might be packaged by your distribution already, in that case installing it might be as simple as `apk add mycroft-core` or equivalent for your distribution.
+Otherwise, the simplest method is downloading the latest release on the [Github releases page](https://github.com/MycroftAI/mycroft-core/releases) and unpacking it somewhere.
-+Then run the following commandsd in the unpacked directory.
++Then run the following commands in the unpacked directory.
+```sh
-+pip install -r requirements/requirements.txt # This installs the required Python dependencies
-+pip install . # This actually installs mycroft-core
++pip install . # This actually installs Mycroft and it's dependencies
+```
+
+For development on Mycroft it's recommended to use Git instead ([git installation instructions](https://gist.github.com/derhuerst/1b15ff4652a867391f03)).
-+
+
+-This script sets up dependencies and a [virtualenv][about-virtualenv]. If running in an environment besides Ubuntu/Debian, Arch or Fedora you may need to manually install packages as instructed by dev_setup.sh.
+```sh
+cd ~/
+git clone https://github.com/MycroftAI/mycroft-core.git
+cd mycroft-core
+./dev_setup.sh
+```
-
- This script sets up dependencies and a [virtualenv][about-virtualenv]. If running in an environment besides Ubuntu/Debian, Arch or Fedora you may need to manually install packages as instructed by dev_setup.sh.
++
++This script sets up dependencies and a [virtualenv][about-virtualenv]. If running in an environment besides Ubuntu/Debian, Arch or Fedora you may need to manually install packages as instructed by `dev_setup.sh`.
[about-virtualenv]:https://virtualenv.pypa.io/en/stable/
diff --git a/community/mycroft-core/APKBUILD b/community/mycroft-core/APKBUILD
index b4a78b37bd3..36388cbd35e 100644
--- a/community/mycroft-core/APKBUILD
+++ b/community/mycroft-core/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=mycroft-core
-pkgver=21.2.1
-pkgrel=2
+pkgver=21.2.2
+pkgrel=0
pkgdesc="Mycroft Core, the Mycroft Artificial Intelligence platform"
url="https://mycroft.ai/"
# ppc64le and s390x blocked by py3-precise-runner
@@ -58,7 +58,7 @@ checkdepends="
install="$pkgname.post-install"
source="$pkgname-$pkgver.tar.gz::https://github.com/MycroftAI/mycroft-core/archive/release/v$pkgver.tar.gz
profile.sh
- 0001-Upgrade-websocket-client-to-1.2.1.patch
+ 0001-loose-requirements.patch
0003-system-wide-setups.patch
0004-skills-from-xdg.patch
"
@@ -83,9 +83,9 @@ package() {
install -Dm644 "$srcdir"/profile.sh "$pkgdir"/etc/profile.d/mycroft.sh
}
sha512sums="
-ee74058aae496239a66970237709fae945621072a4bc35bb8a2f590b59b5e624286a15258fb7dd9db92c087910a94ff956b10c48e8ad3dac462ed689f3bb538a mycroft-core-21.2.1.tar.gz
+850711f7fc6150349f1b4a979342bc186e40b618e5fd6a5bc6ab845083c2f93fd0c96a0e1efb7f4636a6d768ee03b4aae478ec31ae63bf553d0af673dfbb793e mycroft-core-21.2.2.tar.gz
c3d1a605a0b574c8e2c4031f592bdbf023f5ed9b2e1ba0cea38cf79278331f245dbe4e220e7f81de73fe612ffd722253805058dae04ba89c3d01c361b329e4ef profile.sh
-eaf9674cc24e3128775cc4ef0de89e7950ab07f7c3b2b5a0fcef9f6258be6307c518dc3ab2744f60f06335c1f28a5560ffb4a61667ae03fda2e3ec56803fccf9 0001-Upgrade-websocket-client-to-1.2.1.patch
-827e0a4b46d7ee5fa37c872d1b58f4445009f867992b92589a9b1619abd9213c3803e6af2c1672e474ef23c6dcbbf03782e98b321d3f92329a5759cbd9e648cf 0003-system-wide-setups.patch
+f78dd1fcf40ada2d11f6a6e363180004de53d52fb9491c43704e9057fbc8f95981b17a413caf9c1bd508778b3cb4c33535f4fbdf23c1d5fefe2c6e4c719684b6 0001-loose-requirements.patch
+a7af648664c371284af0b3596ec5565db3936680fe16f9adc68a2bf0af91c41427b0695af2c1c793ee725c3a6bfbf893954dd4ade880864c4679ce266649a54c 0003-system-wide-setups.patch
6628a97a528ea005f291b59e975a11b315cf13fb6270b826f4e33a7aa017026a53b7b1c6a5a61844330267a3852b395a59723185a391c8d1510939b0e98654fe 0004-skills-from-xdg.patch
"