summaryrefslogtreecommitdiffstats
path: root/meta-multimedia/recipes-multimedia/mycroft/files/0003-Use-python3-and-pip3-instead-of-python-and-pip.patch
diff options
context:
space:
mode:
authorAlistair Francis <alistair.francis@wdc.com>2019-04-05 14:41:54 +0000
committerKhem Raj <raj.khem@gmail.com>2019-04-06 08:22:22 -0700
commitfb097550fdc5e8a7de6bdceb87d8aa161b94eb06 (patch)
tree73a0e690aee2c7923e4531ac92eba0076fc105a2 /meta-multimedia/recipes-multimedia/mycroft/files/0003-Use-python3-and-pip3-instead-of-python-and-pip.patch
parent47f4a924102d014fcd5e68170b98392cfa1f5f44 (diff)
downloadmeta-openembedded-fb097550fdc5e8a7de6bdceb87d8aa161b94eb06.tar.gz
mycroft: Initial commit
Mycroft is an open source speech assistant. It traditionally runs inside Python virtual env and installs all of the pip and native packages and programs that is needs at setup. This generally includes a native gcc build for some of the binaries in the pip packages. This patch adds Mycroft support and edits the source to remove the Python venv usage so we can just run in standard Python world. This allows us to use the preinstalled Python packages where avaliable and avoid installing too much on the target at runtime. At the moment we still require a few simple Python packages to be installed but we don't requrie any target compilation. Hopefully in the future we can remove all of the runtime install requirements by adding all the Python packages to the rootFS pre-boot and setting up the other files/directories as required during the build process. This patch also adds two systemd services. The first will setup mycroft on boot, the second will start the mycroft voice assistant. Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-multimedia/recipes-multimedia/mycroft/files/0003-Use-python3-and-pip3-instead-of-python-and-pip.patch')
-rw-r--r--meta-multimedia/recipes-multimedia/mycroft/files/0003-Use-python3-and-pip3-instead-of-python-and-pip.patch135
1 files changed, 135 insertions, 0 deletions
diff --git a/meta-multimedia/recipes-multimedia/mycroft/files/0003-Use-python3-and-pip3-instead-of-python-and-pip.patch b/meta-multimedia/recipes-multimedia/mycroft/files/0003-Use-python3-and-pip3-instead-of-python-and-pip.patch
new file mode 100644
index 0000000000..a1f04b4b47
--- /dev/null
+++ b/meta-multimedia/recipes-multimedia/mycroft/files/0003-Use-python3-and-pip3-instead-of-python-and-pip.patch
@@ -0,0 +1,135 @@
1From 87b94e54fefa1f83b41030444fc87b421c97b2c5 Mon Sep 17 00:00:00 2001
2From: Alistair Francis <alistair.francis@wdc.com>
3Date: Tue, 19 Mar 2019 13:38:44 -0700
4Subject: [PATCH 3/5] Use python3 and pip3 instead of python and pip
5
6Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
7Upstream-Status: Inappropriate [embedded specific]
8---
9 bin/mycroft-cli-client | 2 +-
10 bin/mycroft-pip | 2 +-
11 bin/mycroft-say-to | 2 +-
12 bin/mycroft-skill-testrunner | 4 ++--
13 bin/mycroft-speak | 2 +-
14 dev_setup.sh | 10 +++++-----
15 scripts/install-pocketsphinx.sh | 2 +-
16 7 files changed, 12 insertions(+), 12 deletions(-)
17
18diff --git a/bin/mycroft-cli-client b/bin/mycroft-cli-client
19index f40a316e3f6..de2040d9e67 100755
20--- a/bin/mycroft-cli-client
21+++ b/bin/mycroft-cli-client
22@@ -21,4 +21,4 @@ DIR="$( dirname "$SOURCE" )"
23 source "$DIR/../venv-activate.sh" -q
24
25 # Invoke the Command Line Interface
26-python -m mycroft.client.text $@
27+python3 -m mycroft.client.text $@
28diff --git a/bin/mycroft-pip b/bin/mycroft-pip
29index a42b16b847a..81bd5bfb3cf 100755
30--- a/bin/mycroft-pip
31+++ b/bin/mycroft-pip
32@@ -21,4 +21,4 @@ DIR="$( dirname "$SOURCE" )"
33 source "$DIR/../venv-activate.sh" -q
34
35 # Install pip packages within the Mycroft venv
36-pip $@
37\ No newline at end of file
38+pip3 $@
39\ No newline at end of file
40diff --git a/bin/mycroft-say-to b/bin/mycroft-say-to
41index 964e16eb0c5..5575969715c 100755
42--- a/bin/mycroft-say-to
43+++ b/bin/mycroft-say-to
44@@ -22,4 +22,4 @@ DIR="$( pwd )"
45 source "$DIR/../venv-activate.sh" -q
46
47 # Send a message to be spoken
48-output=$(python -m mycroft.messagebus.send "recognizer_loop:utterance" "{\"utterances\": [\"$@\"], \"lang\": \"en-us\"}")
49+output=$(python3 -m mycroft.messagebus.send "recognizer_loop:utterance" "{\"utterances\": [\"$@\"], \"lang\": \"en-us\"}")
50diff --git a/bin/mycroft-skill-testrunner b/bin/mycroft-skill-testrunner
51index 9699a4d138f..282f5ca65b0 100755
52--- a/bin/mycroft-skill-testrunner
53+++ b/bin/mycroft-skill-testrunner
54@@ -22,7 +22,7 @@ source "$DIR/../venv-activate.sh" -q
55
56 # Invoke the individual skill tester
57 if [ "$#" -eq 0 ] ; then
58- python -m test.integrationtests.skills.runner .
59+ python3 -m test.integrationtests.skills.runner .
60 else
61- python -m test.integrationtests.skills.runner $@
62+ python3 -m test.integrationtests.skills.runner $@
63 fi
64\ No newline at end of file
65diff --git a/bin/mycroft-speak b/bin/mycroft-speak
66index 51facf29189..c65556f1173 100755
67--- a/bin/mycroft-speak
68+++ b/bin/mycroft-speak
69@@ -22,4 +22,4 @@ DIR="$( pwd )"
70 source "$DIR/../venv-activate.sh" -q
71
72 # Send a message to be spoken
73-output=$(python -m mycroft.messagebus.send "speak" "{\"utterance\": \"$@\"}")
74\ No newline at end of file
75+output=$(python3 -m mycroft.messagebus.send "speak" "{\"utterance\": \"$@\"}")
76\ No newline at end of file
77diff --git a/dev_setup.sh b/dev_setup.sh
78index aed54b2167a..dd391181f19 100755
79--- a/dev_setup.sh
80+++ b/dev_setup.sh
81@@ -48,7 +48,7 @@ param=""
82
83 for var in "$@" ; do
84 # Check if parameter should be read
85- if [[ ${param} == "python" ]] ; then
86+ if [[ ${param} == "python3" ]] ; then
87 opt_python=${var}
88 param=""
89 continue
90@@ -351,17 +351,17 @@ if [ -z ${INSTALL_PRECOMMIT_HOOK} ] ; then
91 HOOK_FILE="./.git/hooks/pre-commit"
92 if [ ! -f ${HOOK_FILE} ] || grep -q "MYCROFT DEV SETUP" ${HOOK_FILE} ; then
93 echo "Installing PEP8 check as precommit-hook"
94- echo "#! $( which python )" > ${HOOK_FILE}
95+ echo "#! $( which python3 )" > ${HOOK_FILE}
96 echo "# MYCROFT DEV SETUP" >> ${HOOK_FILE}
97 cat ./scripts/pre-commit >> ${HOOK_FILE}
98 chmod +x ${HOOK_FILE}
99 fi
100 fi
101
102-PYTHON=$( python -c "import sys;print('python{}.{}'.format(sys.version_info[0], sys.version_info[1]))" )
103+PYTHON=$( python3 -c "import sys;print('python{}.{}'.format(sys.version_info[0], sys.version_info[1]))" )
104
105 # install required python modules
106-if ! pip install -r requirements.txt ; then
107+if ! pip3 install -r requirements.txt ; then
108 echo "Warning: Failed to install all requirements. Continue? y/N"
109 read -n1 continue
110 if [[ "$continue" != "y" ]] ; then
111@@ -369,7 +369,7 @@ if ! pip install -r requirements.txt ; then
112 fi
113 fi
114
115-if ! pip install -r test-requirements.txt ; then
116+if ! pip3 install -r test-requirements.txt ; then
117 echo "Warning test requirements wasn't installed, Note: normal operation should still work fine..."
118 fi
119
120diff --git a/scripts/install-pocketsphinx.sh b/scripts/install-pocketsphinx.sh
121index 44d329b7985..d45f5c22747 100755
122--- a/scripts/install-pocketsphinx.sh
123+++ b/scripts/install-pocketsphinx.sh
124@@ -47,7 +47,7 @@ function install_pocketsphinx() {
125
126 # build and install pocketsphinx python bindings
127 cd ${TOP}/pocketsphinx-python
128- python setup.py install
129+ python3 setup.py install
130 }
131
132 if [ "$1" = "-q" ] ; then
133--
1342.21.0
135