aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorBart Ribbers <bribbers@disroot.org>2020-04-30 16:59:38 +0200
committerRasmus Thomsen <oss@cogitri.dev>2020-05-09 17:24:24 +0000
commit8758aac07d8a4f7c68531fbb759477aba2525418 (patch)
tree82140787c2df6be22092a2df9d5241085505cbdb /testing
parent50d68de6551d0c5bd2371206c71928d2a24a0162 (diff)
downloadaports-8758aac07d8a4f7c68531fbb759477aba2525418.tar.bz2
aports-8758aac07d8a4f7c68531fbb759477aba2525418.tar.xz
testing/mycroft-core: new aport
Diffstat (limited to 'testing')
-rw-r--r--testing/mycroft-core/0001-remove-xmlrunner-dep.patch24
-rw-r--r--testing/mycroft-core/0002-follow-xdg-for-skill-settings.patch204
-rw-r--r--testing/mycroft-core/0003-xdg.patch775
-rw-r--r--testing/mycroft-core/0004-relax-dep-requirements.patch33
-rw-r--r--testing/mycroft-core/0005-make-some-deps-optional.patch187
-rw-r--r--testing/mycroft-core/APKBUILD54
-rw-r--r--testing/mycroft-core/mycroft-core.post-install13
-rw-r--r--testing/mycroft-core/mycroft.conf6
8 files changed, 1296 insertions, 0 deletions
diff --git a/testing/mycroft-core/0001-remove-xmlrunner-dep.patch b/testing/mycroft-core/0001-remove-xmlrunner-dep.patch
new file mode 100644
index 0000000000..ba0b0201f0
--- /dev/null
+++ b/testing/mycroft-core/0001-remove-xmlrunner-dep.patch
@@ -0,0 +1,24 @@
+Upstream pull-request: https://github.com/MycroftAI/mycroft-core/pull/2571
+
+From 81a5025667b6c000e3f87c35d4357f28888c65f8 Mon Sep 17 00:00:00 2001
+From: Bart Ribbers <bribbers@disroot.org>
+Date: Wed, 6 May 2020 13:55:24 +0200
+Subject: [PATCH] Remove the xmlrunner dep from requirements.txt, it isn't
+ actually used anymore
+
+---
+ requirements.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/requirements.txt b/requirements.txt
+index d0c6cc1a5a7..d265e2e2fc4 100644
+--- a/requirements.txt
++++ b/requirements.txt
+@@ -8,7 +8,6 @@ tornado==6.0.3
+ websocket-client==0.54.0
+ requests-futures==0.9.5
+ pyalsaaudio==0.8.2
+-xmlrunner==1.7.7
+ pyserial==3.0
+ psutil==5.6.6
+ pocketsphinx==0.1.0
diff --git a/testing/mycroft-core/0002-follow-xdg-for-skill-settings.patch b/testing/mycroft-core/0002-follow-xdg-for-skill-settings.patch
new file mode 100644
index 0000000000..6caf837069
--- /dev/null
+++ b/testing/mycroft-core/0002-follow-xdg-for-skill-settings.patch
@@ -0,0 +1,204 @@
+Upstream pull-request: https://github.com/MycroftAI/mycroft-core/pull/2559
+
+diff --git a/mycroft/skills/mycroft_skill/mycroft_skill.py b/mycroft/skills/mycroft_skill/mycroft_skill.py
+index 4f3b6d9da6..d60a3279d0 100644
+--- a/mycroft/skills/mycroft_skill/mycroft_skill.py
++++ b/mycroft/skills/mycroft_skill/mycroft_skill.py
+@@ -21,8 +21,11 @@ import traceback
+ from itertools import chain
+ from os import walk
+ from os.path import join, abspath, dirname, basename, exists
++from pathlib import Path
+ from threading import Event, Timer
+
++from xdg import BaseDirectory
++
+ from adapt.intent import Intent, IntentBuilder
+
+ from mycroft import dialog
+@@ -113,6 +116,7 @@ class MycroftSkill:
+ bus (MycroftWebsocketClient): Optional bus connection
+ use_settings (bool): Set to false to not use skill settings at all
+ """
++
+ def __init__(self, name=None, bus=None, use_settings=True):
+ self.name = name or self.__class__.__name__
+ self.resting_name = None
+@@ -123,16 +127,6 @@ class MycroftSkill:
+ #: Member variable containing the absolute path of the skill's root
+ #: directory. E.g. /opt/mycroft/skills/my-skill.me/
+ self.root_dir = dirname(abspath(sys.modules[self.__module__].__file__))
+- if use_settings:
+- self.settings = get_local_settings(self.root_dir, self.name)
+- self._initial_settings = deepcopy(self.settings)
+- else:
+- self.settings = None
+-
+- #: Set to register a callback method that will be called every time
+- #: the skills settings are updated. The referenced method should
+- #: include any logic needed to handle the updated settings.
+- self.settings_change_callback = None
+
+ self.gui = SkillGUI(self)
+
+@@ -141,6 +135,19 @@ class MycroftSkill:
+ self.bind(bus)
+ #: Mycroft global configuration. (dict)
+ self.config_core = Configuration.get()
++
++ self.settings = None
++ self.settings_write_path = None
++ self.settings_read_path = None
++
++ if use_settings:
++ self._init_settings()
++
++ #: Set to register a callback method that will be called every time
++ #: the skills settings are updated. The referenced method should
++ #: include any logic needed to handle the updated settings.
++ self.settings_change_callback = None
++
+ self.dialog_renderer = None
+
+ #: Filesystem access to skill specific folder.
+@@ -157,6 +164,42 @@ class MycroftSkill:
+ self.event_scheduler = EventSchedulerInterface(self.name)
+ self.intent_service = IntentServiceInterface()
+
++ def _init_settings(self):
++ """Setup skill settings."""
++
++ # To not break existing setups,
++ # save to skill directory if the file exists already
++ self.settings_write_path = Path(self.root_dir)
++
++ # Otherwise save to XDG_CONFIG_DIR
++ if not self.settings_write_path.joinpath('settings.json').exists():
++ self.settings_write_path = Path(BaseDirectory.save_config_path(
++ 'mycroft', 'skills', basename(self.root_dir)))
++
++ # To not break existing setups,
++ # read from skill directory if the settings file exists there
++ self.settings_read_path = Path(self.root_dir)
++
++ # Then, check XDG_CONFIG_DIR
++ if not self.settings_read_path.joinpath('settings.json').exists():
++ for dir in BaseDirectory.load_config_paths('mycroft',
++ 'skills',
++ basename(
++ self.root_dir)):
++ path = Path(dir)
++ #: If there is a settings file here, use it
++ if path.joinpath('settings.json').exists():
++ self.settings_read_path = path
++ break
++
++ # Lastly, check /etc/mycroft
++ if not self.settings_read_path.joinpath('settings.json').exists():
++ self.settings_read_path = Path(
++ '/etc/mycroft/skills/').joinpath(basename(self.root_dir))
++
++ self.settings = get_local_settings(self.settings_read_path, self.name)
++ self._initial_settings = deepcopy(self.settings)
++
+ @property
+ def enclosure(self):
+ if self._enclosure:
+@@ -271,7 +314,7 @@ class MycroftSkill:
+ if remote_settings is not None:
+ LOG.info('Updating settings for skill ' + self.name)
+ self.settings.update(**remote_settings)
+- save_settings(self.root_dir, self.settings)
++ save_settings(self.settings_write_path, self.settings)
+ if self.settings_change_callback is not None:
+ self.settings_change_callback()
+
+@@ -544,7 +587,7 @@ class MycroftSkill:
+
+ if not voc or not exists(voc):
+ raise FileNotFoundError(
+- 'Could not find {}.voc file'.format(voc_filename))
++ 'Could not find {}.voc file'.format(voc_filename))
+ # load vocab and flatten into a simple list
+ vocab = read_vocab_file(voc)
+ self.voc_match_cache[cache_key] = list(chain(*vocab))
+@@ -811,7 +854,7 @@ class MycroftSkill:
+ """Store settings and indicate that the skill handler has completed
+ """
+ if self.settings != self._initial_settings:
+- save_settings(self.root_dir, self.settings)
++ save_settings(self.settings_write_path, self.settings)
+ self._initial_settings = self.settings
+ if handler_info:
+ msg_type = handler_info + '.complete'
+@@ -1233,7 +1276,7 @@ class MycroftSkill:
+
+ # Store settings
+ if self.settings != self._initial_settings:
+- save_settings(self.root_dir, self.settings)
++ save_settings(self.settings_write_path, self.settings)
+
+ if self.settings_meta:
+ self.settings_meta.stop()
+diff --git a/mycroft/skills/settings.py b/mycroft/skills/settings.py
+index c210625f5b..f576b34c9e 100644
+--- a/mycroft/skills/settings.py
++++ b/mycroft/skills/settings.py
+@@ -93,18 +93,22 @@ def get_local_settings(skill_dir, skill_name) -> dict:
+ def save_settings(skill_dir, skill_settings):
+ """Save skill settings to file."""
+ settings_path = Path(skill_dir).joinpath('settings.json')
+- if Path(skill_dir).exists():
+- with open(str(settings_path), 'w') as settings_file:
+- try:
+- json.dump(skill_settings, settings_file)
+- except Exception:
+- LOG.exception('error saving skill settings to '
+- '{}'.format(settings_path))
+- else:
+- LOG.info('Skill settings successfully saved to '
+- '{}' .format(settings_path))
+- else:
+- LOG.info('Skill folder no longer exists, can\'t save settings.')
++
++ # Either the file already exists in /opt, or we are writing
++ # to XDG_CONFIG_DIR and always have the permission to make
++ # sure the file always exists
++ if not Path(settings_path).exists():
++ settings_path.touch(mode=0o644)
++
++ with open(str(settings_path), 'w') as settings_file:
++ try:
++ json.dump(skill_settings, settings_file)
++ except Exception:
++ LOG.exception('error saving skill settings to '
++ '{}'.format(settings_path))
++ else:
++ LOG.info('Skill settings successfully saved to '
++ '{}' .format(settings_path))
+
+
+ def get_display_name(skill_name: str):
+diff --git a/mycroft/skills/skill_loader.py b/mycroft/skills/skill_loader.py
+index 2402740188..b7e8186967 100644
+--- a/mycroft/skills/skill_loader.py
++++ b/mycroft/skills/skill_loader.py
+@@ -259,7 +259,8 @@ class SkillLoader:
+ if first_run:
+ LOG.info("First run of " + self.skill_id)
+ self.instance.settings["__mycroft_skill_firstrun"] = False
+- save_settings(self.skill_directory, self.instance.settings)
++ save_settings(self.instance.settings_write_path,
++ self.instance.settings)
+ intro = self.instance.get_intro_message()
+ if intro:
+ self.instance.speak(intro)
+diff --git a/requirements.txt b/requirements.txt
+index 509436fb89..c9358db687 100644
+--- a/requirements.txt
++++ b/requirements.txt
+@@ -30,3 +30,4 @@ fann2==1.0.7
+ padaos==0.1.9
+ precise-runner==0.2.1
+ petact==0.1.2
++pyxdg==0.26
diff --git a/testing/mycroft-core/0003-xdg.patch b/testing/mycroft-core/0003-xdg.patch
new file mode 100644
index 0000000000..d041b6f938
--- /dev/null
+++ b/testing/mycroft-core/0003-xdg.patch
@@ -0,0 +1,775 @@
+Upstream pull-request: https://github.com/MycroftAI/mycroft-core/pull/2578
+
+diff --git a/README.md b/README.md
+index 1665b0a68dd..eaf04259ddb 100644
+--- a/README.md
++++ b/README.md
+@@ -71,20 +71,20 @@ Mycroft is nothing without skills. There are a handful of default skills that a
+
+ ## Pairing Information
+ Pairing information generated by registering with Home is stored in:
+-`~/.mycroft/identity/identity2.json` <b><-- DO NOT SHARE THIS WITH OTHERS!</b>
++`~/.config/mycroft/identity/identity2.json` <b><-- DO NOT SHARE THIS WITH OTHERS!</b>
+
+ ## Configuration
+ Mycroft configuration consists of 4 possible locations:
+-- `mycroft-core/mycroft/configuration/mycroft.conf`(Defaults)
++- `mycroft-core/mycroft/configuration/mycroft.conf` (Defaults)
+ - [Mycroft Home](https://home.mycroft.ai) (Remote)
+-- `/etc/mycroft/mycroft.conf`(Machine)
+-- `$HOME/.mycroft/mycroft.conf`(User)
++- `/etc/mycroft/mycroft.conf` (Machine)
++- `$XDG_CONFIG_DIR/mycroft/mycroft.conf` (which is by default `$HOME/.config/mycroft/mycroft.conf`) (USER)
+
+ When the configuration loader starts, it looks in these locations in this order, and loads ALL configurations. Keys that exist in multiple configuration files will be overridden by the last file to contain the value. This process results in a minimal amount being written for a specific device and user, without modifying default distribution files.
+
+ ## Using Mycroft Without Home
+
+-If you do not wish to use the Mycroft Home service, before starting Mycroft for the first time, create `$HOME/.mycroft/mycroft.conf` with the following contents:
++If you do not wish to use the Mycroft Home service, before starting Mycroft for the first time, create `$HOME/.config/mycroft/mycroft.conf` with the following contents:
+
+ ```
+ {
+diff --git a/bin/mycroft-config b/bin/mycroft-config
+index a1271b328df..435ceb607d8 100755
+--- a/bin/mycroft-config
++++ b/bin/mycroft-config
+@@ -95,13 +95,13 @@ function validate_config_file() {
+ return $result
+ }
+
+-_conf_file="~/.mycroft/mycroft.conf"
++_conf_file="~/.config/mycroft/mycroft.conf"
+ function name_to_path() {
+ case ${1} in
+ "system") _conf_file="/etc/mycroft/mycroft.conf" ;;
+- "user") _conf_file=$(readlink -f ~/.mycroft/mycroft.conf) ;;
++ "user") _conf_file=$(readlink -f ~/.config/mycroft/mycroft.conf) ;;
+ "default") _conf_file="$DIR/../mycroft/configuration/mycroft.conf" ;;
+- "remote") _conf_file="/var/tmp/mycroft_web_cache.json" ;;
++ "remote") _conf_file="~/.cache/mycroft/web_cache.json" ;;
+
+ *)
+ echo "ERROR: Unknown name '${1}'."
+diff --git a/mycroft/api/__init__.py b/mycroft/api/__init__.py
+index 43663ee1270..d2843120ef4 100644
+--- a/mycroft/api/__init__.py
++++ b/mycroft/api/__init__.py
+@@ -20,8 +20,6 @@ import requests
+ from requests import HTTPError, RequestException
+
+ from mycroft.configuration import Configuration
+-from mycroft.configuration.config import DEFAULT_CONFIG, SYSTEM_CONFIG, \
+- USER_CONFIG
+ from mycroft.identity import IdentityManager, identity_lock
+ from mycroft.version import VersionManager
+ from mycroft.util import get_arch, connected, LOG
+@@ -49,12 +47,9 @@ class Api:
+ def __init__(self, path):
+ self.path = path
+
+- # Load the config, skipping the REMOTE_CONFIG since we are
++ # Load the config, skipping the remote config since we are
+ # getting the info needed to get to it!
+- config = Configuration.get([DEFAULT_CONFIG,
+- SYSTEM_CONFIG,
+- USER_CONFIG],
+- cache=False)
++ config = Configuration.get(cache=False, remote=False)
+ config_server = config.get("server")
+ self.url = config_server.get("url")
+ self.version = config_server.get("version")
+@@ -238,9 +233,7 @@ class DeviceApi(Api):
+ platform_build = ""
+
+ # load just the local configs to get platform info
+- config = Configuration.get([SYSTEM_CONFIG,
+- USER_CONFIG],
+- cache=False)
++ config = Configuration.get(cache=False, remote=False)
+ if "enclosure" in config:
+ platform = config.get("enclosure").get("platform", "unknown")
+ platform_build = config.get("enclosure").get("platform_build", "")
+@@ -262,9 +255,7 @@ class DeviceApi(Api):
+ platform_build = ""
+
+ # load just the local configs to get platform info
+- config = Configuration.get([SYSTEM_CONFIG,
+- USER_CONFIG],
+- cache=False)
++ config = Configuration.get(cache=False, remote=False)
+ if "enclosure" in config:
+ platform = config.get("enclosure").get("platform", "unknown")
+ platform_build = config.get("enclosure").get("platform_build", "")
+diff --git a/mycroft/client/enclosure/__main__.py b/mycroft/client/enclosure/__main__.py
+index 20cb41aaac2..fdcadf08411 100644
+--- a/mycroft/client/enclosure/__main__.py
++++ b/mycroft/client/enclosure/__main__.py
+@@ -17,7 +17,7 @@
+ This provides any "enclosure" specific functionality, for example GUI or
+ control over the Mark-1 Faceplate.
+ """
+-from mycroft.configuration import LocalConf, SYSTEM_CONFIG
++from mycroft.configuration import Configuration
+ from mycroft.util.log import LOG
+ from mycroft.util import (create_daemon, wait_for_exit_signal,
+ reset_sigint_handler)
+@@ -59,8 +59,8 @@ def main():
+ only the GUI bus will be started.
+ """
+ # Read the system configuration
+- system_config = LocalConf(SYSTEM_CONFIG)
+- platform = system_config.get("enclosure", {}).get("platform")
++ config = Configuration.get(remote=False)
++ platform = config.get("enclosure", {}).get("platform")
+
+ enclosure = create_enclosure(platform)
+ if enclosure:
+diff --git a/mycroft/client/enclosure/mark1/__init__.py b/mycroft/client/enclosure/mark1/__init__.py
+index 26a7311c791..c02566d3435 100644
+--- a/mycroft/client/enclosure/mark1/__init__.py
++++ b/mycroft/client/enclosure/mark1/__init__.py
+@@ -15,8 +15,10 @@
+ import subprocess
+ import time
+ import sys
++import os
+ from alsaaudio import Mixer
+ from threading import Thread, Timer
++from xdg import BaseDirectory
+
+ import serial
+
+@@ -29,7 +31,7 @@ from mycroft.client.enclosure.mark1.eyes import EnclosureEyes
+ from mycroft.client.enclosure.mark1.mouth import EnclosureMouth
+ from mycroft.enclosure.display_manager import \
+ init_display_manager_bus_connection
+-from mycroft.configuration import Configuration, LocalConf, USER_CONFIG
++from mycroft.configuration import Configuration, LocalConf
+ from mycroft.messagebus.message import Message
+ from mycroft.util import play_wav, create_signal, connected, check_for_signal
+ from mycroft.util.audio_test import record
+@@ -163,6 +165,9 @@ class EnclosureReader(Thread):
+ if "unit.factory-reset" in data:
+ self.bus.emit(Message("speak", {
+ 'utterance': mycroft.dialog.get("reset to factory defaults")}))
++ subprocess.call(
++ 'rm ~/.config/mycroft/identity/identity2.json',
++ shell=True)
+ subprocess.call(
+ 'rm ~/.mycroft/identity/identity2.json',
+ shell=True)
+@@ -193,7 +198,8 @@ class EnclosureReader(Thread):
+
+ LOG.info("Setting opt_in to: " + word)
+ new_config = {'opt_in': enable}
+- user_config = LocalConf(USER_CONFIG)
++ user_config = LocalConf(os.path.join(
++ BaseDirectory.save_config_path('mycroft'), 'mycroft.conf'))
+ user_config.merge(new_config)
+ user_config.store()
+
+diff --git a/mycroft/client/speech/hotword_factory.py b/mycroft/client/speech/hotword_factory.py
+index 32011be0095..f5d7d336026 100644
+--- a/mycroft/client/speech/hotword_factory.py
++++ b/mycroft/client/speech/hotword_factory.py
+@@ -26,10 +26,11 @@ from os.path import dirname, exists, join, abspath, expanduser, isfile, isdir
+ from shutil import rmtree
+ from threading import Timer, Event, Thread
+ from urllib.error import HTTPError
++from xdg import BaseDirectory
+
+ from petact import install_package
+
+-from mycroft.configuration import Configuration, LocalConf, USER_CONFIG
++from mycroft.configuration import Configuration, LocalConf
+ from mycroft.util.log import LOG
+
+ RECOGNIZER_DIR = join(abspath(dirname(__file__)), "recognizer")
+@@ -137,7 +138,17 @@ class PreciseHotword(HotWordEngine):
+ from precise_runner import (
+ PreciseRunner, PreciseEngine, ReadWriteStream
+ )
+- local_conf = LocalConf(USER_CONFIG)
++
++ old_path = join(expanduser('~'), './mycroft/mycroft.conf')
++ if isfile(old_path):
++ local_conf = old_path
++ else:
++ for dir in BaseDirectory.load_config_paths('mycroft'):
++ local_conf = LocalConf(join(dir, 'mycroft.conf'))
++ # If the current config contains the precise key use it,
++ # otherwise continue to the next file
++ if local_conf.get('precise', None) is not None:
++ break
+ if (local_conf.get('precise', {}).get('dist_url') ==
+ 'http://bootstrap.mycroft.ai/artifacts/static/daily/'):
+ del local_conf['precise']['dist_url']
+@@ -195,7 +206,10 @@ class PreciseHotword(HotWordEngine):
+
+ @property
+ def folder(self):
+- return join(expanduser('~'), '.mycroft', 'precise')
++ old_path = join(expanduser('~'), '.mycroft', 'precise')
++ if os.path.isdir(old_path):
++ return old_path
++ return join(BaseDirectory.save_data_path('mycroft', 'precise'))
+
+ @property
+ def install_destination(self):
+@@ -305,8 +319,23 @@ class SnowboyHotWord(HotWordEngine):
+ class PorcupineHotWord(HotWordEngine):
+ def __init__(self, key_phrase="hey mycroft", config=None, lang="en-us"):
+ super(PorcupineHotWord, self).__init__(key_phrase, config, lang)
++
++ xdg_data_path = None
++
++ # Use the old path if available
++ old_path = join(expanduser('~'), '.mycroft', 'Porcupine')
++ if os.path.isdir(old_path):
++ xdg_data_path = old_path
++
++ # Otherwise use the new XDG config dirs
++ if xdg_data_path is None:
++ for dir in BaseDirectory.load_data_paths('mycroft', 'Porcupine'):
++ if os.path.isdir(dir):
++ xdg_data_path = dir
++ break
++
+ porcupine_path = expanduser(self.config.get(
+- "porcupine_path", join('~', '.mycroft', 'Porcupine')))
++ "porcupine_path", xdg_data_path))
+ keyword_file_paths = [expanduser(x.strip()) for x in self.config.get(
+ "keyword_file_path", "hey_mycroft.ppn").split(',')]
+ sensitivities = self.config.get("sensitivities", 0.5)
+diff --git a/mycroft/client/text/text_client.py b/mycroft/client/text/text_client.py
+index 44d11d61087..734e14ca83f 100644
+--- a/mycroft/client/text/text_client.py
++++ b/mycroft/client/text/text_client.py
+@@ -15,6 +15,7 @@
+ import sys
+ import io
+ from math import ceil
++from xdg import BaseDirectory
+
+ from .gui_server import start_qml_gui
+
+@@ -142,8 +143,7 @@ def handleNonAscii(text):
+ ##############################################################################
+ # Settings
+
+-config_file = os.path.join(os.path.expanduser("~"), ".mycroft_cli.conf")
+-
++filename = "mycroft_cli.conf"
+
+ def load_mycroft_config(bus):
+ """ Load the mycroft config and connect it to updates over the messagebus.
+@@ -171,6 +171,25 @@ def load_settings():
+ global max_log_lines
+ global show_meter
+
++ config_file = None
++
++ # Old location
++ path = os.path.join(os.path.expanduser("~"), ".mycroft_cli.conf")
++ if os.path.isfile(path):
++ config_file = path
++
++ # Check XDG_CONFIG_DIR
++ if config_file is None:
++ for dir in BaseDirectory.load_config_paths('mycroft'):
++ file = os.path.join(dir, filename)
++ if os.path.isfile(file):
++ config_file = file
++ break
++
++ # Check /etc/mycroft
++ if config_file is None:
++ config_file = os.path.join("/etc/mycroft", filename)
++
+ try:
+ with io.open(config_file, 'r') as f:
+ config = json.load(f)
+@@ -195,7 +214,11 @@ def save_settings():
+ config["cy_chat_area"] = cy_chat_area
+ config["show_last_key"] = show_last_key
+ config["max_log_lines"] = max_log_lines
+- config["show_meter"] = show_meter
++ config["show_meter"] = show_meteri
++
++ config_file = os.path.join(
++ BaseDirectory.save_config_path("mycroft"), filename)
++
+ with io.open(config_file, 'w') as f:
+ f.write(str(json.dumps(config, ensure_ascii=False)))
+
+diff --git a/mycroft/configuration/__init__.py b/mycroft/configuration/__init__.py
+index da28826c11d..b920d9c8336 100644
+--- a/mycroft/configuration/__init__.py
++++ b/mycroft/configuration/__init__.py
+@@ -13,4 +13,3 @@
+ # limitations under the License.
+ #
+ from .config import Configuration, LocalConf, RemoteConf
+-from .locations import SYSTEM_CONFIG, USER_CONFIG
+diff --git a/mycroft/configuration/config.py b/mycroft/configuration/config.py
+index 4322dfdb92f..fee89e9ad91 100644
+--- a/mycroft/configuration/config.py
++++ b/mycroft/configuration/config.py
+@@ -17,15 +17,13 @@
+ import re
+ import json
+ import inflection
+-from os.path import exists, isfile
++from os.path import exists, isfile, join, expanduser, dirname
+ from requests import RequestException
++from xdg import BaseDirectory
+
+ from mycroft.util.json_helper import load_commented_json, merge_dict
+ from mycroft.util.log import LOG
+
+-from .locations import (DEFAULT_CONFIG, SYSTEM_CONFIG, USER_CONFIG,
+- WEB_CONFIG_CACHE)
+-
+
+ def is_remote_list(values):
+ ''' check if this list corresponds to a backend formatted collection of
+@@ -135,7 +133,8 @@ class RemoteConf(LocalConf):
+ def __init__(self, cache=None):
+ super(RemoteConf, self).__init__(None)
+
+- cache = cache or WEB_CONFIG_CACHE
++ cache = cache or join(BaseDirectory.save_cache_path('mycroft'),
++ 'web_cache.json')
+ from mycroft.api import is_paired
+ if not is_paired():
+ self.load_local(cache)
+@@ -180,7 +179,7 @@ class Configuration:
+ __patch = {} # Patch config that skills can update to override config
+
+ @staticmethod
+- def get(configs=None, cache=True):
++ def get(configs=None, cache=True, remote=True):
+ """
+ Get configuration, returns cached instance if available otherwise
+ builds a new configuration dict.
+@@ -188,27 +187,55 @@ class Configuration:
+ Args:
+ configs (list): List of configuration dicts
+ cache (boolean): True if the result should be cached
++ remote (boolean): False if the Mycroft Home settings shouldn't
++ be loaded
+ """
+ if Configuration.__config:
+ return Configuration.__config
+ else:
+- return Configuration.load_config_stack(configs, cache)
++ return Configuration.load_config_stack(configs, cache, remote)
+
+ @staticmethod
+- def load_config_stack(configs=None, cache=False):
++ def load_config_stack(configs=None, cache=False, remote=True):
+ """
+ load a stack of config dicts into a single dict
+
+ Args:
+ configs (list): list of dicts to load
+ cache (boolean): True if result should be cached
++ remote (boolean): False if the Mycroft Home settings shouldn't
++ be loaded
+
+ Returns: merged dict of all configuration files
+ """
+ if not configs:
+- configs = [LocalConf(DEFAULT_CONFIG), RemoteConf(),
+- LocalConf(SYSTEM_CONFIG), LocalConf(USER_CONFIG),
+- Configuration.__patch]
++ # First use patched config
++ configs = [LocalConf(Configuration.__patch)]
++
++ # Then use XDG config
++ # This includes both the user config and
++ # /etc/xdg/mycroft/mycroft.conf
++ for dir in BaseDirectory.load_config_paths('mycroft'):
++ configs.append(LocalConf(join(dir, 'mycroft.conf')))
++
++ # Then check the old user config
++ old_path = join(expanduser('~'), '.mycroft/mycroft.conf')
++ if isfile(old_path):
++ configs.append(LocalConf(old_path))
++
++ # Then use remote config
++ if remote:
++ configs.append(RemoteConf())
++
++ # Then use /etc/mycroft/mycroft.conf
++ configs.append(LocalConf('/etc/mycroft/mycroft.conf'))
++
++ # Then use the config that comes with the package
++ configs.append(LocalConf(join(dirname(__file__), 'mycroft.conf')))
++
++ # Make sure we reverse the array, as merge_dict will put every new
++ # file on top of the previous one
++ configs = reversed(configs)
+ else:
+ # Handle strings in stack
+ for index, item in enumerate(configs):
+diff --git a/mycroft/configuration/locations.py b/mycroft/configuration/locations.py
+deleted file mode 100644
+index cbbaab6ca94..00000000000
+--- a/mycroft/configuration/locations.py
++++ /dev/null
+@@ -1,38 +0,0 @@
+-# Copyright 2018 Mycroft AI Inc.
+-#
+-# Licensed under the Apache License, Version 2.0 (the "License");
+-# you may not use this file except in compliance with the License.
+-# You may obtain a copy of the License at
+-#
+-# http://www.apache.org/licenses/LICENSE-2.0
+-#
+-# Unless required by applicable law or agreed to in writing, software
+-# distributed under the License is distributed on an "AS IS" BASIS,
+-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-# See the License for the specific language governing permissions and
+-# limitations under the License.
+-import os
+-from os.path import join, dirname, expanduser, exists
+-
+-DEFAULT_CONFIG = join(dirname(__file__), 'mycroft.conf')
+-SYSTEM_CONFIG = os.environ.get('MYCROFT_SYSTEM_CONFIG',
+- '/etc/mycroft/mycroft.conf')
+-USER_CONFIG = join(expanduser('~'), '.mycroft/mycroft.conf')
+-REMOTE_CONFIG = "mycroft.ai"
+-WEB_CONFIG_CACHE = os.environ.get('MYCROFT_WEB_CACHE',
+- '/var/tmp/mycroft_web_cache.json')
+-
+-
+-def __ensure_folder_exists(path):
+- """ Make sure the directory for the specified path exists.
+-
+- Arguments:
+- path (str): path to config file
+- """
+- directory = dirname(path)
+- if not exists(directory):
+- os.makedirs(directory)
+-
+-
+-__ensure_folder_exists(WEB_CONFIG_CACHE)
+-__ensure_folder_exists(USER_CONFIG)
+diff --git a/mycroft/configuration/mycroft.conf b/mycroft/configuration/mycroft.conf
+index b3e324eb553..798a88567cf 100644
+--- a/mycroft/configuration/mycroft.conf
++++ b/mycroft/configuration/mycroft.conf
+@@ -5,7 +5,7 @@
+ // overridden at the REMOTE level (set by the user via
+ // https://home.mycroft.ai), at the SYSTEM level (typically in the file
+ // '/etc/mycroft/mycroft.conf'), or at the USER level (typically in the
+- // file '~/.mycroft/mycroft.conf').
++ // file '~/.config/mycroft/mycroft.conf').
+ //
+ // The load order of settings is:
+ // DEFAULT
+@@ -107,7 +107,7 @@
+ },
+ "upload_skill_manifest": true,
+ // Directory to look for user skills
+- "directory": "~/.mycroft/skills",
++ "directory": "~/.local/share/mycroft/skills",
+ // Enable auto update by msm
+ "auto_update": true,
+ // blacklisted skills to not load
+@@ -210,7 +210,7 @@
+ "threshold": 1e-90,
+ "lang": "en-us"
+ // Specify custom model via:
+- // "local_model_file": "~/.mycroft/precise/models/something.pb"
++ // "local_model_file": "~/.local/share/mycroft/precise/models/something.pb"
+ // Precise options:
+ // "sensitivity": 0.5, // Higher = more sensitive
+ // "trigger_level": 3 // Higher = more delay & less sensitive
+@@ -303,7 +303,7 @@
+ },
+
+ "padatious": {
+- "intent_cache": "~/.mycroft/intent_cache",
++ "intent_cache": "~/.local/share/mycroft/intent_cache",
+ "train_delay": 4,
+ "single_thread": false
+ },
+diff --git a/mycroft/filesystem/__init__.py b/mycroft/filesystem/__init__.py
+index 45ec15a4ac5..414069573f4 100644
+--- a/mycroft/filesystem/__init__.py
++++ b/mycroft/filesystem/__init__.py
+@@ -14,6 +14,7 @@
+ #
+ import os
+ from os.path import join, expanduser, isdir
++from xdg import BaseDirectory
+
+
+ class FileSystemAccess:
+@@ -30,7 +31,13 @@ class FileSystemAccess:
+ def __init_path(path):
+ if not isinstance(path, str) or len(path) == 0:
+ raise ValueError("path must be initialized as a non empty string")
+- path = join(expanduser('~'), '.mycroft', path)
++ old_path = join(expanduser('~'), '.mycroft', path)
++ if isdir(old_path):
++ path = old_path
++ else:
++ # Use save_config_path rather than load_first_config to make sure
++ # this directory exists and the skills don't have to deal with it
++ path = join(BaseDirectory.save_config_path('mycroft'), path)
+
+ if not isdir(path):
+ os.makedirs(path)
+diff --git a/mycroft/messagebus/send_func.py b/mycroft/messagebus/send_func.py
+index 403db9f45c1..a11a9b0a591 100644
+--- a/mycroft/messagebus/send_func.py
++++ b/mycroft/messagebus/send_func.py
+@@ -15,8 +15,6 @@
+ from websocket import create_connection
+
+ from mycroft.configuration import Configuration
+-from mycroft.configuration.locations import (DEFAULT_CONFIG, SYSTEM_CONFIG,
+- USER_CONFIG)
+ from mycroft.messagebus.client import MessageBusClient
+ from mycroft.messagebus.message import Message
+
+@@ -32,10 +30,7 @@ def send(message_to_send, data_to_send=None):
+ data_to_send = data_to_send or {}
+
+ # Calculate the standard Mycroft messagebus websocket address
+- config = Configuration.get([DEFAULT_CONFIG,
+- SYSTEM_CONFIG,
+- USER_CONFIG],
+- cache=False)
++ config = Configuration.get(cache=False, remote=False)
+ config = config.get("websocket")
+ url = MessageBusClient.build_url(
+ config.get("host"),
+diff --git a/mycroft/skills/event_scheduler.py b/mycroft/skills/event_scheduler.py
+index fe41ac1bedc..cb1c9f3c61d 100644
+--- a/mycroft/skills/event_scheduler.py
++++ b/mycroft/skills/event_scheduler.py
+@@ -20,6 +20,7 @@ import time
+ from datetime import datetime, timedelta
+ from threading import Thread, Lock
+ from os.path import isfile, join, expanduser
++from xdg import BaseDirectory
+
+ from mycroft.configuration import Configuration
+ from mycroft.messagebus.message import Message
+@@ -54,14 +55,19 @@ class EventScheduler(Thread):
+ """
+ def __init__(self, bus, schedule_file='schedule.json'):
+ super().__init__()
+- data_dir = expanduser(Configuration.get()['data_dir'])
+
+ self.events = {}
+ self.event_lock = Lock()
+
+ self.bus = bus
+ self.is_running = True
+- self.schedule_file = join(data_dir, schedule_file)
++ old_path = join(expanduser(Configuration.get()['data_dir']),
++ schedule_file)
++ if isfile(old_path):
++ self.schedule_file = old_path
++ else:
++ self.schedule_file = join(
++ BaseDirectory.load_first_config('mycroft'), schedule_file)
+ if self.schedule_file:
+ self.load()
+
+diff --git a/mycroft/skills/skill_updater.py b/mycroft/skills/skill_updater.py
+index 9535ad90319..bf373ba99f8 100644
+--- a/mycroft/skills/skill_updater.py
++++ b/mycroft/skills/skill_updater.py
+@@ -17,6 +17,7 @@ import os
+ import sys
+ from datetime import datetime
+ from time import time
++from xdg import BaseDirectory
+
+ from msm import MsmException
+
+@@ -91,9 +92,9 @@ class SkillUpdater:
+ '.mycroft-skills'
+ )
+ else:
+- self._installed_skills_file_path = os.path.expanduser(
+- '~/.mycroft/.mycroft-skills'
+- )
++ self._installed_skills_file_path = join(
++ BaseDirectory.save_data_path('mycroft',
++ '.mycroft-skills'))
+
+ return self._installed_skills_file_path
+
+diff --git a/mycroft/util/file_utils.py b/mycroft/util/file_utils.py
+index 84555fc3bb3..7c09fd226ee 100644
+--- a/mycroft/util/file_utils.py
++++ b/mycroft/util/file_utils.py
+@@ -22,6 +22,7 @@ import os
+ import psutil
+ from stat import S_ISREG, ST_MTIME, ST_MODE, ST_SIZE
+ import tempfile
++from xdg import BaseDirectory
+
+ import mycroft.configuration
+ from .log import LOG
+@@ -33,15 +34,15 @@ def resolve_resource_file(res_name):
+ Resource names are in the form: 'filename.ext'
+ or 'path/filename.ext'
+
+- The system wil look for ~/.mycroft/res_name first, and
+- if not found will look at /opt/mycroft/res_name,
+- then finally it will look for res_name in the 'mycroft/res'
+- folder of the source code package.
++ The system wil look for $XDG_DATA_DIRS/mycroft/res_name first
++ (defaults to ~/.local/share/mycroft/res_name), and if not found will
++ look at /opt/mycroft/res_name, then finally it will look for res_name
++ in the 'mycroft/res' folder of the source code package.
+
+ Example:
+ With mycroft running as the user 'bob', if you called
+ resolve_resource_file('snd/beep.wav')
+- it would return either '/home/bob/.mycroft/snd/beep.wav' or
++ it would return either '/home/bob/.local/share/mycroft/snd/beep.wav' or
+ '/opt/mycroft/snd/beep.wav' or '.../mycroft/res/snd/beep.wav',
+ where the '...' is replaced by the path where the package has
+ been installed.
+@@ -57,8 +58,14 @@ def resolve_resource_file(res_name):
+ if os.path.isfile(res_name):
+ return res_name
+
+- # Now look for ~/.mycroft/res_name (in user folder)
+- filename = os.path.expanduser("~/.mycroft/" + res_name)
++ # Now look for XDG_DATA_DIRS
++ for dir in BaseDirectory.load_data_paths('mycroft'):
++ filename = os.path.join(dir, res_name)
++ if os.path.isfile(filename):
++ return filename
++
++ # Now look in the old user location
++ filename = os.path.join(os.path.expanduser('~'), '.mycroft', res_name)
+ if os.path.isfile(filename):
+ return filename
+
+diff --git a/mycroft/util/log.py b/mycroft/util/log.py
+index 0ea391f8f79..788f6df1c37 100644
+--- a/mycroft/util/log.py
++++ b/mycroft/util/log.py
+@@ -21,7 +21,7 @@ This module provides the LOG pseudo function quickly creating a logger instance
+ for use.
+
+ The default log level of the logger created here can ONLY be set in
+-/etc/mycroft/mycroft.conf or ~/.mycroft/mycroft.conf
++/etc/mycroft/mycroft.conf or ~/.config/mycroft/mycroft.conf
+
+ The default log level can also be programatically be changed by setting the
+ LOG.level parameter.
+@@ -31,10 +31,10 @@ import inspect
+ import logging
+ import sys
+
+-from os.path import isfile
++from os.path import isfile, join
++from xdg import BaseDirectory
+
+ from mycroft.util.json_helper import load_commented_json, merge_dict
+-from mycroft.configuration.locations import SYSTEM_CONFIG, USER_CONFIG
+
+
+ def getLogger(name="MYCROFT"):
+@@ -84,7 +84,10 @@ class LOG:
+ # Check configs manually, the Mycroft configuration system can't be
+ # used since it uses the LOG system and would cause horrible cyclic
+ # dependencies.
+- confs = [SYSTEM_CONFIG, USER_CONFIG]
++ confs = []
++ for dir in BaseDirectory.load_config_paths('mycroft'):
++ confs.append(join(dir, 'mycroft.conf'))
++ confs.append('/etc/mycroft/mycroft.conf')
+ config = {}
+ for conf in confs:
+ try:
+diff --git a/test/unittests/skills/test_skill_updater.py b/test/unittests/skills/test_skill_updater.py
+index 38d4083d7f2..a1fda04fb3a 100644
+--- a/test/unittests/skills/test_skill_updater.py
++++ b/test/unittests/skills/test_skill_updater.py
+@@ -15,6 +15,7 @@
+ """Unit tests for the SkillUpdater class."""
+ from os import path
+ from time import sleep
++from xdg import BaseDirectory
+ from unittest.mock import Mock, patch, PropertyMock
+
+ from mycroft.skills.skill_updater import SkillUpdater
+@@ -143,7 +144,8 @@ class TestSkillUpdater(MycroftUnitTestBase):
+ os_patch.return_value = False
+ updater = SkillUpdater(self.message_bus_mock)
+ self.assertEqual(
+- path.expanduser('~/.mycroft/.mycroft-skills'),
++ join(BaseDirectory.save_data_path('mycroft'),
++ 'mycroft-skills'),
+ updater.installed_skills_file_path
+ )
+
+diff --git a/test/unittests/util/commented.json b/test/unittests/util/commented.json
+index 87c7d3e2c2d..00a581f6df4 100644
+--- a/test/unittests/util/commented.json
++++ b/test/unittests/util/commented.json
+@@ -54,7 +54,7 @@
+ }
+ },
+ "skills": {
+- "directory": "~/.mycroft/skills"
++ "directory": "~/.local/share/mycroft/skills"
+ },
+ "server": {
+ "url": "https://api.mycroft.ai",
+diff --git a/test/unittests/util/plain.json b/test/unittests/util/plain.json
+index f8c474139ce..eec84631d88 100644
+--- a/test/unittests/util/plain.json
++++ b/test/unittests/util/plain.json
+@@ -36,7 +36,7 @@
+ }
+ },
+ "skills": {
+- "directory": "~/.mycroft/skills"
++ "directory": "~/.local/share/mycroft/skills"
+ },
+ "server": {
+ "url": "https://api.mycroft.ai",
+diff --git a/test/unittests/util/test_file_utils.py b/test/unittests/util/test_file_utils.py
+index dcc4d72676c..e409f712950 100644
+--- a/test/unittests/util/test_file_utils.py
++++ b/test/unittests/util/test_file_utils.py
+@@ -33,7 +33,8 @@ class TestResolveResource(TestCase):
+
+ mock_isfile.side_effect = files_in_dotmycroft_exists
+ self.assertEqual(resolve_resource_file('1984.txt'),
+- expanduser('~/.mycroft/1984.txt'))
++ join(BaseDirectory.save_data_path('mycroft'),
++ '1984.txt'))
+
+ @mock.patch('os.path.isfile')
+ def test_data_dir(self, mock_isfile, mock_conf):
+diff --git a/test/util.py b/test/util.py
+index f80c0f9bd40..f657bdb8304 100644
+--- a/test/util.py
++++ b/test/util.py
+@@ -1,7 +1,7 @@
+-from mycroft.configuration.config import LocalConf, DEFAULT_CONFIG
++from mycroft.configuration.config import LocalConf
+ from copy import deepcopy
+
+-__config = LocalConf(DEFAULT_CONFIG)
++__config = LocalConf(join(dirname(__file__), 'mycroft.conf'))
+
+
+ # Base config to use when mocking
diff --git a/testing/mycroft-core/0004-relax-dep-requirements.patch b/testing/mycroft-core/0004-relax-dep-requirements.patch
new file mode 100644
index 0000000000..56b85a29c7
--- /dev/null
+++ b/testing/mycroft-core/0004-relax-dep-requirements.patch
@@ -0,0 +1,33 @@
+Upstream pull-request: https://github.com/MycroftAI/mycroft-core/pull/2562
+
+From 466d39fd4057ab17492877edd18131541cd88e15 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=85ke=20Forslund?= <ake.forslund@gmail.com>
+Date: Mon, 4 May 2020 09:28:48 +0200
+Subject: [PATCH] Allow building Mycroft with loose requirements
+
+---
+ setup.py | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/setup.py b/setup.py
+index c98f7b4f8f9..3d08cbbd943 100644
+--- a/setup.py
++++ b/setup.py
+@@ -13,6 +13,7 @@
+ # limitations under the License.
+ #
+ from setuptools import setup, find_packages
++import os
+ import os.path
+
+ BASEDIR = os.path.abspath(os.path.dirname(__file__))
+@@ -44,6 +45,9 @@ def required(requirements_file):
+ """ Read requirements file and remove comments and empty lines. """
+ with open(os.path.join(BASEDIR, requirements_file), 'r') as f:
+ requirements = f.read().splitlines()
++ if 'MYCROFT_LOOSE_REQUIREMENTS' in os.environ:
++ print('USING LOOSE REQUIREMENTS!')
++ requirements = [r.replace('==', '>=') for r in requirements]
+ return [pkg for pkg in requirements
+ if pkg.strip() and not pkg.startswith("#")]
+
diff --git a/testing/mycroft-core/0005-make-some-deps-optional.patch b/testing/mycroft-core/0005-make-some-deps-optional.patch
new file mode 100644
index 0000000000..c75a0fbd7d
--- /dev/null
+++ b/testing/mycroft-core/0005-make-some-deps-optional.patch
@@ -0,0 +1,187 @@
+Upstream pull-request: https://github.com/MycroftAI/mycroft-core/pull/2575
+
+diff --git a/.travis.yml b/.travis.yml
+index c01c851d87..a0b9ab2c1c 100644
+--- a/.travis.yml
++++ b/.travis.yml
+@@ -26,8 +26,6 @@ install:
+ - mkdir ${TMPDIR}
+ - echo ${TMPDIR}
+ - VIRTUALENV_ROOT=${VIRTUAL_ENV} ./dev_setup.sh
+- - pip install -r requirements.txt
+- - pip install -r test-requirements.txt
+ # command to run tests
+ script:
+ - pycodestyle mycroft test
+diff --git a/LICENSE.md b/LICENSE.md
+index b2719d2a5e..b882a785c0 100644
+--- a/LICENSE.md
++++ b/LICENSE.md
+@@ -208,4 +208,4 @@ Component licenses for mycroft-core:
+ The mycroft-core software references various Python Packages (via PIP),
+ each of which has a separate license. All are compatible with the
+ Apache 2.0 license. See the referenced packages listed in the
+-"requirements.txt" file for specific terms and conditions.
++"requirements/requirements.txt" file for specific terms and conditions.
+diff --git a/MANIFEST.in b/MANIFEST.in
+index 1888d6da7b..1708d5345f 100644
+--- a/MANIFEST.in
++++ b/MANIFEST.in
+@@ -1,5 +1,5 @@
+ recursive-include mycroft/client/speech/recognizer/model *
+-include requirements.txt
++include requirements/requirements.txt
+ include mycroft/configuration/*.conf
+ recursive-include mycroft/res *
+ recursive-include mycroft/res/snd *
+diff --git a/dev_setup.sh b/dev_setup.sh
+index 3c59bc427b..f7f2d90009 100755
+--- a/dev_setup.sh
++++ b/dev_setup.sh
+@@ -495,16 +495,26 @@ if ! grep -q "$TOP" $VENV_PATH_FILE ; then
+ fi
+
+ # install required python modules
+-if ! pip install -r requirements.txt ; then
+- echo 'Warning: Failed to install all requirements. Continue? y/N'
++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
+
+-if ! pip install -r test-requirements.txt ; then
+- echo "Warning test requirements wasn't installed, Note: normal operation should still work fine..."
++# install optional python modules
++if ! pip install -r requirements/requirements-optional.txt ; then
++ echo 'Warning: Failed to install optional dependencies. Continue? y/N'
++ read -n1 continue
++ if [[ $continue != 'y' ]] ; then
++ exit 1
++ fi
++fi
++
++
++if ! pip install -r requirements/requirements-tests.txt ; then
++ echo "Warning: Test requirements failed to install. Note: normal operation should still work fine..."
+ fi
+
+ SYSMEM=$(free | awk '/^Mem:/ { print $2 }')
+@@ -563,4 +573,4 @@ if [[ ! -w /var/log/mycroft/ ]] ; then
+ fi
+
+ #Store a fingerprint of setup
+-md5sum requirements.txt test-requirements.txt dev_setup.sh > .installed
++md5sum requirements/requirements.txt requirements/requirements-optional.txt requirements/requirements-tests.txt dev_setup.sh > .installed
+diff --git a/mycroft/client/enclosure/generic/__init__.py b/mycroft/client/enclosure/generic/__init__.py
+index 6256498add..a86dda739c 100644
+--- a/mycroft/client/enclosure/generic/__init__.py
++++ b/mycroft/client/enclosure/generic/__init__.py
+@@ -15,7 +15,6 @@
+ import subprocess
+ import time
+ import sys
+-from alsaaudio import Mixer
+ from threading import Thread, Timer
+
+ import mycroft.dialog
+diff --git a/requirements/requirements-optional.txt b/requirements/requirements-optional.txt
+new file mode 100644
+index 0000000000..4a62dad731
+--- /dev/null
++++ b/requirements/requirements-optional.txt
+@@ -0,0 +1,4 @@
++pychromecast==3.2.2
++python-vlc==1.1.2
++pyalsaaudio==0.8.2
++google-api-python-client==1.6.4
+diff --git a/test-requirements.txt b/requirements/requirements-tests.txt
+similarity index 90%
+rename from test-requirements.txt
+rename to requirements/requirements-tests.txt
+index 874a0f130d..9e038123e5 100644
+--- a/test-requirements.txt
++++ b/requirements/requirements-tests.txt
+@@ -7,3 +7,5 @@ sphinx==2.2.1
+ sphinx-rtd-theme==0.4.3
+ git+https://github.com/behave/behave@v1.2.7.dev1
+ allure-behave==2.8.10
++
++python-vlc==1.1.2
+diff --git a/requirements.txt b/requirements/requirements.txt
+similarity index 83%
+rename from requirements.txt
+rename to requirements/requirements.txt
+index db2fa43738..f86a81b4bf 100644
+--- a/requirements.txt
++++ b/requirements/requirements.txt
+@@ -7,16 +7,12 @@ SpeechRecognition==3.8.1
+ tornado==6.0.3
+ websocket-client==0.54.0
+ requests-futures==0.9.5
+-pyalsaaudio==0.8.2
+ pyserial==3.0
+ psutil==5.6.6
+ pocketsphinx==0.1.0
+ inflection==0.3.1
+ pillow==7.1.2
+ python-dateutil==2.6.0
+-pychromecast==3.2.2
+-python-vlc==1.1.2
+-google-api-python-client==1.6.4
+ fasteners==0.14.1
+ PyYAML==5.1.2
+
+diff --git a/scripts/my-info.sh b/scripts/my-info.sh
+index a3b944308e..e395411120 100644
+--- a/scripts/my-info.sh
++++ b/scripts/my-info.sh
+@@ -144,7 +144,7 @@ function checkmimic() {
+ # pythoning!
+ function checkPIP() {
+ mlog "Python checks"
+- mlog " - Verifying ${MYCROFT_HOME}/requirements.txt:"
++ mlog " - Verifying ${MYCROFT_HOME}/requirements/requirements.txt:"
+ if workon mycroft ; then
+ pip list > /tmp/mycroft-piplist.$$
+
+diff --git a/setup.py b/setup.py
+index c98f7b4f8f..2e171d66b6 100644
+--- a/setup.py
++++ b/setup.py
+@@ -56,7 +56,9 @@ setup(
+ author_email='devs@mycroft.ai',
+ url='https://github.com/MycroftAI/mycroft-core',
+ description='Mycroft Core',
+- install_requires=required('requirements.txt'),
++ install_requires=required('requirements/requirements.txt'),
++ extras_requires=required('requirements/requirements-optional.txt'),
++ tests_requires=required('requirements/requirements-tests.txt'),
+ packages=find_packages(include=['mycroft*']),
+ include_package_data=True,
+
+diff --git a/test/Dockerfile.test b/test/Dockerfile.test
+index 87e3c85287..32554af019 100644
+--- a/test/Dockerfile.test
++++ b/test/Dockerfile.test
+@@ -64,12 +64,14 @@ RUN python3 -m venv "/opt/mycroft/mycroft-core/.venv"
+ # determine if any changes have been made since it last started
+ WORKDIR /opt/mycroft/mycroft-core
+ RUN .venv/bin/python -m pip install pip==20.0.2
+-COPY requirements.txt .
++COPY requirements/requirements.txt .
+ RUN .venv/bin/python -m pip install -r requirements.txt
+-COPY test-requirements.txt .
+-RUN .venv/bin/python -m pip install -r test-requirements.txt
++COPY requirements/requirements-optional.txt .
++RUN .venv/bin/python -m pip install -r requirements-optional.txt
++COPY requirements/requirements-tests.txt .
++RUN .venv/bin/python -m pip install -r requirements-tests.txt
+ COPY dev_setup.sh .
+-RUN md5sum requirements.txt test-requirements.txt dev_setup.sh > .installed
++RUN md5sum requirements.txt requirements-tests.txt requirements-optional.txt dev_setup.sh > .installed
+
+ # Add the mycroft core virtual environment to the system path.
+ ENV PATH /opt/mycroft/mycroft-core/.venv/bin:$PATH
diff --git a/testing/mycroft-core/APKBUILD b/testing/mycroft-core/APKBUILD
new file mode 100644
index 0000000000..fc16b4bc4d
--- /dev/null
+++ b/testing/mycroft-core/APKBUILD
@@ -0,0 +1,54 @@
+# Contributor: Bart Ribbers <bribbers@disroot.org>
+# Maintainer: Bart Ribbers <bribbers@disroot.org>
+pkgname=mycroft-core
+pkgver=20.2.3
+pkgrel=0
+pkgdesc="Mycroft Core, the Mycroft Artificial Intelligence platform"
+url="https://mycroft.ai/"
+# mips, mips64 and s390x blocked by py3-precise-runner
+# s390x blocked by mimic1
+arch="noarch !mips !mips64 !s390x"
+license="Apache-2.0"
+depends="python3 py3-six py3-requests py3-gtts py3-pyaudio py3-pyee py3-speechrecognition py3-tornado py3-websocket-client py3-requests-futures py3-serial py3-psutil py3-pocketsphinx py3-inflection py3-pillow py3-dateutil py3-fasteners py3-yaml py3-lingua-franca mycroft-skills-manager mycroft-skills-kit py3-adapt-parser py3-padatious py3-fann2 py3-padaos py3-precise-runner py3-petact py3-xdg mimic1"
+# These dependencies are required for their executables
+depends="$depends pulseaudio-utils mpg123 vorbis-tools"
+# Minimum skills required for functionality
+depends="$depends mycroft-skill-fallback-unknown mycroft-skill-pairing mycroft-skill-configuration"
+makedepends="py3-setuptools"
+checkdepends="py3-pytest py3-wheel py3-vlc"
+install="$pkgname.post-install"
+source="$pkgname-$pkgver.tar.gz::https://github.com/MycroftAI/mycroft-core/archive/release/v$pkgver.tar.gz
+ mycroft.conf
+ 0001-remove-xmlrunner-dep.patch
+ 0002-follow-xdg-for-skill-settings.patch
+ 0003-xdg.patch
+ 0004-relax-dep-requirements.patch
+ 0005-make-some-deps-optional.patch
+ "
+# Net is required for tests
+# Two tests are broken still
+# https://github.com/MycroftAI/mycroft-core/issues/2574
+options="!check"
+builddir="$srcdir/mycroft-core-release-v$pkgver"
+
+build() {
+ MYCROFT_LOOSE_REQUIREMENTS=1 python3 setup.py build
+}
+
+check() {
+ PYTHONPATH="$PWD/build/lib" pytest
+}
+
+package() {
+ MYCROFT_LOOSE_REQUIREMENTS=1 python3 setup.py install --prefix=/usr --root="$pkgdir"
+
+ install -Dm644 "$srcdir"/mycroft.conf "$pkgdir"/etc/mycroft/mycroft.conf
+}
+
+sha512sums="8c9464f32dea1c5b843725c4494be17a4ccd5c46af363d3fc695813a79c1100b033f3bbac5d5e490c6afb9d018de5418cd1e467766d2d190c74ba2902399eec9 mycroft-core-20.2.3.tar.gz
+c852bf37c3588a3f65f55b65af0e55440e13aeeaca522e7029a7326ec58c9cf053d14c7c3376a952b65512cabe3437ba6701f1e0e0e4971d6b5ada159bacd57a mycroft.conf
+d9b8fd8dc9e42937f2ec095c1ddee738073a9f9c64917a9793cadaad23504a7ae22e2e1420a2822ed915b4aae6fa5e5717ead97dc88f3045dd1bbb73b92eed4d 0001-remove-xmlrunner-dep.patch
+27148a19c2d5a4fd61c25850659e4edc95844c30eb1339243e939cf22aa9093d9d4e805d80a79174e257be1614ebd7be284163e3688b083c0704a1e4c9328f58 0002-follow-xdg-for-skill-settings.patch
+f1760d828a37d3abd50e9f26c983dc68277e12b181ff598e4d7d1447b3a965644039c4d5035b1adaf593cf6a4afd44bc85cd16929c2a553eca1125c21d3e2619 0003-xdg.patch
+fa0667bd4a9f8f9c17c353f1bf1899bf699d77968caca81b54d7aa89219b65b4f2630e07dd092a427221fc98c2f9e2890811f3f50c44fe783bbadb3725554898 0004-relax-dep-requirements.patch
+4d6fdc303e0f6ce73fc91cc680f7942c2a902540f090a3c27a2d9f51eecc704093fbba5fb11f25273c688317138959bf5cfb15bac6d5a20ce2be551a4f6c6ab5 0005-make-some-deps-optional.patch"
diff --git a/testing/mycroft-core/mycroft-core.post-install b/testing/mycroft-core/mycroft-core.post-install
new file mode 100644
index 0000000000..90c4336c55
--- /dev/null
+++ b/testing/mycroft-core/mycroft-core.post-install
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+cat <<EOF
+mycroft-core installs with the most basic skills required to get the package working.
+If you want all the official MycroftAI skills, consider installing the mycroft-skills meta package.
+
+Since there currently isn't a single end-point to start Mycroft, you'll need to run the following manually:
+- /usr/bin/mycroft-messagebus
+- /usr/bin/mycroft-audio
+- /usr/bin/mycroft-speech-client
+- /usr/bin/mycroft-skills
+- /usr/bin/mycroft-cli-client
+EOF
diff --git a/testing/mycroft-core/mycroft.conf b/testing/mycroft-core/mycroft.conf
new file mode 100644
index 0000000000..ff8e493d4c
--- /dev/null
+++ b/testing/mycroft-core/mycroft.conf
@@ -0,0 +1,6 @@
+{
+ "data_dir": "/usr/share/mycroft",
+ "skills": {
+ "auto_update": false
+ }
+}