mycroft-core/scripts/install-pocketsphinx.sh

85 lines
2.4 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
Change to Apache 2.0 license from GPLv3.0 This commit officially switches the mycroft-core repository from GPLv3.0 licensing to Apache 2.0. All dependencies on GPL'ed code have been removed and we have contacted all previous contributors with still-existing code in the repository to agree to this change. Going forward, all contributors will sign a Contributor License Agreement (CLA) by visiting https://mycroft.ai/cla, then they will be included in the Mycroft Project's overall Contributor list, found at: https://github.com/MycroftAI/contributors. This cleanly protects the project, the contributor and all who use the technology to build upon. Futher discussion can be found at this blog post: https://mycroft.ai/blog/right-license/ This commit also removes all __author__="" from the code. These lines are painful to maintain and the etiquette surrounding their maintainence is unclear. Do you remove a name from the list if the last line of code the wrote gets replaced? Etc. Now all contributors are publicly acknowledged in the aforementioned repo, and actual authorship is maintained by Github in a much more effective and elegant way! Finally, a few references to "Mycroft AI" were changed to the correct legal entity name "Mycroft AI Inc." ==== Fixed Issues ==== #403 Update License.md and file headers to Apache 2.0 #400 Update LICENSE.md ==== Documentation Notes ==== Deprecated the ScheduledSkill and ScheduledCRUDSkill classes. These capabilities have been superceded by the more flexible MycroftSkill class methods schedule_event(), schedule_repeating_event(), update_event(), and cancel_event().
2017-10-04 06:28:44 +00:00
# Copyright 2017 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.
# exit on any error
set -Ee
#TOP="."
function enable_local {
sed -i -- 's/from pocketsphinx.pocketsphinx import Decoder/from pocketsphinx import Decoder/g' mycroft/client/speech/local_recognizer.py
}
function disable_local {
sed -i -- 's/from pocketsphinx import Decoder/from pocketsphinx.pocketsphinx import Decoder/g' mycroft/client/speech/local_recognizer.py
}
function install_pocketsphinx {
# clone pocketsphinx-python at HEAD (fix to a constant version later)
if [ ! -d ${TOP}/pocketsphinx-python ]; then
# build sphinxbase and pocketsphinx if we haven't already
git clone --recursive https://github.com/cmusphinx/pocketsphinx-python
pushd ./pocketsphinx-python/sphinxbase
./autogen.sh
./configure
make -j$CORES
popd
pushd ./pocketsphinx-python/pocketsphinx
./autogen.sh
./configure
make -j$CORES
popd
fi
# build and install pocketsphinx python bindings
cd ${TOP}/pocketsphinx-python
python setup.py install
}
if [ "$1" = "-q" ]; then
enable_local
install_pocketsphinx
exit 0
fi
echo "This script will checkout, compile, and install pocketsphinx locally if the debian package python-pocketsphinx is not available"
PS3='Please enter your choice: '
options=("Enable local checkout, compile and install" "Disable local checkout and exit" "Do nothing and quit")
select opt in "${options[@]}"
do
case $opt in
"Enable local checkout, compile and install")
echo "you chose choice 1"
enable_local
install_pocketsphinx
;;
"Disable local checkout and exit")
echo "you chose choice 2"
disable_local
exit 0
;;
"Do nothing and quit")
echo "you chose choice 3"
exit 0
;;
*) echo invalid option;;
esac
done