File fix-installation-paths.patch of Package mycroft-core
From: Antonio Larrosa <larrosa@kde.org>
Subject: Use system python modules and user's mycroft.conf
This introduces a number of changes:
* Don't use python's virtualenv, but the system python packages
* Add 'use_virtualenvwrapper' config parameter
* Make ~/.mycroft/mycroft.conf have priority over /etc/mycroft/mycroft.conf
* Add a get_config_value function to read config options
* When installing a skill, instead of using pip to install the requirements,
write requirements.txt to a log file which the user can test manually
(at ~/.mycroft/mycroft-python-modules.log).
* Write schedule_file to ~/.mycroft/schedule.json instead of under /opt
* Write cache file to ~/.mycroft/web_config_cache.json instead of under /opt
* Install skills to ~/.mycroft/skills
Index: mycroft-core-release-v18.8.4/start-mycroft.sh
===================================================================
--- mycroft-core-release-v18.8.4.orig/start-mycroft.sh
+++ mycroft-core-release-v18.8.4/start-mycroft.sh
@@ -20,7 +20,9 @@ script=${0}
script=${script##*/}
cd -P "$( dirname "$SOURCE" )"
DIR="$( pwd )"
-VIRTUALENV_ROOT=${VIRTUALENV_ROOT:-"${DIR}/.venv"}
+#logs_dir="/var/logs/mycroft-core"
+#mkdir -p ${logs_dir}
+#chown mycroft-core:mycroft-core ${logs_dir}
function help() {
echo "${script}: Mycroft command/service launcher"
@@ -85,8 +87,7 @@ first_time=true
function launch-process() {
if ($first_time) ; then
echo "Initializing..."
- "${DIR}/scripts/prepare-msm.sh"
- source-venv
+# "${DIR}/scripts/prepare-msm.sh"
first_time=false
fi
@@ -100,8 +101,7 @@ function launch-process() {
function launch-background() {
if ($first_time) ; then
echo "Initializing..."
- "${DIR}/scripts/prepare-msm.sh"
- source-venv
+# "${DIR}/scripts/prepare-msm.sh"
first_time=false
fi
Index: mycroft-core-release-v18.8.4/stop-mycroft.sh
===================================================================
--- mycroft-core-release-v18.8.4.orig/stop-mycroft.sh
+++ mycroft-core-release-v18.8.4/stop-mycroft.sh
@@ -18,7 +18,6 @@ SOURCE="${BASH_SOURCE[0]}"
script=${0}
script=${script##*/}
-cd -P "$( dirname "$SOURCE" )"
function help() {
echo "${script}: Mycroft service stopper"
Index: mycroft-core-release-v18.8.4/mycroft/configuration/mycroft.conf
===================================================================
--- mycroft-core-release-v18.8.4.orig/mycroft/configuration/mycroft.conf
+++ mycroft-core-release-v18.8.4/mycroft/configuration/mycroft.conf
@@ -196,7 +196,10 @@
"update": true,
// Run a self test at bootup?
- "test": false
+ "test": false,
+
+ // use virtualenvwrapper (or if false, just use the system python modules)
+ "use_virtualenvwrapper": true
},
// Level of logs to store, one of "CRITICAL", "ERROR", "WARNGIN", "INFO", "DEBUG"
@@ -238,6 +241,8 @@
// Engine. Options: "mimic", "google", "marytts", "fatts", "espeak", "spdsay", "responsive_voice"
"module": "mimic",
"mimic": {
+ // Path to the mimic binary
+ "path": "/usr/bin/mimic",
"voice": "ap"
},
"mimic2": {
Index: mycroft-core-release-v18.8.4/mycroft/configuration/config.py
===================================================================
--- mycroft-core-release-v18.8.4.orig/mycroft/configuration/config.py
+++ mycroft-core-release-v18.8.4/mycroft/configuration/config.py
@@ -17,11 +17,12 @@
import re
import json
import inflection
-from os.path import exists, isfile
+from os.path import exists, isfile, join
from requests import RequestException
from mycroft.util.json_helper import load_commented_json, merge_dict
from mycroft.util.log import LOG
+from mycroft.filesystem import FileSystemAccess
from .locations import DEFAULT_CONFIG, SYSTEM_CONFIG, USER_CONFIG
@@ -134,7 +135,8 @@ class RemoteConf(LocalConf):
def __init__(self, cache=None):
super(RemoteConf, self).__init__(None)
- cache = cache or '/var/tmp/mycroft_web_cache.json'
+ if not cache:
+ cache = join(FileSystemAccess('cache').path, 'web_config_cache.json')
from mycroft.api import is_paired
if not is_paired():
self.load_local(cache)
Index: mycroft-core-release-v18.8.4/mycroft/tts/mimic_tts.py
===================================================================
--- mycroft-core-release-v18.8.4.orig/mycroft/tts/mimic_tts.py
+++ mycroft-core-release-v18.8.4/mycroft/tts/mimic_tts.py
@@ -40,7 +40,7 @@ if not os.path.isfile(BIN):
BIN = distutils.spawn.find_executable("mimic")
-SUBSCRIBER_VOICES = {'trinity': join(data_dir, 'voices/mimic_tn')}
+SUBSCRIBER_VOICES = {'trinity': '/usr/share/mycroft/voices/mimic_tn'}
def download_subscriber_voices(selected_voice):
Index: mycroft-core-release-v18.8.4/mycroft/version/__init__.py
===================================================================
--- mycroft-core-release-v18.8.4.orig/mycroft/version/__init__.py
+++ mycroft-core-release-v18.8.4/mycroft/version/__init__.py
@@ -37,8 +37,7 @@ CORE_VERSION_STR = '.'.join(map(str, COR
class VersionManager(object):
@staticmethod
def get():
- data_dir = expanduser(Configuration.get()['data_dir'])
- version_file = join(data_dir, 'version.json')
+ version_file = "/usr/share/mycroft/version.json"
if exists(version_file) and isfile(version_file):
try:
with open(version_file) as f: