1
0
mirror of https://github.com/rhasspy/rhasspy.git synced 2022-02-12 01:59:45 +03:00

Switching to autoconf

This commit is contained in:
Michael Hansen
2020-05-12 11:15:05 -04:00
parent e34b88fb53
commit 314c1f32d9
77 changed files with 6590 additions and 661 deletions

15
.gitignore vendored
View File

@@ -1,12 +1,21 @@
/autom4te.cache/
/Makefile
/setup.py
/rhasspy.sh
/configure
/config.status
.venv/
__pycache__/
.mypy_cache/
*.egg-info/
/build/
dist/
pyinstaller/
supervisord.log
site/
web/
download/
debian/rhasspy*
etc/qemu-*
rhasspy-test/
*.log

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019-2020 Michael Hansen
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

110
Makefile
View File

@@ -1,110 +0,0 @@
SHELL := bash
PYTHON_NAME = "rhasspy"
SERVICE_NAME = "rhasspy"
PACKAGE_NAME = "rhasspy"
RHASSPY_DIRS = $(shell cat RHASSPY_DIRS)
REQUIREMENTS = $(shell find . -mindepth 2 -maxdepth 2 -type f -name requirements.txt)
REQUIREMENTS_DEV = $(shell find . -mindepth 2 -maxdepth 2 -type f -name requirements_dev.txt)
PYTHON_FILES = **/*.py
PIP_INSTALL ?= install
DOWNLOAD_DIR = download
.PHONY: venv update-bin dist sdist debian pyinstaller docker-alsa docker-deploy docs clean check-dirs
version := $(shell cat VERSION)
architecture := $(shell bash architecture.sh)
version_tag := "rhasspy/$(PACKAGE_NAME):$(version)"
ifneq (,$(findstring -dev,$(version)))
DOCKER_TAGS = -t "rhasspy/$(PACKAGE_NAME):$(version)"
else
DOCKER_TAGS = -t "rhasspy/$(PACKAGE_NAME):$(version)" -t "rhasspy/$(PACKAGE_NAME):latest"
endif
DOCKER_PLATFORMS = linux/amd64,linux/arm64,linux/arm/v7
# -----------------------------------------------------------------------------
all: venv docs
check-dirs:
scripts/ensure-checkout.sh
# Gather non-Rhasspy requirements from all submodules.
# Rhasspy libraries will be used from the submodule source code.
requirements.txt: $(REQUIREMENTS)
cat $^ | grep -v '^rhasspy' | grep -v '^snips' | sort | uniq > $@
# Gather development requirements from all submodules.
requirements_dev.txt: $(REQUIREMENTS_DEV)
cat $^ | grep -v '^-e' | sort | uniq > $@
echo 'mkdocs==1.0.4' >> $@
# Create virtual environment and install all dependencies.
venv: check-dirs requirements.txt requirements_dev.txt update-bin downloads
scripts/create-venv.sh
# Copy submodule scripts to shared bin directory.
update-bin:
$(shell find . -mindepth 3 -maxdepth 3 -type f -name 'rhasspy-*' -path './rhasspy*/bin/*' -exec cp '{}' bin/ \;)
chmod +x bin/*
docs:
scripts/build-docs.sh
clean:
rm -rf .venv/
# -----------------------------------------------------------------------------
# Testing
# -----------------------------------------------------------------------------
reformat:
scripts/format-code.sh
check:
scripts/check-code.sh
test:
scripts/run-tests.sh
# -----------------------------------------------------------------------------
# Distribution
# -----------------------------------------------------------------------------
# Create source/binary/debian distribution files
dist: sdist debian
# Create source distribution
sdist:
python3 setup.py sdist
# -----------------------------------------------------------------------------
# Docker
# -----------------------------------------------------------------------------
deploy: downloads
docker login --username rhasspy --password "$$DOCKER_PASSWORD"
docker buildx build . -f Dockerfile.source.alsa --platform $(DOCKER_PLATFORMS) --push $(DOCKER_TAGS)
deploy-satellite: downloads
docker login --username rhasspy --password "$$DOCKER_PASSWORD"
docker buildx build . -f Dockerfile.source.alsa.pizero --platform linux/arm/v6 --push "rhasspy/rhasspy:$(version)-arm32v6"
# -----------------------------------------------------------------------------
# Debian
# -----------------------------------------------------------------------------
pyinstaller:
scripts/build-pyinstaller.sh "${architecture}" "${version}"
debian:
scripts/build-debian.sh "${architecture}" "${version}"
# -----------------------------------------------------------------------------
# Downloads
# -----------------------------------------------------------------------------
downloads:
scripts/download-deps.sh

423
Makefile.in Normal file
View File

@@ -0,0 +1,423 @@
# Makefile.in
#
# Copyright © 2012, 2013 Brandon Invergo <brandon@invergo.net>
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved. This file is offered as-is,
# without any warranty.
# List whatever files you want to include in your source distribution here.
# You can include whole directories but note that *everything* under that
# directory will be included
DISTFILES = PKG-INFO Makefile.in configure setup.py install-sh
DESTDIR =
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_DISTNAME = ${PACKAGE_NAME}-${PACKAGE_VERSION}
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PYTHON = @PYTHON@
VIRTUALENV = @VIRTUALENV@
SHELL = @SHELL@
MKDIR_P = @MKDIR_P@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
exec_prefix = @exec_prefix@
includedir = @includedir@
infodir = @infodir@
prefix = @prefix@
srcdir = @abs_srcdir@
datadir = @datadir@
datarootdir = @datarootdir@
pkgdatadir = $(datadir)/@PACKAGE_NAME@
pkgincludedir = $(includedir)/@PACKAGE_NAME@
# -----------------------------------------------------------------------------
# Dependencies
# -----------------------------------------------------------------------------
BUILD_DIR ?= $(srcdir)/build
DOWNLOAD_DIR ?= $(srcdir)/download
DO_DOWNLOAD ?= curl -sSfL -o
DOCKER_ARCH = @DOCKER_ARCH@
ENABLE_OPENGRM = @ENABLE_OPENGRM@
OPENGRM_ARCH = @OPENGRM_ARCH@
OPENGRM_FROM = @OPENGRM_FROM@
OPENGRM_PRE_FILE = $(DOWNLOAD_DIR)/opengrm-1.3.4-$(DOCKER_ARCH).tar.gz
OPENGRM_SRC_FILE = $(DOWNLOAD_DIR)/opengrm-ngram-1.3.4.tar.gz
OPENFST_SRC_FILE = $(DOWNLOAD_DIR)/openfst-1.6.9.tar.gz
ENABLE_PHONETISAURUS = @ENABLE_PHONETISAURUS@
PHONETISAURUS_ARCH = @PHONETISAURUS_ARCH@
PHONETISAURUS_FROM = @PHONETISAURUS_FROM@
PHONETISAURUS_PRE_FILE = $(DOWNLOAD_DIR)/phonetisaurus-2019-$(DOCKER_ARCH).tar.gz
PHONETISAURUS_SRC_FILE = $(DOWNLOAD_DIR)/phonetisaurus-2019.tar.gz
ENABLE_PRECISE = @ENABLE_PRECISE@
PRECISE_ARCH = @PRECISE_ARCH@
PRECISE_FROM = @PRECISE_FROM@
PRECISE_FILE = $(DOWNLOAD_DIR)/precise-engine_0.3.0_$(DOCKER_ARCH).tar.gz
ENABLE_POCKETSPHINX = @ENABLE_POCKETSPHINX@
POCKETSPHINX_FILE = $(DOWNLOAD_DIR)/pocketsphinx-python.tar.gz
ENABLE_KALDI = @ENABLE_KALDI@
KALDI_ARCH = @KALDI_ARCH@
KALDI_FROM = @KALDI_FROM@
KALDI_PRE_FILE = $(DOWNLOAD_DIR)/kaldi-2020-$(DOCKER_ARCH).tar.gz
KALDI_SRC_FILE = $(DOWNLOAD_DIR)/kaldi-2020.tar.gz
ENABLE_JULIUS = @ENABLE_JULIUS@
JULIUS_ARCH = @JULIUS_ARCH@
JULIUS_FROM = @JULIUS_FROM@
JULIUS_PRE_FILE = $(DOWNLOAD_DIR)/julius-4.5_$(DOCKER_ARCH).tar.gz
JULIUS_SRC_FILE = $(DOWNLOAD_DIR)/julius-2019.tar.gz
ENABLE_DEEPSPEECH = @ENABLE_DEEPSPEECH@
DEEPSPEECH_ARCH = @DEEPSPEECH_ARCH@
DEEPSPEECH_FROM = @DEEPSPEECH_FROM@
DEEPSPEECH_FILE = $(DOWNLOAD_DIR)/native_client.$(DOCKER_ARCH).cpu.linux.0.6.1.tar.xz
ENABLE_KENLM = @ENABLE_KENLM@
KENLM_ARCH = @KENLM_ARCH@
KENLM_FROM = @KENLM_FROM@
KENLM_PRE_FILE = $(DOWNLOAD_DIR)/kenlm-20200308_$(DOCKER_ARCH).tar.gz
EIGEN_SRC_FILE = $(DOWNLOAD_DIR)/eigen-3.2.8.tar.bz2
KENLM_SRC_FILE = $(DOWNLOAD_DIR)/kenlm-20200308.tar.gz
ENABLE_SNOWBOY = @ENABLE_SNOWBOY@
SNOWBOY_FILE = $(DOWNLOAD_DIR)/snowboy-1.3.0.tar.gz
# -----------------------------------------------------------------------------
VENV_DIR = $(DESTDIR)$(prefix)
VENV_PYTHON = $(VENV_DIR)/bin/python
VIRTUALENV_FLAGS ?= --clear --copies
ifeq ($(VIRTUALENV),yes)
INSTALL_PYTHON=$(VENV_PYTHON)
else # VIRTUALENV == yes
INSTALL_PYTHON=$(PYTHON)
endif # VIRTUALENV == yes
.PHONY: all install uninstall distclean clean dist check installdirs
all: download-init build-init opengrm phonetisaurus precise pocketsphinx kaldi julius snowboy deepspeech kenlm
.PHONY: install-init install-dependencies install-rhasspy
install: installdirs \
install-init \
install-dependencies \
install-rhasspy
install-init:
ifeq ($(VIRTUALENV),yes)
"$(PYTHON)" -m venv $(VIRTUALENV_FLAGS) "$(VENV_DIR)" || "$(PYTHON)" -m venv "$(VENV_DIR)"
"$(VENV_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) --upgrade pip
"$(VENV_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) wheel || true
"$(VENV_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) setuptools
endif # VIRTUALENV == yes
.PHONY: install-opengrm install-phonetisaurus install-precise install-pocketsphinx install-kaldi install-julius install-snowboy install-deepspeech install-kenlm
install-dependencies: install-opengrm \
install-phonetisaurus \
install-precise \
install-pocketsphinx \
install-kaldi \
install-julius \
install-snowboy \
install-deepspeech \
install-kenlm
install-rhasspy:
"$(INSTALL_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) "$(srcdir)"
chmod +x "${srcdir}/rhasspy.sh"
install -D "${srcdir}/rhasspy.sh" "$(DESTDIR)$(prefix)/bin/rhasspy"
install -D "--target-directory=$(DESTDIR)$(prefix)/bin" "${srcdir}/bin/rhasspy-voltron" "${srcdir}/bin/voltron-run"
install -D "--target-directory=$(DESTDIR)$(prefix)/share/rhasspy/etc" "${srcdir}/etc/shflags"
install -D "--target-directory=$(DESTDIR)$(prefix)/share/rhasspy/wav" "${srcdir}/etc/wav"/*.wav
install -D "--target-directory=$(DESTDIR)$(prefix)/share/rhasspy" VERSION README.md LICENSE
cp -fR "${srcdir}/rhasspy-server-hermes/web/docs" "$(DESTDIR)$(prefix)/share/rhasspy/"
cp -fR "${srcdir}/rhasspy-server-hermes/web" "$(DESTDIR)$(prefix)/share/rhasspy/"
cp -fR "${srcdir}/rhasspy-server-hermes/templates" "$(DESTDIR)$(prefix)/share/rhasspy/"
# -----------------------------------------------------------------------------
.PHONY: download-init
download-init:
$(MKDIR_P) "$(DOWNLOAD_DIR)"
.PHONY: build-init
build-init:
$(MKDIR_P) "$(BUILD_DIR)"
# -----------------------------------------------------------------------------
# Opengrm: languge modeling toolkit
# http://www.opengrm.org/twiki/bin/view/GRM/NGramLibrary
# -----------------------------------------------------------------------------
.PHONY: opengrm
ifeq ($(ENABLE_OPENGRM),yes)
opengrm: $(OPENGRM_PRE_FILE)
install-opengrm: $(OPENGRM_PRE_FILE)
"$(srcdir)/scripts/install/install-opengrm.sh" "$(OPENGRM_PRE_FILE)" "$(DESTDIR)$(prefix)"
ifeq ($(OPENGRM_FROM),prebuilt)
$(OPENGRM_PRE_FILE):
$(DO_DOWNLOAD) "$(OPENGRM_PRE_FILE)" "https://github.com/synesthesiam/docker-opengrm/releases/download/v1.3.4/opengrm-1.3.4-$(OPENGRM_ARCH).tar.gz"
else # OPENGRM_FROM
$(OPENGRM_PRE_FILE): $(OPENFST_SRC_FILE) $(OPENGRM_SRC_FILE)
"$(srcdir)/scripts/build/build-opengrm.sh" "$(OPENGRM_SRC_FILE)" "$(OPENFST_SRC_FILE)" "$(BUILD_DIR)" "$(OPENGRM_PRE_FILE)"
endif # OPENGRM_FROM
else # ENABLE_OPENGRM
opengrm:
install-opengrm:
endif # ENABLE_OPENGRM
$(OPENFST_SRC_FILE):
$(DO_DOWNLOAD) "$(OPENFST_SRC_FILE)" 'http://www.openfst.org/twiki/pub/FST/FstDownload/openfst-1.6.9.tar.gz'
$(OPENGRM_SRC_FILE):
$(DO_DOWNLOAD) "$(OPENGRM_SRC_FILE)" 'http://www.opengrm.org/twiki/pub/GRM/NGramDownload/opengrm-ngram-1.3.4.tar.gz'
# -----------------------------------------------------------------------------
# Phonetisaurus: grapheme to phoneme
# https://github.com/AdolfVonKleist/Phonetisaurus
# -----------------------------------------------------------------------------
.PHONY: phonetisaurus
ifeq ($(ENABLE_PHONETISAURUS),yes)
phonetisaurus: $(PHONETISAURUS_PRE_FILE)
install-phonetisaurus: $(PHONETISAURUS_PRE_FILE)
"$(srcdir)/scripts/install/install-phonetisaurus.sh" "$(PHONETISAURUS_PRE_FILE)" "$(DESTDIR)$(prefix)"
ifeq ($(PHONETISAURUS_FROM),prebuit)
$(PHONETISAURUS_PRE_FILE):
$(DO_DOWNLOAD) "$(PHONETISAURUS_PRE_FILE)" "https://github.com/synesthesiam/docker-phonetisaurus/releases/download/v2019.1/phonetisaurus-2019-$(PHONETISAURUS_ARCH).tar.gz"
else # PHONETISAURUS_FROM
$(PHONETISAURUS_PRE_FILE): $(OPENFST_SRC_FILE) $(PHONETISAURUS_SRC_FILE)
"$(srcdir)/scripts/build/build-phonetisaurus.sh" "$(PHONETISAURUS_SRC_FILE)" "$(OPENFST_SRC_FILE)" "$(BUILD_DIR)" "$(PHONETISAURUS_PRE_FILE)"
endif # PHONETISAURUS_FROM
else # ENABLE_PHONETISAURUS
phonetisaurus:
install-phonetisaurus:
endif # ENABLE_PHONETISAURUS
$(PHONETISAURUS_SRC_FILE):
$(DO_DOWNLOAD) "$(PHONETISAURUS_SRC_FILE)" 'https://github.com/synesthesiam/docker-phonetisaurus/raw/master/download/phonetisaurus-2019.tar.gz'
# -----------------------------------------------------------------------------
# Mycroft Precise: wake word detection
# https://github.com/MycroftAI/mycroft-precise
# -----------------------------------------------------------------------------
.PHONY: precise install-precise
ifeq ($(ENABLE_PRECISE),yes)
precise: $(PRECISE_FILE)
install-precise: $(PRECISE_FILE)
"$(srcdir)/scripts/install/install-precise.sh" "$(PRECISE_FILE)" "$(DESTDIR)$(prefix)"
else # ENABLE_PRECISE
precise:
install-precise:
endif # ENABLE_PRECISE
$(PRECISE_FILE):
$(DO_DOWNLOAD) "$(PRECISE_FILE)" "https://github.com/MycroftAI/mycroft-precise/releases/download/v0.3.0/precise-engine_0.3.0_$(PRECISE_ARCH).tar.gz"
# -----------------------------------------------------------------------------
# Snowboy: wake word detection
# https://snowboy.kitt.ai
# -----------------------------------------------------------------------------
.PHONY: snowboy install-snowboy
ifeq ($(ENABLE_SNOWBOY),yes)
snowboy: $(SNOWBOY_FILE)
install-snowboy: $(SNOWBOY_FILE)
"$(INSTALL_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) "$(SNOWBOY_FILE)"
else # ENABLE_SNOWBOY
snowboy:
install-snowboy:
endif # ENABLE_SNOWBOY
$(SNOWBOY_FILE):
$(DO_DOWNLOAD) "$(SNOWBOY_FILE)" 'https://github.com/Kitt-AI/snowboy/archive/v1.3.0.tar.gz'
# -----------------------------------------------------------------------------
# CMU Pocketsphinx: speech to text
# https://github.com/cmusphinx/pocketsphinx
# -----------------------------------------------------------------------------
.PHONY: pocketsphinx install-pocketsphinx
ifeq ($(ENABLE_POCKETSPHINX),yes)
pocketsphinx: $(POCKETSPHINX_FILE)
install-pocketsphinx: $(POCKETSPHINX_FILE)
"$(INSTALL_PYTHON)" -m pip install $(PIP_INSTALL_ARGS) "$(POCKETSPHINX_FILE)"
else # ENABLE_POCKETSPHINX
pocketsphinx:
install-pocketsphinx:
endif # ENABLE_POCKETSPHINX
$(POCKETSPHINX_FILE):
$(DO_DOWNLOAD) "$(POCKETSPHINX_FILE)" 'https://github.com/synesthesiam/pocketsphinx-python/releases/download/v1.0/pocketsphinx-python.tar.gz'
# -----------------------------------------------------------------------------
# Kaldi: speech to text
# https://kaldi-asr.org
# -----------------------------------------------------------------------------
.PHONY: kaldi
ifeq ($(ENABLE_KALDI),yes)
kaldi: $(KALDI_PRE_FILE)
install-kaldi: $(KALDI_PRE_FILE)
"$(srcdir)/scripts/install/install-kaldi.sh" "$(KALDI_PRE_FILE)" "$(DESTDIR)$(prefix)"
ifeq ($(KALDI_FROM),prebuilt)
$(KALDI_PRE_FILE):
$(DO_DOWNLOAD) "$(KALDI_PRE_FILE)" "https://github.com/synesthesiam/kaldi-docker/releases/download/v1.0/kaldi_$(KALDI_ARCH).tar.gz"
else # KALDI_FROM
$(KALDI_PRE_FILE): $(KALDI_SRC_FILE)
"$(srcdir)/scripts/build/build-kaldi.sh" "$(KALDI_SRC_FILE)" "$(BUILD_DIR)" "$(KALDI_PRE_FILE)"
endif # KALDI_FROM
else # ENABLE_KALDI
kaldi:
install-kaldi:
endif # ENABLE_KALDI
$(KALDI_SRC_FILE):
$(DO_DOWNLOAD) "$(KALDI_SRC_FILE)" 'https://github.com/synesthesiam/docker-kaldi/raw/master/download/kaldi-2020.tar.gz'
# -----------------------------------------------------------------------------
# Julius: speech to text
# https://github.com/julius-speech/julius
# -----------------------------------------------------------------------------
.PHONY: julius
ifeq ($(ENABLE_JULIUS),yes)
julius: $(JULIUS_PRE_FILE)
install-julius: $(JULIUS_PRE_FILE)
"$(srcdir)/scripts/install/install-julius.sh" "$(JULIUS_PRE_FILE)" "$(DESTDIR)$(prefix)"
ifeq ($(JULIUS_FROM),prebuilt)
$(JULIUS_PRE_FILE):
$(DO_DOWNLOAD) "$(JULIUS_PRE_FILE)" "https://github.com/synesthesiam/docker-julius/releases/download/v4.5/julius-4.5_$(JULIUS_ARCH).tar.gz"
else # JULIUS_FROM
$(JULIUS_PRE_FILE): $(JULIUS_SRC_FILE)
"$(srcdir)/scripts/build/build-julius.sh" "$(JULIUS_SRC_FILE)" "$(BUILD_DIR)" "$(JULIUS_PRE_FILE)"
endif # JULIUS_FROM
else # ENABLE_JULIUS
julius:
install-julius:
endif # ENABLE_JULIUS
$(JULIUS_SRC_FILE):
$(DO_DOWNLOAD) "$(JULIUS_SRC_FILE)" 'https://github.com/synesthesiam/docker-julius/raw/master/download/julius-2019.tar.gz'
# -----------------------------------------------------------------------------
# Mozilla DeepSpeech: speech to text
# https://github.com/mozilla/DeepSpeech
# -----------------------------------------------------------------------------
.PHONY: deepspeech install-deepspeech
ifeq ($(ENABLE_DEEPSPEECH),yes)
deepspeech: $(DEEPSPEECH_FILE)
install-deepspeech: $(DEEPSPEECH_FILE)
"$(srcdir)/scripts/install/install-deepspeech.sh" "$(DEEPSPEECH_FILE)" "$(DESTDIR)$(prefix)"
else # ENABLE_DEEPSPEECH
deepspeech:
install-deepspeech:
endif # ENABLE_DEEPSPEECH
$(DEEPSPEECH_FILE):
$(DO_DOWNLOAD) "$(DEEPSPEECH_FILE)" "https://github.com/mozilla/DeepSpeech/releases/download/v0.6.1/native_client.$(DEEPSPEECH_ARCH).cpu.linux.tar.xz"
# -----------------------------------------------------------------------------
# KenLM: language modeling toolkit
# https://kheafield.com/code/kenlm/
# -----------------------------------------------------------------------------
.PHONY: kenlm install-kenlm
ifeq ($(ENABLE_KENLM),yes)
kenlm: $(KENLM_PRE_FILE)
ifeq ($(KENLM_FROM),prebuilt)
$(KENLM_PRE_FILE):
$(DO_DOWNLOAD) "$(KENLM_PRE_FILE)" "https://github.com/synesthesiam/docker-kenlm/releases/download/v2020.03.28/kenlm-20200308_$(KENLM_ARCH).tar.gz"
else # KENLM_FROM
$(KENLM_PRE_FILE): $(EIGEN_SRC_FILE) $(KENLM_SRC_FILE)
"$(srcdir)/scripts/build/build-kenlm.sh" "$(KENLM_SRC_FILE)" "$(EIGEN_SRC_FILE)" "$(BUILD_DIR)" "$(KENLM_PRE_FILE)"
endif # KENLM_FROM
install-kenlm: $(KENLM_PRE_FILE)
"$(srcdir)/scripts/install/install-kenlm.sh" "$(KENLM_PRE_FILE)" "$(DESTDIR)$(prefix)"
else # ENABLE_KENLM
kenlm:
install-kenlm:
endif # ENABLE_KENLM
$(KENLM_SRC_FILE):
$(DO_DOWNLOAD) "$(KENLM_SRC_FILE)" 'https://github.com/synesthesiam/docker-kenlm/raw/master/download/kenlm-20200308.tar.gz'
$(EIGEN_SRC_FILE):
$(DO_DOWNLOAD) "$(EIGEN_SRC_FILE)" 'https://github.com/synesthesiam/docker-kenlm/raw/master/download/eigen-3.2.8.tar.bz2'
# -----------------------------------------------------------------------------
uninstall:
ifeq ($(VIRTUALENV),yes)
rm -rvf "$(VENV_DIR)"
endif
# Delete downloaded binaries and build artifacts
clean:
"$(PYTHON)" setup.py clean
rm -rvf "$(BUILD_DIR)"
# Clean up the output of configure
distclean:
rm -v "$(srcdir)/config.log"
rm -v "$(srcdir)/config.status"
rm -rvf "$(srcdir)/autom4te.cache"
rm -v "$(srcdir)/Makefile"
# You can either use the setup.py sdist command or you can roll your own here
dist:
"$(PYTHON)" setup.py sdist
# Use the setup.py check command
check:
"$(PYTHON)" setup.py check
"$(DEST_DIR)$(prefix)/bin/voice2json" --version
# setup.py might complain if a directory doesn't exist so just in case, make the directory
# here
installdirs:
$(MKDIR_P) "$(DESTDIR)$(prefix)"

View File

@@ -19,6 +19,7 @@ rhasspy-rasa-nlu-hermes
rhasspy-remote-http-hermes
rhasspy-server-hermes
rhasspy-silence
rhasspy-snips-nlu
rhasspy-snips-nlu-hermes
rhasspy-speakers-cli-hermes
rhasspy-supervisor

151
aclocal.m4 vendored Normal file
View File

@@ -0,0 +1,151 @@
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# ===========================================================================
# https://www.gnu.org/software/autoconf-archive/ax_pkg_swig.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_PKG_SWIG([major.minor.micro], [action-if-found], [action-if-not-found])
#
# DESCRIPTION
#
# This macro searches for a SWIG installation on your system. If found,
# then SWIG is AC_SUBST'd; if not found, then $SWIG is empty. If SWIG is
# found, then SWIG_LIB is set to the SWIG library path, and AC_SUBST'd.
#
# You can use the optional first argument to check if the version of the
# available SWIG is greater than or equal to the value of the argument. It
# should have the format: N[.N[.N]] (N is a number between 0 and 999. Only
# the first N is mandatory.) If the version argument is given (e.g.
# 1.3.17), AX_PKG_SWIG checks that the swig package is this version number
# or higher.
#
# As usual, action-if-found is executed if SWIG is found, otherwise
# action-if-not-found is executed.
#
# In configure.in, use as:
#
# AX_PKG_SWIG(1.3.17, [], [ AC_MSG_ERROR([SWIG is required to build..]) ])
# AX_SWIG_ENABLE_CXX
# AX_SWIG_MULTI_MODULE_SUPPORT
# AX_SWIG_PYTHON
#
# LICENSE
#
# Copyright (c) 2008 Sebastian Huber <sebastian-huber@web.de>
# Copyright (c) 2008 Alan W. Irwin
# Copyright (c) 2008 Rafael Laboissiere <rafael@laboissiere.net>
# Copyright (c) 2008 Andrew Collier
# Copyright (c) 2011 Murray Cumming <murrayc@openismus.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
#serial 13
AC_DEFUN([AX_PKG_SWIG],[
# Find path to the "swig" executable.
AC_PATH_PROGS([SWIG],[swig swig3.0 swig2.0])
if test -z "$SWIG" ; then
m4_ifval([$3],[$3],[:])
elif test -n "$1" ; then
AC_MSG_CHECKING([SWIG version])
[swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`]
AC_MSG_RESULT([$swig_version])
if test -n "$swig_version" ; then
# Calculate the required version number components
[required=$1]
[required_major=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_major" ; then
[required_major=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_minor=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_minor" ; then
[required_minor=0]
fi
[required=`echo $required | sed 's/[0-9]*[^0-9]//'`]
[required_patch=`echo $required | sed 's/[^0-9].*//'`]
if test -z "$required_patch" ; then
[required_patch=0]
fi
# Calculate the available version number components
[available=$swig_version]
[available_major=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_major" ; then
[available_major=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_minor=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_minor" ; then
[available_minor=0]
fi
[available=`echo $available | sed 's/[0-9]*[^0-9]//'`]
[available_patch=`echo $available | sed 's/[^0-9].*//'`]
if test -z "$available_patch" ; then
[available_patch=0]
fi
# Convert the version tuple into a single number for easier comparison.
# Using base 100 should be safe since SWIG internally uses BCD values
# to encode its version number.
required_swig_vernum=`expr $required_major \* 10000 \
\+ $required_minor \* 100 \+ $required_patch`
available_swig_vernum=`expr $available_major \* 10000 \
\+ $available_minor \* 100 \+ $available_patch`
if test $available_swig_vernum -lt $required_swig_vernum; then
AC_MSG_WARN([SWIG version >= $1 is required. You have $swig_version.])
SWIG=''
m4_ifval([$3],[$3],[])
else
AC_MSG_CHECKING([for SWIG library])
SWIG_LIB=`$SWIG -swiglib`
AC_MSG_RESULT([$SWIG_LIB])
m4_ifval([$2],[$2],[])
fi
else
AC_MSG_WARN([cannot determine SWIG version])
SWIG=''
m4_ifval([$3],[$3],[])
fi
fi
AC_SUBST([SWIG_LIB])
])
m4_include([m4/python.m4])

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyasr_deepspeech_hermes "$@"

View File

@@ -1,22 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
PYTHON_NAME='rhasspyasr_kaldi'
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
export LD_LIBRARY_PATH="${src_dir}/${PYTHON_NAME}:${LD_LIBRARY_PATH}"
export PATH="${src_dir}/${PYTHON_NAME}/kaldi:${PATH}"
python3 -m "${PYTHON_NAME}" "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyasr_kaldi_hermes "$@"

View File

@@ -1,20 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
PYTHON_NAME='rhasspyasr_pocketsphinx'
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m "${PYTHON_NAME}" "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyasr_pocketsphinx_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspydialogue_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyfuzzywuzzy "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyfuzzywuzzy_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyhermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyhomeassistant_hermes "$@"

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
# shellcheck disable=SC1090
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspymicrophone_cli_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspymicrophone_pyaudio_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspynlu "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspynlu_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyprofile "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyrasa_nlu_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyremote_http_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyserver_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspysnips_nlu_hermes "$@"

View File

@@ -1,19 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
# shellcheck disable=SC1090
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspyspeakers_cli_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspysupervisor "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspytts_cli_hermes "$@"

View File

@@ -4,6 +4,10 @@
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
if [[ -z "${RHASSPY_BASE_DIR}" ]]; then
export RHASSPY_BASE_DIR="${src_dir}"
fi
config_home="${XDG_CONFIG_HOME}"
if [[ -z "${config_home}" ]]; then
config_home="${HOME}/.config"
@@ -13,7 +17,7 @@ fi
# Command-line Arguments
# -----------------------------------------------------------------------------
. "${src_dir}/etc/shflags"
. "${RHASSPY_BASE_DIR}/etc/shflags"
DEFINE_string 'profile' '' 'Path to profile' 'p'
DEFINE_string 'user-profiles' "${config_home}/rhasspy/profiles" 'Directory with user profile files'
@@ -47,7 +51,6 @@ fi
profile_dir="${user_profiles}/${profile_name}"
# Set environment variables
export RHASSPY_BASE_DIR="${src_dir}"
export RHASSPY_PROFILE="${profile_name}"
export RHASSPY_PROFILE_DIR="${profile_dir}"
@@ -100,12 +103,17 @@ echo 'Starting up...'
"${extra_supervisor_args[@]}" \
--debug
if [[ -z "${RHASSPY_WEB_DIR}" ]]; then
# Look for web interface files in rhasspy-server-hermes
RHASSPY_WEB_DIR="${RHASSPY_BASE_DIR}/rhasspy-server-hermes/web"
fi
# Run web server
"${this_dir}/voltron-run" \
python3 -m rhasspyserver_hermes \
--profile "${profile_name}" \
--user-profiles "${user_profiles}" \
--web-dir "${src_dir}/rhasspy-server-hermes/web" \
--web-dir "${RHASSPY_WEB_DIR}" \
"${extra_web_args[@]}" \
&

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspywake_pocketsphinx_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspywake_porcupine_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspywake_precise_hermes "$@"

View File

@@ -1,18 +0,0 @@
#!/usr/bin/env bash
set -e
# Directory of *this* script
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
source "${venv}/bin/activate"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
python3 -m rhasspywake_snowboy_hermes "$@"

View File

@@ -4,44 +4,45 @@
this_dir="$( cd "$( dirname "$0" )" && pwd )"
src_dir="$(realpath "${this_dir}/..")"
if [[ -z "${RHASSPY_BASE_DIR}" ]]; then
export RHASSPY_BASE_DIR="${src_dir}"
fi
# -----------------------------------------------------------------------------
# Set up environment
# -----------------------------------------------------------------------------
venv="${src_dir}/.venv"
if [[ ! -d "${venv}" ]]; then
echo "Missing virtual environment at ${venv}"
echo 'Did you run "make venv"?'
exit 1
fi
if [[ -d "${venv}" ]]; then
echo "Using virtual environment at ${venv}"
source "${venv}/bin/activate"
source "${venv}/bin/activate"
# Use bin/lib from virtual environment
export PATH="${venv}/bin:${PATH}"
export LD_LIBRARY_PATH="${venv}/lib:${LD_LIBRARY_PATH}"
maybe_kaldi_dir="${venv}/lib/kaldi"
if [[ -d "${maybe_kaldi_dir}" ]]; then
export KALDI_DIR="${maybe_kaldi_dir}"
fi
fi
# Add submodules to Python path
RHASSPY_DIRS=(`cat "${src_dir}/RHASSPY_DIRS"`)
for rhasspy_dir in "${RHASSPY_DIRS[@]}"; do
PYTHONPATH="${src_dir}/${rhasspy_dir}:${PYTHONPATH}"
done
if [[ -f "${RHASSPY_BASE_DIR}/RHASSPY_DIRS" ]]; then
RHASSPY_DIRS=(`cat "${RHASSPY_BASE_DIR}/RHASSPY_DIRS"`)
for rhasspy_dir in "${RHASSPY_DIRS[@]}"; do
module_dir="${RHASSPY_BASE_DIR}/${rhasspy_dir}"
PYTHONPATH="${module_dir}:${PYTHONPATH}"
export PYTHONPATH="${src_dir}:${PYTHONPATH}"
export PATH="${this_dir}:${PATH}"
bin_dir="${module_dir}/bin"
if [[ -d "${bin_dir}" ]]; then
export PATH="${bin_dir}:${PATH}"
fi
done
if [[ -d "${venv}/tools" ]]; then
export PATH="${venv}/tools:${PATH}"
export LD_LIBRARY_PATH="${venv}/tools:${LD_LIBRARY_PATH}"
if [[ -d "${venv}/tools/kaldi" ]]; then
export KALDI_DIR="${venv}/tools/kaldi"
fi
if [[ -d "${venv}/tools/precise-engine" ]]; then
export PRECISE_ENGINE_DIR="${venv}/tools/precise-engine"
fi
export PYTHONPATH="${RHASSPY_BASE_DIR}:${PYTHONPATH}"
fi
# Site packages (for PyInstaller scripts)
export RHASSPY_SITE_PACKAGES="$(find "${venv}" -mindepth 3 -maxdepth 3 -type d -name site-packages)"
# Run user command
"$@"

3
bootstrap.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
autoreconf -fvi

1480
config.guess vendored Executable file

File diff suppressed because it is too large Load Diff

1801
config.sub vendored Executable file

File diff suppressed because it is too large Load Diff

724
configure.ac Normal file
View File

@@ -0,0 +1,724 @@
AC_INIT([rhasspy], [2.5.0], [mike@rhasspy.org])
AC_CONFIG_MACRO_DIR([m4])
PC_INIT([3.7.0])
dnl ---------------------------------------------------------------------------
AC_PREFIX_DEFAULT([$PWD/.venv])
dnl Template files to write
AC_CONFIG_FILES([Makefile])
AC_CONFIG_FILES([setup.py])
AC_CONFIG_FILES([rhasspy.sh])
AC_CANONICAL_HOST
AC_PROG_INSTALL
AC_PROG_MKDIR_P
AC_PROG_CC
AC_PROG_CXX
dnl ---------------------------------------------------------------------------
is_virtualenv_enabled=yes
is_dependency_check_enabled=yes
dnl An in-place install does not include Rhasspy Python modules, since they will
dnl be used directly from source.
is_in_place=no
dnl ----------
dnl Microphone
dnl ----------
is_pyaudio_enabled=yes
dnl -------------------
dnl Wake Word Detection
dnl -------------------
is_wake_enabled=yes
is_precise_enabled=UNKNOWN
precise_arch=NONE
precise_from=prebuilt
is_porcupine_enabled=UNKNOWN
is_snowboy_enabled=UNKNOWN
is_wake_pocketsphinx_enabled=UNKNOWN
dnl --------------
dnl Speech to Text
dnl --------------
is_speech_to_text_enabled=yes
is_stt_pocketsphinx_enabled=UNKNOWN
pocketsphinx_from=source
is_kaldi_enabled=UNKNOWN
kaldi_arch=NONE
kaldi_from=prebuilt
is_julius_enabled=UNKNOWN
julius_arch=NONE
julius_from=prebuilt
is_deepspeech_enabled=UNKNOWN
deepspeech_arch=NONE
deepspeech_from=prebuilt
dnl ------------------
dnl Intent Recognition
dnl ------------------
is_fuzzywuzzy_enabled=yes
is_snips_enabled=no
dnl --------------
dnl Training Tools
dnl --------------
is_training_enabled=yes
is_opengrm_enabled=UNKNOWN
opengrm_arch=NONE
opengrm_from=prebuilt
is_phonetisaurus_enabled=UNKNOWN
phonetisaurus_arch=NONE
phonetisaurus_from=prebuilt
is_kenlm_enabled=UNKNOWN
kenlm_arch=NONE
kenlm_from=prebuilt
dnl Set architectures based on host CPU
AS_CASE([$host_cpu],
[armv6l],[
dnl ARM 32-bit v6 (Pi 1/0)
docker_arch=armv6
is_precise_enabled=no
precise_from=NONE
is_porcupine_enabled=yes
is_snowboy_enabled=yes
is_wake_pocketsphinx_enabled=yes
is_stt_pocketsphinx_enabled=yes
pocketsphinx_from=source
is_kaldi_enabled=no
kaldi_from=NONE
is_julius_enabled=no
julius_from=source
is_deepspeech_enabled=no
deepspeech_from=NONE
is_opengrm_enabled=yes
opengrm_arch=armv6l
is_phonetisaurus_enabled=yes
phonetisaurus_arch=armv6l
is_kenlm_enabled=no
kenlm_from=source
],
[armv7l],[
dnl ARM 32-bit v7 (Pi 2/3/4)
docker_arch=armv7
is_precise_enabled=yes
precise_arch=armv7l
is_porcupine_enabled=yes
is_snowboy_enabled=yes
is_wake_pocketsphinx_enabled=yes
is_stt_pocketsphinx_enabled=yes
pocketsphinx_from=source
is_kaldi_enabled=yes
kaldi_arch=armv7
is_julius_enabled=yes
julius_arch=armv7
is_deepspeech_enabled=yes
deepspeech_arch=rpi3
is_opengrm_enabled=yes
opengrm_arch=armhf
is_phonetisaurus_enabled=yes
phonetisaurus_arch=armhf
is_kenlm_enabled=yes
kenlm_arch=armv7
],
[aarch64],[
dnl ARM 64-bit (Pi 3/4)
docker_arch=arm64
is_precise_enabled=yes
precise_arch=aarch64
is_porcupine_enabled=yes
is_snowboy_enabled=no
is_wake_pocketsphinx_enabled=yes
is_stt_pocketsphinx_enabled=yes
pocketsphinx_from=source
is_kaldi_enabled=yes
kaldi_arch=arm64
is_julius_enabled=no
julius_from=source
is_deepspeech_enabled=no
deepspeech_from=NONE
is_opengrm_enabled=yes
opengrm_arch=aarch64
is_phonetisaurus_enabled=yes
phonetisaurus_arch=arm64
is_kenlm_enabled=no
kenlm_from=source
],
[x86_64],[
dnl x86_64 compatible
docker_arch=amd64
is_precise_enabled=yes
precise_arch=x86_64
is_porcupine_enabled=yes
is_snowboy_enabled=yes
is_wake_pocketsphinx_enabled=yes
is_stt_pocketsphinx_enabled=yes
pocketsphinx_from=source
is_kaldi_enabled=yes
kaldi_arch=amd64
is_julius_enabled=yes
julius_arch=amd64
is_deepspeech_enabled=yes
deepspeech_arch=amd64
is_opengrm_enabled=yes
opengrm_arch=amd64
is_phonetisaurus_enabled=yes
phonetisaurus_arch=amd64
is_kenlm_enabled=yes
kenlm_arch=amd64
])
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([in-place],
AS_HELP_STRING([--enable-in-place],
[do not install Rhasspy Python modules in virtual environment (will be used from source)]))
precompiled_binaries_enabled=yes
AC_ARG_ENABLE([precompiled-binaries],
AS_HELP_STRING([--disable-precompiled-binaries],
[build dependencies from source instead of downloading prebuilt binaries]))
AC_ARG_VAR([RHASSPY_LANGUAGE],
[use recommended settings for specific language (ca,nl,en,fr,de,el,hi,it,kz,zh,pl,pt,es,sv,vi)])
dnl ---------------------------------------------------------------------------
dnl Python virtual environment
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([virtualenv],
[AS_HELP_STRING([--disable-virtualenv],
[don't create a Python virtual environment at prefix])])
AC_ARG_VAR([VIRTUALENV_FLAGS], [flags to pass to when creating virtual environment])
dnl ---------------------------------------------------------------------------
dnl Training Tools
dnl ---------------------------------------------------------------------------
dnl Opengrm
AC_ARG_ENABLE([opengrm],
AS_HELP_STRING([--disable-opengrm],
[disable installation of opengrm language modeling toolkit]))
dnl Phonetisaurus
AC_ARG_ENABLE([phonetisaurus],
AS_HELP_STRING([--disable-phonetisaurus],
[disable installation of phonetisaurus grapheme to phoneme tool]))
dnl Training meta
AC_ARG_ENABLE([training],
AS_HELP_STRING([--disable-training],
[disable installation of training tools]))
dnl ---------------------------------------------------------------------------
dnl Wake Word Systems
dnl ---------------------------------------------------------------------------
dnl Mycroft Precise
AC_ARG_ENABLE([precise],
AS_HELP_STRING([--disable-precise],
[disable installation of Mycroft Precise wake word system]))
dnl Picovoice Porcupine
AC_ARG_ENABLE([porcupine],
AS_HELP_STRING([--disable-porcupine],
[disable installation of Porcupine wake word system]))
dnl Snowboy
AC_ARG_ENABLE([snowboy],
AS_HELP_STRING([--disable-snowboy],
[disable installation of Snowboy wake word system]))
dnl Wake meta
AC_ARG_ENABLE([wake],
AS_HELP_STRING([--disable-wake],
[disable installation of all wake word systems]))
AC_ARG_VAR([RHASSPY_WAKE_SYSTEM],
AS_HELP_STRING([only enable a single wake word system (precise,porcupine,snowboy,pocketsphinx)]))
dnl ---------------------------------------------------------------------------
dnl Speech to Text Systems
dnl ---------------------------------------------------------------------------
dnl Pocketsphinx
AC_ARG_ENABLE([pocketsphinx],
AS_HELP_STRING([--disable-pocketsphinx],
[disable installation of pocketsphinx speech to text system]))
dnl Kaldi
AC_ARG_ENABLE([kaldi],
AS_HELP_STRING([--disable-kaldi],
[disable installation of Kaldi speech to text system]))
dnl Julius
AC_ARG_ENABLE([julius],
AS_HELP_STRING([--disable-julius],
[disable installation of julius speech to text system]))
dnl Mozilla's DeepSpeech
AC_ARG_ENABLE([deepspeech],
AS_HELP_STRING([--disable-deepspeech],
[disable installation of deepspeech speech to text system]))
dnl Speech to text meta
AC_ARG_ENABLE([speech-to-text],
AS_HELP_STRING([--disable-speech-to-text],
[disable installation of all speech to text systems]))
AC_ARG_VAR([RHASSPY_SPEECH_SYSTEM],
AS_HELP_STRING([only enable a single speech to text system (pocketsphinx,kaldi,deepspeech,julius)]))
dnl ---------------------------------------------------------------------------
dnl Intent Recognition
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([fuzzywuzzy],
AS_HELP_STRING([--disable-fuzzywuzzy],
[disable installation of fuzzywuzzy intent recognition system]))
AC_ARG_ENABLE([snips],
AS_HELP_STRING([--enable-snips],
[enable installation of Snips NLU intent recognition system]))
dnl ---------------------------------------------------------------------------
dnl Resolve Settings
dnl ---------------------------------------------------------------------------
wake_system=NONE
dnl Override with specific wake system
AS_IF([test "x$RHASSPY_WAKE_SYSTEM" != x],
[wake_system=$RHASSPY_WAKE_SYSTEM])
AS_CASE([$wake_system],
[pocketsphinx],
[
is_wake_pocketsphinx_enabled=yes
is_porcupine_enabled=no
is_precise_enabled=no
is_snowboy_enabled=no
],
[porcupine],
[
is_wake_pocketsphinx_enabled=no
is_porcupine_enabled=yes
is_precise_enabled=no
is_snowboy_enabled=no
],
[precise],
[
is_wake_pocketsphinx_enabled=no
is_porcupine_enabled=no
is_precise_enabled=yes
is_snowboy_enabled=no
],
[snowboy],
[
is_wake_pocketsphinx_enabled=no
is_porcupine_enabled=no
is_precise_enabled=no
is_snowboy_enabled=yes
])
stt_system=NONE
kaldi_or_pocketsphinx=kaldi
AS_IF([test "x${is_kaldi_enabled}" != xyes],
[kaldi_or_pocketsphinx=pocketsphinx])
dnl Override with recommended settings for language
AS_IF([test "x$RHASSPY_LANGUAGE" != x],
[
lang=$RHASSPY_LANGUAGE
AS_CASE([$lang],
[ca],[stt_system=pocketsphinx],
[nl],[stt_system=${kaldi_or_pocketsphinx}],
[en],[stt_system=${kaldi_or_pocketsphinx}],
[fr],[stt_system=${kaldi_or_pocketsphinx}],
[de],[stt_system=${kaldi_or_pocketsphinx}],
[hi],[stt_system=pocketsphinx],
[it],[stt_system=pocketsphinx],
[kz],[stt_system=pocketsphinx],
[zh],[stt_system=pocketsphinx],
[pl],[stt_system=julius],
[pt],[stt_system=pocketsphinx],
[ru],[stt_system=pocketsphinx],
[es],[stt_system=pocketsphinx],
[sv],[stt_system=kaldi],
[vi],[stt_system=kaldi],
[AC_MSG_ERROR([Unsupported language: $lang])])
])
dnl Override with specific speech to text system
AS_IF([test "x$RHASSPY_SPEECH_SYSTEM" != x],
[stt_system=$RHASSPY_SPEECH_SYSTEM])
AS_CASE([$stt_system],
[pocketsphinx],
[
is_stt_pocketsphinx_enabled=yes
is_kaldi_enabled=no
is_julius_enabled=no
is_deepspeech_enabled=no
],
[kaldi],
[
is_stt_pocketsphinx_enabled=no
is_kaldi_enabled=yes
is_julius_enabled=no
is_deepspeech_enabled=no
],
[julius],
[
is_stt_pocketsphinx_enabled=no
is_kaldi_enabled=no
is_julius_enabled=yes
is_deepspeech_enabled=no
],
[deepspeech],
[
is_stt_pocketsphinx_enabled=no
is_kaldi_enabled=no
is_julius_enabled=no
is_deepspeech_enabled=yes
])
dnl Disable tools that are only applicable to specific speech to text systems
AS_IF([test "x${is_deepspeech_enabled}x${is_stt_pocketsphinx_enabled}x${is_kaldi_enabled}x${is_julius_enabled}" = xyesxnoxnoxno],
[is_phonetisaurus_enabled=no])
AS_IF([test "x${is_deepspeech_enabled}" = xno],
[is_kenlm_enabled=no])
dnl Override with enable/disable options (meta)
AS_CASE([$enable_wake],
[no],[
is_precise_enabled=no
is_porcupine_enabled=no
is_snowboy_enabled=no
is_wake_pocketsphinx_enabled=no
])
AS_CASE([$enable_speech_to_text],
[no],[
is_stt_pocketsphinx_enabled=no
is_kaldi_enabled=no
is_julius_enabled=no
is_deepspeech_enabled=no
])
AS_CASE([$enable_training],
[no],[
is_opengrm_enabled=no
is_phonetisaurus_enabled=no
is_kenlm_enabled=no
])
dnl Override with enable/disable options (non-meta)
AS_CASE([$enable_precise],
[yes],[is_precise_enabled=yes],
[no],[is_precise_enabled=no])
AS_CASE([$enable_pocketsphinx],
[yes],[is_stt_pocketsphinx_enabled=yes],
[no],[is_stt_pocketsphinx_enabled=no])
AS_CASE([$enable_kaldi],
[yes],[is_kaldi_enabled=yes],
[no],[is_kaldi_enabled=no])
AS_CASE([$enable_julius],
[yes],[is_julius_enabled=yes],
[no],[is_julius_enabled=no])
AS_CASE([$enable_deepspeech],
[yes],[is_deepspeech_enabled=yes],
[no],[is_deepspeech_enabled=no])
AS_CASE([$enable_opengrm],
[yes],[is_opengrm_enabled=yes],
[no],[is_opengrm_enabled=no])
AS_CASE([$enable_phonetisaurus],
[yes],[is_phonetisaurus_enabled=yes],
[no],[is_phonetisaurus_enabled=no])
AS_CASE([$enable_kenlm],
[yes],[is_kenlm_enabled=yes],
[no],[is_kenlm_enabled=no])
dnl Determine prebuilt/source
AS_CASE([$enable_precompiled_binaries],
[no],[
kaldi_from=source
opengrm_from=source
phonetisaurus_from=source
kenlm_from=source
])
dnl Pocketsphinx can be enabled for wake or speech to text
AS_IF([test "x${is_wake_pocketsphinx_enabled}x${is_stt_pocketsphinx_enabled}" = xnoxno],
[is_pocketsphinx_enabled=no],
[is_pocketsphinx_enabled=yes])
AS_CASE([$enable_fuzzywuzzy],
[yes],[is_fuzzywuzzy_enabled=yes],
[no],[is_fuzzywuzzy_enabled=no])
AS_CASE([$enable_snips],
[yes],[is_snips_enabled=yes],
[no],[is_snips_enabled=no])
dnl In-place install
AS_CASE([$enable_in_place],
[yes],[is_in_place=yes],
[no],[is_in_place=no])
dnl ---------------------------------------------------------------------------
dnl Extra Dependency Checks
dnl ---------------------------------------------------------------------------
AC_ARG_ENABLE([dependency-check],
AS_HELP_STRING([--disable-dependency-check],
[disable checking for external dependencies]),
[is_dependency_check_enabled=$enableval])
AS_IF([test "x$is_dependency_check_enabled" = xyes], [
dnl PyAudio requires portaudio.h
AS_IF([test "x$is_pyaudio_enabled" = xyes],
[
AC_CHECK_HEADER([portaudio.h], [], [
AC_MSG_ERROR([portaudio development libary is required for PyAudio microphone (portaudio19-dev package)])
])
])
dnl pocketsphinx needs swig and a C compiler
AS_IF([test "x${is_pocketsphinx_enabled}x${pocketsphinx_from}" = xyesxsource],
[
AS_IF([test "x$CC" = x], [
AC_MSG_ERROR([C compiler is required for Pocketsphinx (build-essential package)])
])
AX_PKG_SWIG([3.0.0], [], [
AC_MSG_ERROR([swig is required for Pocketsphinx (swig package)])
])
])
dnl julius needs a C compiler
AS_IF([test "x${is_julius_enabled}x${julius_from}" = xyesxsource],
[
AS_IF([test "x$CC" = x], [
AC_MSG_ERROR([C compiler is required for Julius (build-essential package)])
])
])
dnl kaldi needs ATLAS
AS_IF([test "x$is_kaldi_enabled" = xyes],
[
AC_CHECK_LIB(atlas, ATL_xerbla, [], [
AC_MSG_ERROR([ATLAS is required for Kaldi (libatlas-base-dev package)])
])
])
dnl kaldi needs a C++ compiler (and a ton of other things)
AS_IF([test "x${is_kaldi_enabled}x${kaldi_from}" = xyesxsource],
[
AS_IF([test "x$CXX" = x], [
AC_MSG_ERROR([C++ compiler is required for Kaldi (build-essential package)])
])
])
dnl TODO: Snips NLU rust, cargo
]) dnl is_dependency_check_enabled
dnl ---------------------------------------------------------------------------
dnl Summary
dnl ---------------------------------------------------------------------------
dnl Prefix is NONE for some reason instead of default value
summary_prefix=$prefix
AS_IF([test "x$summary_prefix" = xNONE], [
summary_prefix=$PWD/.venv
])
AS_ECHO(["
Rhasspy configuration summary:
architecture: ${host_cpu}/${docker_arch}
prefix: ${summary_prefix}
virtualenv: ${is_virtualenv_enabled}
in-place: ${is_in_place}
language: ${RHASSPY_LANGUAGE}
wake:"])
AS_IF([test "x$is_precise_enabled" = xyes],
AS_ECHO([" mycroft precise: ${is_precise_enabled} (${precise_arch}, ${precise_from})"]),
AS_ECHO([" mycroft precise: ${is_precise_enabled}"]))
AS_ECHO([" porcupine: ${is_porcupine_enabled}"])
AS_ECHO([" snowboy: ${is_snowboy_enabled}"])
AS_IF([test "x$is_wake_pocketsphinx_enabled" = xyes],
AS_ECHO([" pocketsphinx: ${is_wake_pocketsphinx_enabled} (${pocketsphinx_from})"]),
AS_ECHO([" pocketsphinx: ${is_wake_pocketsphinx_enabled}"]))
AS_ECHO(["
speech to text:"])
AS_IF([test "x$is_stt_pocketsphinx_enabled" = xyes],
AS_ECHO([" pocketsphinx: ${is_stt_pocketsphinx_enabled} (${pocketsphinx_from})"]),
AS_ECHO([" pocketsphinx: ${is_stt_pocketsphinx_enabled}"]))
AS_IF([test "x$is_kaldi_enabled" = xyes],
AS_ECHO([" kaldi: ${is_kaldi_enabled} (${kaldi_arch}, ${kaldi_from})"]),
AS_ECHO([" kaldi: ${is_kaldi_enabled}"]))
AS_IF([test "x$is_deepspeech_enabled" = xyes],
AS_ECHO([" deepspeech: ${is_deepspeech_enabled} (${deepspeech_arch}, ${deepspeech_from})"]),
AS_ECHO([" deepspeech: ${is_deepspeech_enabled}"]))
AS_IF([test "x$is_julius_enabled" = xyes],
AS_ECHO([" julius: ${is_julius_enabled} (${julius_arch}, ${julius_from})"]),
AS_ECHO([" julius: ${is_julius_enabled}"]))
AS_ECHO(["
intent recognition:"])
AS_ECHO([" fuzzywuzzy: ${is_fuzzywuzzy_enabled}"])
AS_ECHO([" snips-nlu: ${is_snips_enabled}"])
AS_ECHO(["
training:"])
AS_IF([test "x$is_opengrm_enabled" = xyes],
AS_ECHO([" opengrm: ${is_opengrm_enabled} (${opengrm_arch}, ${opengrm_from})"]),
AS_ECHO([" opengrm: ${is_opengrm_enabled}"]))
AS_IF([test "x$is_phonetisaurus_enabled" = xyes],
AS_ECHO([" phonetisaurus: ${is_phonetisaurus_enabled} (${phonetisaurus_arch}, ${phonetisaurus_from})"]),
AS_ECHO([" phonetisaurus: ${is_phonetisaurus_enabled}"]))
AS_IF([test "x$is_kenlm_enabled" = xyes],
AS_ECHO([" kenlm: ${is_kenlm_enabled} (${kenlm_arch}, ${kenlm_from})"]),
AS_ECHO([" kenlm: ${is_kenlm_enabled}"]))
AS_ECHO([""])
dnl ---------------------------------------------------------------------------
dnl Output
dnl ---------------------------------------------------------------------------
AC_SUBST([VIRTUALENV], [$is_virtualenv_enabled])
AC_SUBST([DOCKER_ARCH], [$docker_arch])
AC_SUBST([PRECISE_ARCH], [$precise_arch])
AC_SUBST([ENABLE_PRECISE], [$is_precise_enabled])
AC_SUBST([PRECISE_FROM], [$precise_from])
AC_SUBST([ENABLE_SNOWBOY], [$is_snowboy_enabled])
AC_SUBST([ENABLE_PORCUPINE], [$is_porcupine_enabled])
AC_SUBST([ENABLE_POCKETSPHINX], [$is_pocketsphinx_enabled])
AC_SUBST([ENABLE_WAKE_POCKETSPHINX], [$is_wake_pocketsphinx_enabled])
AC_SUBST([ENABLE_STT_POCKETSPHINX], [$is_stt_pocketsphinx_enabled])
AC_SUBST([POCKETSPHINX_FROM], [$pocketsphinx_from])
AC_SUBST([KALDI_ARCH], [$kaldi_arch])
AC_SUBST([ENABLE_KALDI], [$is_kaldi_enabled])
AC_SUBST([KALDI_FROM], [$kaldi_from])
AC_SUBST([JULIUS_ARCH], [$julius_arch])
AC_SUBST([ENABLE_JULIUS], [$is_julius_enabled])
AC_SUBST([JULIUS_FROM], [$julius_from])
AC_SUBST([DEEPSPEECH_ARCH], [$deepspeech_arch])
AC_SUBST([ENABLE_DEEPSPEECH], [$is_deepspeech_enabled])
AC_SUBST([DEEPSPEECH_FROM], [$deepspeech_from])
AC_SUBST([ENABLE_FUZZYWUZZY], [$is_fuzzywuzzy_enabled])
AC_SUBST([ENABLE_SNIPS], [$is_snips_enabled])
AC_SUBST([OPENGRM_ARCH], [$opengrm_arch])
AC_SUBST([ENABLE_OPENGRM], [$is_opengrm_enabled])
AC_SUBST([OPENGRM_FROM], [$opengrm_from])
AC_SUBST([PHONETISAURUS_ARCH], [$phonetisaurus_arch])
AC_SUBST([ENABLE_PHONETISAURUS], [$is_phonetisaurus_enabled])
AC_SUBST([PHONETISAURUS_FROM], [$phonetisaurus_from])
AC_SUBST([KENLM_ARCH], [$kenlm_arch])
AC_SUBST([ENABLE_KENLM], [$is_kenlm_enabled])
AC_SUBST([KENLM_FROM], [$kenlm_from])
AC_SUBST([IN_PLACE], [$is_in_place])
AC_OUTPUT

508
install-sh Executable file
View File

@@ -0,0 +1,508 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2014-09-12.12; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# $RANDOM is not portable (e.g. dash); use it when possible to
# lower collision chance
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# As "mkdir -p" follows symlinks and we work in /tmp possibly; so
# create the $tmpdir first (and fail if unsuccessful) to make sure
# that nobody tries to guess the $tmpdir name.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

646
m4/python.m4 Normal file
View File

@@ -0,0 +1,646 @@
# Copyright 2012, 2013, 2014 Brandon Invergo <brandon@invergo.net>
#
# This file is part of pyconfigure. This program is free
# software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Under Section 7 of GPL version 3, you are granted additional
# permissions described in the Autoconf Configure Script Exception,
# version 3.0, as published by the Free Software Foundation.
#
# You should have received a copy of the GNU General Public License
# and a copy of the Autoconf Configure Script Exception along with
# this program; see the files COPYINGv3 and COPYING.EXCEPTION
# respectively. If not, see <http://www.gnu.org/licenses/>.
# Many of these macros were adapted from ones written by Andrew Dalke
# and James Henstridge and are included with the Automake utility
# under the following copyright terms:
#
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# Table of Contents:
#
# 1. Language selection
# and routines to produce programs in a given language.
#
# 2. Producing programs in a given language.
#
# 3. Looking for a compiler
# And possibly the associated preprocessor.
#
# 4. Looking for specific libs & functionality
## ----------------------- ##
## 1. Language selection. ##
## ----------------------- ##
# AC_LANG(Python)
# ---------------
AC_LANG_DEFINE([Python], [py], [PY], [PYTHON], [],
[ac_ext=py
ac_compile='chmod +x conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
ac_link='chmod +x conftest.$ac_ext && cp conftest.$ac_ext conftest >&AS_MESSAGE_LOG_FD'
])
# AC_LANG_PYTHON
# --------------
AU_DEFUN([AC_LANG_PYTHON], [AC_LANG(Python)])
## ----------------------- ##
## 2. Producing programs. ##
## ----------------------- ##
# AC_LANG_PROGRAM(Python)([PROLOGUE], [BODY])
# -------------------------------------------
m4_define([AC_LANG_PROGRAM(Python)], [dnl
@%:@!$PYTHON
$1
m4_if([$2], [], [], [dnl
if __name__ == '__main__':
$2])])
# _AC_LANG_IO_PROGRAM(Python)
# ---------------------------
# Produce source that performs I/O.
m4_define([_AC_LANG_IO_PROGRAM(Python)],
[AC_LANG_PROGRAM([dnl
import sys
try:
h = open('conftest.out')
except:
sys.exit(1)
else:
close(h)
sys.exit(0)
], [])])
# _AC_LANG_CALL(Python)([PROLOGUE], [FUNCTION])
# ---------------------
# Produce source that calls FUNCTION
m4_define([_AC_LANG_CALL(Python)],
[AC_LANG_PROGRAM([$1], [$2])])
## -------------------------------------------- ##
## 3. Looking for Compilers and Interpreters. ##
## -------------------------------------------- ##
AC_DEFUN([AC_LANG_COMPILER(Python)],
[AC_REQUIRE([PC_PROG_PYTHON])])
# PC_INIT([MIN-VERSION], [MAX-VERSION])
# -----------------------------
# Initialize pyconfigure, finding a Python interpreter with a given
# minimum and/or maximum version.
AC_DEFUN([PC_INIT],
[PC_PROG_PYTHON([], [$1], [$2])
dnl If we found something, do a sanity check that the interpreter really
dnl has the version its name would suggest.
m4_ifval([PYTHON],
[PC_PYTHON_VERIFY_VERSION([>=], [pc_min_ver], [],
[AC_MSG_FAILURE([No compatible Python interpreter found. If you're sure that you have one, try setting the PYTHON environment variable to the location of the interpreter.])])])
m4_ifval([PYTHON],
[PC_PYTHON_VERIFY_VERSION([<=], [pc_max_ver], [],
[AC_MSG_FAILURE([No compatible Python interpreter found. If you're sure that you have one, try setting the PYTHON environment variable to the location of the interpreter.])])])
])# PC_INIT
# PC_PROG_PYTHON([PROG-TO-CHECK-FOR], [MIN-VERSION], [MAX-VERSION])
# ---------------------------------
# Find a Python interpreter. Python versions prior to 2.0 are not
# supported. (2.0 was released on October 16, 2000).
AC_DEFUN_ONCE([PC_PROG_PYTHON],
[AC_ARG_VAR([PYTHON], [the Python interpreter])
dnl The default minimum version is 2.0
m4_define_default([pc_min_ver], m4_ifval([$2], [$2], [2.0]))
dnl The default maximum version is 3.3
m4_define_default([pc_max_ver], m4_ifval([$3], [$3], [4.0]))
dnl Build up a list of possible interpreter names.
m4_define_default([_PC_PYTHON_INTERPRETER_LIST],
[dnl If we want some Python 3 versions (max version >= 3.0),
dnl also search for "python3"
m4_if(m4_version_compare(pc_max_ver, [2.9]), [1], [python3], []) \
dnl If we want some Python 2 versions (min version <= 2.7),
dnl also search for "python2".
m4_if(m4_version_compare(pc_min_ver, [2.8]), [-1], [python2], []) \
dnl Construct a comma-separated list of interpreter names (python2.6,
dnl python2.7, etc). We only care about the first 3 characters of the
dnl version strings (major-dot-minor; not
dnl major-dot-minor-dot-bugfix[-dot-whatever])
m4_foreach([pc_ver],
m4_esyscmd_s(seq -s[[", "]] -f["[[%.1f]]"] m4_substr(pc_max_ver, [0], [3]) -0.1 m4_substr(pc_min_ver, [0], [3])),
dnl Remove python2.8 and python2.9 since they will never exist
[m4_bmatch(pc_ver, [2.[89]], [], [python]pc_ver)]) \
[python]])
dnl Do the actual search at last.
m4_ifval([$1],
[AC_PATH_PROGS(PYTHON, [$1 _PC_PYTHON_INTERPRETER_LIST])],
[AC_PATH_PROGS(PYTHON, [_PC_PYTHON_INTERPRETER_LIST])])
])# PC_PROG_PYTHON
# PC_PYTHON_PROG_PYTHON_CONFIG(PROG-TO-CHECK-FOR)
# ----------------------------------------------
# Find the python-config program
AC_DEFUN([PC_PYTHON_PROG_PYTHON_CONFIG],
[AC_REQUIRE([PC_PROG_PYTHON])[]dnl
AC_ARG_VAR([PYTHON_CONFIG], [the Python-config program])
dnl python-config's binary name is normally based on the Python interpreter's
dnl binary name (i.e. python2.7 -> python2.7-config)
m4_define([_PYTHON_BASENAME], [`basename $PYTHON`])
m4_ifval([$1],
[AC_PATH_PROGS(PYTHON_CONFIG, [$1 _PYTHON_BASENAME-config])],
[AC_PATH_PROG(PYTHON_CONFIG, _PYTHON_BASENAME-config)])
]) # PC_PYTHON_PROG_PYTHON_CONFIG
# PC_PYTHON_VERIFY_VERSION([RELATION], [VERSION], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
# ---------------------------------------------------------------------------
# Run ACTION-IF-TRUE if the Python interpreter PROG has version [RELATION] VERSION.
# i.e if RELATION is "<", check if PROG has a version number less than VERSION.
# Run ACTION-IF-FALSE otherwise.
# Specify RELATION as any mathematical comparison "<", ">", "<=", ">=", "==" or "!="
# This test uses sys.hexversion instead of the string equivalent (first
# word of sys.version), in order to cope with versions such as 2.2c1.
# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
AC_DEFUN([PC_PYTHON_VERIFY_VERSION],
[m4_define([pc_python_safe_ver], m4_bpatsubsts($2, [\.], [_]))
AC_CACHE_CHECK([if Python $1 '$2'],
[[pc_cv_python_req_version_]pc_python_safe_ver],
[AC_LANG_PUSH(Python)[]dnl
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([dnl
import sys
], [dnl
# split strings by '.' and convert to numeric. Append some zeros
# because we need at least 4 digits for the hex conversion.
# map returns an iterator in Python 3.0 and a list in 2.x
reqver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
reqverhex = 0
# xrange is not present in Python 3.0 and range returns an iterator
for i in list(range(4)):
reqverhex = (reqverhex << 8) + reqver[[i]]
# the final 8 bits are "0xf0" for final versions, which are all
# we'll test against, since it's doubtful that a released software
# will depend on an alpha- or beta-state Python.
reqverhex += 0xf0
if sys.hexversion $1 reqverhex:
sys.exit()
else:
sys.exit(1)
])],
[[pc_cv_python_req_version_]pc_python_safe_ver=yes],
[[pc_cv_python_req_version_]pc_python_safe_ver=no])
AC_LANG_POP(Python)[]dnl
])
AS_IF([test "$[pc_cv_python_req_version_]pc_python_safe_ver" = "no"], [$4], [$3])
])# PC_PYTHON_VERIFY_VERSION
# PC_PYTHON_CHECK_VERSION
# -----------------------
# Query Python for its version number. Getting [:3] seems to be
# the best way to do this; it's what "site.py" does in the standard
# library.
AC_DEFUN([PC_PYTHON_CHECK_VERSION],
[AC_REQUIRE([PC_PROG_PYTHON])[]dnl
AC_CACHE_CHECK([for $1 version],
[pc_cv_python_version],
[AC_LANG_PUSH(Python)[]dnl
AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
import sys
], [dnl
sys.stdout.write(sys.version[[:3]])
])],
[pc_cv_python_version=`./conftest`],
[AC_MSG_FAILURE([failed to run Python program])])
AC_LANG_POP(Python)[]dnl
])
AC_SUBST([PYTHON_VERSION], [$pc_cv_python_version])
])# PC_PYTHON_CHECK_VERSION
# PC_PYTHON_CHECK_PREFIX
# ----------------------
# Use the value of $prefix for the corresponding value of
# PYTHON_PREFIX. This is made a distinct variable so it can be
# overridden if need be. However, general consensus is that you
# shouldn't need this ability.
AC_DEFUN([PC_PYTHON_CHECK_PREFIX],
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
dnl Try to get it with python-config otherwise do it from within Python
AC_CACHE_CHECK([for Python prefix], [pc_cv_python_prefix],
[if test -x "$PYTHON_CONFIG"; then
pc_cv_python_prefix=`$PYTHON_CONFIG --prefix 2>&AS_MESSAGE_LOG_FD`
else
AC_LANG_PUSH(Python)[]dnl
AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
import sys
], [dnl
sys.stdout.write(sys.prefix)
])], [pc_cv_python_prefix=`./conftest`;
if test $? != 0; then
AC_MSG_FAILURE([could not determine Python prefix])
fi],
[AC_MSG_FAILURE([failed to run Python program])])
AC_LANG_POP(Python)[]dnl
fi])
AC_SUBST([PYTHON_PREFIX], [$pc_cv_python_prefix])])
# PC_PYTHON_CHECK_EXEC_PREFIX
# --------------------------
# Like above, but for $exec_prefix
AC_DEFUN([PC_PYTHON_CHECK_EXEC_PREFIX],
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
dnl Try to get it with python-config otherwise do it from within Python
AC_CACHE_CHECK([for Python exec-prefix], [pc_cv_python_exec_prefix],
[if test -x "$PYTHON_CONFIG"; then
pc_cv_python_exec_prefix=`$PYTHON_CONFIG --exec-prefix 2>&AS_MESSAGE_LOG_FD`
else
AC_LANG_PUSH(Python)[]dnl
AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
import sys
], [dnl
sys.stdout.write(sys.exec_prefix)
])],
[pc_cv_python_exec_prefix=`./conftest`;
if test $? != 0; then
AC_MSG_FAILURE([could not determine Python exec_prefix])
fi],
[AC_MSG_FAILURE([failed to run Python program])])
AC_LANG_POP(Python)[]dnl
fi
])
AC_SUBST([PYTHON_EXEC_PREFIX], [$pc_cv_python_exec_prefix])])
# PC_PYTHON_CHECK_INCLUDES
# ------------------------
# Find the Python header file include flags (ie
# '-I/usr/include/python')
AC_DEFUN([PC_PYTHON_CHECK_INCLUDES],
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
dnl Try to find the headers location with python-config otherwise guess
AC_CACHE_CHECK([for Python includes], [pc_cv_python_includes],
[if test -x "$PYTHON_CONFIG"; then
pc_cv_python_includes=`$PYTHON_CONFIG --includes 2>&AS_MESSAGE_LOG_FD`
else
pc_cv_python_includes="[-I$includedir/$_PYTHON_BASENAME]m4_ifdef(PYTHON_ABI_FLAGS,
PYTHON_ABI_FLAGS,)"
fi
])
AC_SUBST([PYTHON_INCLUDES], [$pc_cv_python_includes])])
# PC_PYTHON_CHECK_HEADERS([ACTION-IF-PRESENT], [ACTION-IF-ABSENT])
# -----------------------
# Check for the presence and usability of Python.h
AC_DEFUN([PC_PYTHON_CHECK_HEADERS],
[AC_REQUIRE([PC_PYTHON_CHECK_INCLUDES])[]dnl
pc_cflags_store=$CPPFLAGS
CPPFLAGS="$CFLAGS $PYTHON_INCLUDES"
AC_CHECK_HEADER([Python.h], [$1], [$2])
CPPFLAGS=$pc_cflags_store
])
# PC_PYTHON_CHECK_LIBS
# --------------------
# Find the Python lib flags (ie '-lpython')
AC_DEFUN([PC_PYTHON_CHECK_LIBS],
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
dnl Try to find the lib flags with python-config otherwise guess
AC_CACHE_CHECK([for Python libs], [pc_cv_python_libs],
[if test -x "$PYTHON_CONFIG"; then
pc_cv_python_libs=`$PYTHON_CONFIG --libs 2>&AS_MESSAGE_LOG_FD`
else
pc_cv_python_libs="[-l$_PYTHON_BASENAME]m4_ifdef(PYTHON_ABI_FLAGS, PYTHON_ABI_FLAGS,)"
fi
])
AC_SUBST([PYTHON_LIBS], [$pc_cv_python_libs])])
# PC_PYTHON_TEST_LIBS(LIBRARY-FUNCTION, [ACTION-IF-PRESENT], [ACTION-IF-ABSENT])
# -------------------
# Verify that the Python libs can be loaded
AC_DEFUN([PC_PYTHON_TEST_LIBS],
[AC_REQUIRE([PC_PYTHON_CHECK_LIBS])[]dnl
pc_libflags_store=$LIBS
for lflag in $PYTHON_LIBS; do
case $lflag in
-lpython*@:}@
LIBS="$LIBS $lflag"
pc_libpython=`echo $lflag | sed -e 's/^-l//'`
;;
*@:}@;;
esac
done
AC_CHECK_LIB([$pc_libpython], [$1], [$2], [$3])])
# PC_PYTHON_CHECK_CFLAGS
# ----------------------
# Find the Python CFLAGS
AC_DEFUN([PC_PYTHON_CHECK_CFLAGS],
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
dnl Try to find the CFLAGS with python-config otherwise give up
AC_CACHE_CHECK([for Python CFLAGS], [pc_cv_python_cflags],
[if test -x "$PYTHON_CONFIG"; then
pc_cv_python_cflags=`$PYTHON_CONFIG --cflags 2>&AS_MESSAGE_LOG_FD`
else
pc_cv_python_cflags=
fi
])
AC_SUBST([PYTHON_CFLAGS], [$pc_cv_python_cflags])])
# PC_PYTHON_CHECK_LDFLAGS
# -----------------------
# Find the Python LDFLAGS
AC_DEFUN([PC_PYTHON_CHECK_LDFLAGS],
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
dnl Try to find the LDFLAGS with python-config otherwise give up
AC_CACHE_CHECK([for Python LDFLAGS], [pc_cv_python_ldflags],
[if test -x "$PYTHON_CONFIG"; then
pc_cv_python_ldflags=`$PYTHON_CONFIG --ldflags 2>&AS_MESSAGE_LOG_FD`
else
pc_cv_python_ldflags=
fi
])
AC_SUBST([PYTHON_LDFLAGS], [$pc_cv_python_ldflags])])
# PC_PYTHON_CHECK_EXTENSION_SUFFIX
# --------------------------------
# Find the Python extension suffix (i.e. '.cpython-32.so')
AC_DEFUN([PC_PYTHON_CHECK_EXTENSION_SUFFIX],
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
dnl Try to find the suffix with python-config otherwise give up
AC_CACHE_CHECK([for Python extension suffix], [pc_cv_python_extension_suffix],
[if test -x "$PYTHON_CONFIG"; then
pc_cv_python_extension_suffix=`$PYTHON_CONFIG --extension-suffix 2>&AS_MESSAGE_LOG_FD`
else
pc_cv_python_extension_suffix=
fi
])
AC_SUBST([PYTHON_EXTENSION_SUFFIX], [$pc_cv_python_extension_suffix])])
# PC_PYTHON_CHECK_ABI_FLAGS
# -------------------------
# Find the Python ABI flags
AC_DEFUN([PC_PYTHON_CHECK_ABI_FLAGS],
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
dnl Try to find the ABI flags with python-config otherwise give up
AC_CACHE_CHECK([for Python ABI flags], [pc_cv_python_abi_flags],
[if test -x "$PYTHON_CONFIG"; then
pc_cv_python_abi_flags=`$PYTHON_CONFIG --abiflags 2>&AS_MESSAGE_LOG_FD`
else
pc_cv_python_abi_flags=
fi
])
AC_SUBST([PYTHON_ABI_FLAGS], [$pc_cv_python_abi_flags])])
# PC_PYTHON_CHECK_PLATFORM
# ------------------------
# At times (like when building shared libraries) you may want
# to know which OS platform Python thinks this is.
AC_DEFUN([PC_PYTHON_CHECK_PLATFORM],
[AC_REQUIRE([PC_PROG_PYTHON])[]dnl
dnl Get the platform from within Python (sys.platform)
AC_CACHE_CHECK([for Python platform], [pc_cv_python_platform],
[AC_LANG_PUSH(Python)[]dnl
AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
import sys
], [dnl
sys.stdout.write(sys.platform)
])], [pc_cv_python_platform=`./conftest`;
if test $? != 0; then
AC_MSG_FAILURE([could not determine Python platform])
fi],
[AC_MSG_FAILURE([failed to run Python program])])
AC_LANG_POP(Python)[]dnl
])
AC_SUBST([PYTHON_PLATFORM], [$pc_cv_python_platform])
])
# PC_PYTHON_CHECK_SITE_DIR
# ---------------------
# The directory to which new libraries are installed (i.e. the
# "site-packages" directory.
AC_DEFUN([PC_PYTHON_CHECK_SITE_DIR],
[AC_REQUIRE([PC_PROG_PYTHON])AC_REQUIRE([PC_PYTHON_CHECK_PREFIX])[]dnl
AC_CACHE_CHECK([for Python site-packages directory],
[pc_cv_python_site_dir],
[AC_LANG_PUSH(Python)[]dnl
if test "x$prefix" = xNONE
then
pc_py_prefix=$ac_default_prefix
else
pc_py_prefix=$prefix
fi
AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
import sys
from platform import python_implementation
# sysconfig in CPython 2.7 doesn't work in virtualenv
# <https://github.com/pypa/virtualenv/issues/118>
try:
import sysconfig
except:
can_use_sysconfig = False
else:
can_use_sysconfig = True
if can_use_sysconfig:
if python_implementation() == "CPython" and sys.version[[:3]] == '2.7':
can_use_sysconfig = False
if not can_use_sysconfig:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(False, False, prefix='$pc_py_prefix')
else:
sitedir = sysconfig.get_path('purelib', vars={'base':'$pc_py_prefix'})
], [dnl
sys.stdout.write(sitedir)
])], [pc_cv_python_site_dir=`./conftest`],
[AC_MSG_FAILURE([failed to run Python program])])
AC_LANG_POP(Python)[]dnl
case $pc_cv_python_site_dir in
$pc_py_prefix*)
pc__strip_prefix=`echo "$pc_py_prefix" | sed 's|.|.|g'`
pc_cv_python_site_dir=`echo "$pc_cv_python_site_dir" | sed "s,^$pc__strip_prefix/,,"`
;;
*)
case $pc_py_prefix in
/usr|/System*) ;;
*)
pc_cv_python_site_dir=lib/python$PYTHON_VERSION/site-packages
;;
esac
;;
esac
])
AC_SUBST([pythondir], [\${prefix}/$pc_cv_python_site_dir])])# PC_PYTHON_CHECK_SITE_DIR
# PC_PYTHON_SITE_PACKAGE_DIR
# --------------------------
# $PACKAGE directory under PYTHON_SITE_DIR
AC_DEFUN([PC_PYTHON_SITE_PACKAGE_DIR],
[AC_REQUIRE([PC_PYTHON_CHECK_SITE_DIR])[]dnl
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE_NAME])])
# PC_PYTHON_CHECK_EXEC_DIR
# ------------------------
# directory for installing python extension modules (shared libraries)
AC_DEFUN([PC_PYTHON_CHECK_EXEC_DIR],
[AC_REQUIRE([PC_PROG_PYTHON])AC_REQUIRE([PC_PYTHON_CHECK_EXEC_PREFIX])[]dnl
AC_CACHE_CHECK([for Python extension module directory],
[pc_cv_python_exec_dir],
[AC_LANG_PUSH(Python)[]dnl
if test "x$pc_cv_python_exec_prefix" = xNONE
then
pc_py_exec_prefix=$pc_cv_python_prefix
else
pc_py_exec_prefix=$pc_cv_python_exec_prefix
fi
AC_LINK_IFELSE([AC_LANG_PROGRAM([dnl
import sys
from platform import python_implementation
# sysconfig in CPython 2.7 doesn't work in virtualenv
# <https://github.com/pypa/virtualenv/issues/118>
try:
import sysconfig
except:
can_use_sysconfig = False
else:
can_use_sysconfig = True
if can_use_sysconfig:
if python_implementation() == "CPython" and sys.version[[:3]] == '2.7':
can_use_sysconfig = False
if not can_use_sysconfig:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(False, False, prefix='$pc_py__exec_prefix')
else:
sitedir = sysconfig.get_path('purelib', vars={'platbase':'$pc_py_exec_prefix'})
], [dnl
sys.stdout.write(sitedir)
])], [pc_cv_python_exec_dir=`./conftest`],
[AC_MSG_FAILURE([failed to run Python program])])
AC_LANG_POP(Python)[]dnl
case $pc_cv_python_exec_dir in
$pc_py_exec_prefix*)
pc__strip_prefix=`echo "$pc_py_exec_prefix" | sed 's|.|.|g'`
pc_cv_python_exec_dir=`echo "$pc_cv_python_exec_dir" | sed "s,^$pc__strip_prefix/,,"`
;;
*)
case $pc_py_exec_prefix in
/usr|/System*) ;;
*)
pc_cv_python_exec_dir=lib/python$PYTHON_VERSION/site-packages
;;
esac
;;
esac
])
AC_SUBST([pyexecdir], [\${exec_prefix}/$pc_cv_python_pyexecdir])]) #PY_PYTHON_CHECK_EXEC_LIB_DIR
# PC_PYTHON_EXEC_PACKAGE_DIR
# --------------------------
# $PACKAGE directory under PYTHON_SITE_DIR
AC_DEFUN([PC_PYTHON_EXEC_PACKAGE_DIR],
[AC_REQUIRE([PC_PYTHON_CHECK_EXEC_DIR])[]dnl
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE_NAME])])
## -------------------------------------------- ##
## 4. Looking for specific libs & functionality ##
## -------------------------------------------- ##
# PC_PYTHON_CHECK_MODULE(LIBRARY, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ----------------------------------------------------------------------
# Macro for checking if a Python library is installed
AC_DEFUN([PC_PYTHON_CHECK_MODULE],
[AC_REQUIRE([PC_PROG_PYTHON])[]dnl
m4_define([pc_python_safe_mod], m4_bpatsubsts($1, [\.], [_]))
AC_CACHE_CHECK([for Python '$1' library],
[[pc_cv_python_module_]pc_python_safe_mod],
[AC_LANG_PUSH(Python)[]dnl
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([dnl
import sys
try:
import $1
except:
sys.exit(1)
else:
sys.exit(0)
], [])],
[[pc_cv_python_module_]pc_python_safe_mod="yes"],
[[pc_cv_python_module_]pc_python_safe_mod="no"])
AC_LANG_POP(Python)[]dnl
])
AS_IF([test "$[pc_cv_python_module_]pc_python_safe_mod" = "no"], [$3], [$2])
])# PC_PYTHON_CHECK_MODULE
# PC_PYTHON_CHECK_FUNC([LIBRARY], FUNCTION, ARGS, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------------------------
# Check to see if a given function call, optionally from a module, can
# be successfully called
AC_DEFUN([PC_PYTHON_CHECK_FUNC],
[AC_REQUIRE([PC_PROG_PYTHON])[]dnl
m4_define([pc_python_safe_mod], m4_bpatsubsts($1, [\.], [_]))
AC_CACHE_CHECK([for Python m4_ifnblank($1, '$1.$2()', '$2()') function],
[[pc_cv_python_func_]pc_python_safe_mod[_$2]],
[AC_LANG_PUSH(Python)[]dnl
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([dnl
import sys
m4_ifnblank([$1], [dnl
try:
import $1
except:
sys.exit(1)
], [])],
[
m4_ifnblank([$1], [
try:
$1.$2($3)], [
try:
$2($3)])
except:
sys.exit(1)
else:
sys.exit(0)
])],
[[pc_cv_python_func_]pc_python_safe_mod[_$2]="yes"],
[[pc_cv_python_func_]pc_python_safe_mod[_$2]="no"])
AC_LANG_POP(Python)[]dnl
])
AS_IF([test "$[pc_cv_python_func_]pc_python_safe_mod[_$2]" = "no"], [$5], [$4])
])# PC_PYTHON_CHECK_FUNC

215
missing Executable file
View File

@@ -0,0 +1,215 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
scriptversion=2013-10-28.13; # UTC
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try '$0 --help' for more information"
exit 1
fi
case $1 in
--is-lightweight)
# Used by our autoconf macros to check whether the available missing
# script is modern enough.
exit 0
;;
--run)
# Back-compat with the calling convention used by older automake.
shift
;;
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due
to PROGRAM being missing or too old.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
Supported PROGRAM values:
aclocal autoconf autoheader autom4te automake makeinfo
bison yacc flex lex help2man
Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and
'g' are ignored when checking the name.
Send bug reports to <bug-automake@gnu.org>."
exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
exit $?
;;
-*)
echo 1>&2 "$0: unknown '$1' option"
echo 1>&2 "Try '$0 --help' for more information"
exit 1
;;
esac
# Run the given program, remember its exit status.
"$@"; st=$?
# If it succeeded, we are done.
test $st -eq 0 && exit 0
# Also exit now if we it failed (or wasn't found), and '--version' was
# passed; such an option is passed most likely to detect whether the
# program is present and works.
case $2 in --version|--help) exit $st;; esac
# Exit code 63 means version mismatch. This often happens when the user
# tries to use an ancient version of a tool on a file that requires a
# minimum version.
if test $st -eq 63; then
msg="probably too old"
elif test $st -eq 127; then
# Program was missing.
msg="missing on your system"
else
# Program was found and executed, but failed. Give up.
exit $st
fi
perl_URL=http://www.perl.org/
flex_URL=http://flex.sourceforge.net/
gnu_software_URL=http://www.gnu.org/software
program_details ()
{
case $1 in
aclocal|automake)
echo "The '$1' program is part of the GNU Automake package:"
echo "<$gnu_software_URL/automake>"
echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/autoconf>"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
autoconf|autom4te|autoheader)
echo "The '$1' program is part of the GNU Autoconf package:"
echo "<$gnu_software_URL/autoconf/>"
echo "It also requires GNU m4 and Perl in order to run:"
echo "<$gnu_software_URL/m4/>"
echo "<$perl_URL>"
;;
esac
}
give_advice ()
{
# Normalize program name to check for.
normalized_program=`echo "$1" | sed '
s/^gnu-//; t
s/^gnu//; t
s/^g//; t'`
printf '%s\n' "'$1' is $msg."
configure_deps="'configure.ac' or m4 files included by 'configure.ac'"
case $normalized_program in
autoconf*)
echo "You should only need it if you modified 'configure.ac',"
echo "or m4 files included by it."
program_details 'autoconf'
;;
autoheader*)
echo "You should only need it if you modified 'acconfig.h' or"
echo "$configure_deps."
program_details 'autoheader'
;;
automake*)
echo "You should only need it if you modified 'Makefile.am' or"
echo "$configure_deps."
program_details 'automake'
;;
aclocal*)
echo "You should only need it if you modified 'acinclude.m4' or"
echo "$configure_deps."
program_details 'aclocal'
;;
autom4te*)
echo "You might have modified some maintainer files that require"
echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
echo "You should only need it if you modified a '.y' file."
echo "You may want to install the GNU Bison package:"
echo "<$gnu_software_URL/bison/>"
;;
lex*|flex*)
echo "You should only need it if you modified a '.l' file."
echo "You may want to install the Fast Lexical Analyzer package:"
echo "<$flex_URL>"
;;
help2man*)
echo "You should only need it if you modified a dependency" \
"of a man page."
echo "You may want to install the GNU Help2man package:"
echo "<$gnu_software_URL/help2man/>"
;;
makeinfo*)
echo "You should only need it if you modified a '.texi' file, or"
echo "any other file indirectly affecting the aspect of the manual."
echo "You might want to install the Texinfo package:"
echo "<$gnu_software_URL/texinfo/>"
echo "The spurious makeinfo call might also be the consequence of"
echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might"
echo "want to install GNU make:"
echo "<$gnu_software_URL/make/>"
;;
*)
echo "You might have modified some files without having the proper"
echo "tools for further handling them. Check the 'README' file, it"
echo "often tells you about the needed prerequisites for installing"
echo "this package. You may also peek at any GNU archive site, in"
echo "case some other package contains this missing '$1' program."
;;
esac
}
give_advice "$1" | sed -e '1s/^/WARNING: /' \
-e '2,$s/^/ /' >&2
# Propagate the correct exit status (expected to be 127 for a program
# not found, 63 for a program that failed due to version mismatch).
exit $st
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

View File

@@ -8,7 +8,6 @@ networkx==2.4
num2words==0.5.10
paho-mqtt==1.5.0
pocketsphinx==0.1.15
precise-runner==0.3.1
PyAudio==0.2.11
pydash==4.7.6
pyyaml==5.3

18
rhasspy.sh.in Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
prefix="@prefix@"
virtualenv="@VIRTUALENV@"
export RHASSPY_BASE_DIR="${prefix}/share/rhasspy"
export RHASSPY_WEB_DIR="${RHASSPY_BASE_DIR}/web"
if [[ "${virtualenv}" = 'yes' ]]; then
echo "Using virtual environment at ${prefix}"
# Use virtual environment
source "${prefix}/bin/activate"
fi
export LD_LIBRARY_PATH="${prefix}/lib:${LD_LIBRARY_PATH}"
export PATH="${prefix}/bin:${PATH}"
export KALDI_DIR="${prefix}/lib/kaldi"
rhasspy-voltron "$@"

0
rhasspy/py.typed Normal file
View File

View File

@@ -14,29 +14,9 @@ mkdir -p "${dist_dir}"
rm -f "${dist_dir}/"rhasspy*
# Make dependent libraries
while read -r lib_name;
do
echo "${lib_name}"
cd "${src_dir}/${lib_name}" && python3 setup.py sdist --dist-dir "${dist_dir}"
echo ""
done < "${src_dir}/RHASSPY_LIBRARIES"
# Special cases
for lib_name in 'rhasspy-asr-kaldi' 'rhasspy-asr-pocketsphinx';
do
cd "${src_dir}/${lib_name}" && \
make dist && \
cp "dist"/*.whl "${dist_dir}/"
done
# -----------------------------------------------------------------------------
# Copy to submodule download directories
while read -r dir_name;
do
echo "${src_dir}/${dir_name}/download"
cd "${src_dir}/${dir_name}" && \
mkdir -p download && \
rm -f download/rhasspy* && \
cp -f "${dist_dir}"/rhasspy* download/
echo "${dir_name}"
cd "${src_dir}/${dir_name}" && python3 setup.py sdist --dist-dir "${dist_dir}"
echo ""
done < "${src_dir}/RHASSPY_DIRS"

30
scripts/build/build-julius.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
set -e
: "${MAKE_THREADS=4}"
if [[ -z "$3" ]]; then
echo "Usage: build-julius julius.tar.gz build/ output.tar.gz"
exit 1
fi
julius_src="$(realpath "$1")"
build_dir="$(realpath "$2")"
output_file="$(realpath "$3")"
# Julius
julius_build="${build_dir}/julius"
echo "Building Julius in ${julius_build} from ${julius_src}"
mkdir -p "${julius_build}"
tar -C "${julius_build}" --strip-components=1 -xf "${julius_src}"
cd "${julius_build}" && \
mkdir -p build && \
./configure "--prefix=${julius_build}/build" && \
make -j "${MAKE_THREADS}" && \
make install
# Strip binaries
echo "Tar-ing binary files to ${output_file}"
cd "${julius_build}/build/bin" && \
(strip --strip-unneeded -- * || true) && \
tar -czf "${output_file}" -- *

53
scripts/build/build-kaldi.sh Executable file
View File

@@ -0,0 +1,53 @@
#!/usr/bin/env bash
set -e
: "${MAKE_THREADS=4}"
if [[ -z "$3" ]]; then
echo "Usage: build-kaldi kaldi.tar.gz build/ output.tar.gz"
exit 1
fi
kaldi_src="$(realpath "$1")"
build_dir="$(realpath "$2")"
output_file="$(realpath "$3")"
# Kaldi
kaldi_build="${build_dir}/kaldi"
echo "Building Kaldi in ${kaldi_build} from ${kaldi_src}"
mkdir -p "${kaldi_build}"
tar -C "${kaldi_build}" --strip-components=1 -xf "${kaldi_src}"
cd "${kaldi_build}/tools" && \
make -j "${MAKE_THREADS}"
cd "${kaldi_build}/src" && \
./configure --shared --mathlib=ATLAS --use-cuda=no
# Fix things for aarch64 (arm64v8)
if [ "$(uname --m)" = "aarch64" ]; then
sed -i 's/-msse -msse2/-ftree-vectorize/g' "${kaldi_build}/src/kaldi.mk"
fi
cd "${kaldi_build}/src" && \
make depend -j "${MAKE_THREADS}" && \
make -j "${MAKE_THREADS}"
# Create dist
dist_dir="${kaldi_build}/dist"
mkdir -p "${dist_dir}/kaldi/egs" && \
cp -R "${kaldi_build}/egs/wsj" "${dist_dir}/kaldi/egs/" && \
rsync -av --exclude='*.o' --exclude='*.cc' "${kaldi_build}/src/bin/" "${dist_dir}/kaldi/" && \
cp "${kaldi_build}/src/lib"/*.so* "${dist_dir}/kaldi/" && \
rsync -av --include='*.so*' --include='fst' --exclude='*' "${kaldi_build}/tools/openfst/lib/" "${dist_dir}/kaldi/" && \
cp "${kaldi_build}/tools/openfst/bin/" "${dist_dir}/kaldi/"
# Fix rpaths
# shellcheck disable=SC2016
find "${dist_dir}/kaldi/" -type f -exec patchelf --set-rpath '$ORIGIN' {} \;
# Strip binaries
echo "Tar-ing binary files to ${output_file}"
cd "${dist_dir}" && \
(strip --strip-unneeded kaldi/* || true) && \
tar -czf "${output_file}" kaldi

42
scripts/build/build-kenlm.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -e
: "${MAKE_THREADS=4}"
if [[ -z "$4" ]]; then
echo "Usage: build-kenlm kenlm.tar.gz eigen.tar.gz build/ output.tar.gz"
exit 1
fi
kenlm_src="$(realpath "$1")"
eigen_src="$(realpath "$2")"
build_dir="$(realpath "$3")"
output_file="$(realpath "$4")"
# Eigen
eigen_build="${build_dir}/eigen"
echo "Building eigen in ${eigen_build} from ${eigen_src}"
mkdir -p "${eigen_build}"
tar -C "${eigen_build}" --strip-components=1 -xf "${eigen_src}"
cd "${eigen_build}" && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j "${MAKE_THREADS}"
# KenLM
kenlm_build="${build_dir}/kenlm"
echo "Building KenLM in ${kenlm_build} from ${kenlm_src}"
mkdir -p "${kenlm_build}"
tar -C "${kenlm_build}" --strip-components=1 -xf "${kenlm_src}"
cd "${kenlm_build}" && \
mkdir -p build && \
cd build && \
cmake .. && \
make -j "${MAKE_THREADS}"
# Strip binaries
echo "Tar-ing binary files to ${output_file}"
cd "${kenlm_build}/build/bin" && \
(strip --strip-unneeded -- * || true) && \
tar -czf "${output_file}" -- *

45
scripts/build/build-opengrm.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
set -e
: "${MAKE_THREADS=4}"
if [[ -z "$4" ]]; then
echo "Usage: build-opengrm opengrm.tar.gz openfst.tar.gz build/ output.tar.gz"
exit 1
fi
opengrm_src="$(realpath "$1")"
openfst_src="$(realpath "$2")"
build_dir="$(realpath "$3")"
output_file="$(realpath "$4")"
# OpenFST
openfst_build="${build_dir}/opengrm/openfst"
echo "Building OpenFST in ${openfst_build} from ${openfst_src}"
mkdir -p "${openfst_build}"
tar -C "${openfst_build}" --strip-components=1 -xf "${openfst_src}"
cd "${openfst_build}" && \
mkdir -p build && \
./configure "--prefix=${openfst_build}/build" --enable-far && \
make -j "${MAKE_THREADS}" && \
make install
# Opengrm
opengrm_build="${build_dir}/opengrm"
echo "Building Opengrm in ${opengrm_build} from ${opengrm_src}"
mkdir -p "${opengrm_build}"
tar -C "${opengrm_build}" --strip-components=1 -xf "${opengrm_src}"
cd "${opengrm_build}" && \
mkdir -p build && \
CXXFLAGS="-I${openfst_build}/build/include" LDFLAGS="-L${openfst_build}/build/lib" ./configure "--prefix=${opengrm_build}/build" && \
make -j "${MAKE_THREADS}" && \
make install
# Strip binaries
echo "Tar-ing binary files to ${output_file}"
cd "${opengrm_build}/build" && \
cp "${openfst_build}/build/bin"/* bin/ &&
cp "${openfst_build}/build/lib"/*.so* lib/ &&
rm -f lib/*.a lib/fst/*.a && \
(strip --strip-unneeded -- bin/* lib/* lib/fst/* || true) && \
tar -czf "${output_file}" -- *

View File

@@ -0,0 +1,47 @@
#!/usr/bin/env bash
set -e
: "${MAKE_THREADS=4}"
if [[ -z "$4" ]]; then
echo "Usage: build-phonetisaurus phonetisaurus.tar.gz openfst.tar.gz build/ output.tar.gz"
exit 1
fi
phonetisaurus_src="$(realpath "$1")"
openfst_src="$(realpath "$2")"
build_dir="$(realpath "$3")"
output_file="$(realpath "$4")"
# OpenFST
openfst_build="${build_dir}/phonetisaurus/openfst"
echo "Building OpenFST in ${openfst_build} from ${openfst_src}"
mkdir -p "${openfst_build}"
tar -C "${openfst_build}" --strip-components=1 -xf "${openfst_src}"
cd "${openfst_build}" && \
mkdir -p build && \
./configure "--prefix=${openfst_build}/build" --enable-far && \
make -j "${MAKE_THREADS}" && \
make install
# Phonetisaurus
phonetisaurus_build="${build_dir}/phonetisaurus"
echo "Building Phonetisaurus in ${phonetisaurus_build} from ${phonetisaurus_src}"
mkdir -p "${phonetisaurus_build}"
tar -C "${phonetisaurus_build}" --strip-components=1 -xf "${phonetisaurus_src}"
cd "${phonetisaurus_build}" && \
mkdir -p build && \
./configure "--prefix=${phonetisaurus_build}/build" \
"--with-openfst-includes=-I${openfst_build}/build/include" \
"--with-openfst-libs=-L${openfst_build}/build/lib" && \
make -j "${MAKE_THREADS}" && \
make install
# Strip binaries
echo "Tar-ing binary files to ${output_file}"
cd "${phonetisaurus_build}/build" && \
cp "${openfst_build}/build/bin"/* bin/ &&
cp "${openfst_build}/build/lib"/*.so* lib/ &&
rm -f lib/*.a lib/fst/*.a && \
(strip --strip-unneeded -- bin/* lib/* || true) && \
tar -czf "${output_file}" -- *

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e
if [[ -z "$2" ]]; then
echo "Usage: install-deepspeech.sh native_client.tar.xz output-dir/"
exit 1
fi
native_client="$(realpath "$1")"
output="$(realpath "$2")"
# -----------------------------------------------------------------------------
# Create a temporary directory for extraction
temp_dir="$(mktemp -d)"
function cleanup {
rm -rf "${temp_dir}"
}
trap cleanup EXIT
# -----------------------------------------------------------------------------
tar -C "${temp_dir}" -xf "${native_client}"
install -D "--target-directory=${output}/bin" -- "${temp_dir}/generate_trie" "${temp_dir}/deepspeech"
install -D "--target-directory=${output}/lib" -- "${temp_dir}"/*.so*
install -D "--target-directory=${output}/include" -- "${temp_dir}"/*.h

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
if [[ -z "$2" ]]; then
echo "Usage: install-julius.sh julius.tar.gz output-dir/"
exit 1
fi
julius="$(realpath "$1")"
output="$(realpath "$2")"
mkdir -p "${output}/bin"
tar -C "${output}/bin" -xf "${julius}"

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
if [[ -z "$2" ]]; then
echo "Usage: install-kaldi.sh kaldi.tar.gz output-dir/"
exit 1
fi
kaldi="$(realpath "$1")"
output="$(realpath "$2")"
mkdir -p "${output}/lib/kaldi"
tar -C "${output}/lib/kaldi" -xf "${kaldi}" --strip-components=1

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
if [[ -z "$2" ]]; then
echo "Usage: install-kenlm.sh kenlm.tar.gz output-dir/"
exit 1
fi
kenlm="$(realpath "$1")"
output="$(realpath "$2")"
mkdir -p "${output}/bin"
tar -C "${output}/bin" -xf "${kenlm}"

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e
if [[ -z "$2" ]]; then
echo "Usage: install-opengrm.sh opengrm.tar.gz output-dir/"
exit 1
fi
opengrm="$(realpath "$1")"
output="$(realpath "$2")"
# -----------------------------------------------------------------------------
# Create a temporary directory for extraction
temp_dir="$(mktemp -d)"
function cleanup {
rm -rf "${temp_dir}"
}
trap cleanup EXIT
# -----------------------------------------------------------------------------
tar -C "${temp_dir}" -xf "${opengrm}"
install -D "--target-directory=${output}/bin" -- "${temp_dir}/bin"/*
mkdir -p "${output}/lib"
cp -a "${temp_dir}/lib"/*.so* "${output}/lib/"
mkdir -p "${output}/lib/fst"
cp -a "${temp_dir}/lib/fst"/*.so* "${output}/lib/fst/"

View File

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -e
if [[ -z "$2" ]]; then
echo "Usage: install-phonetisaurus.sh phonetisaurus.tar.gz output-dir/"
exit 1
fi
phonetisaurus="$(realpath "$1")"
output="$(realpath "$2")"
# -----------------------------------------------------------------------------
# Create a temporary directory for extraction
temp_dir="$(mktemp -d)"
function cleanup {
rm -rf "${temp_dir}"
}
trap cleanup EXIT
# -----------------------------------------------------------------------------
tar -C "${temp_dir}" -xf "${phonetisaurus}"
install -D "--target-directory=${output}/bin" -- "${temp_dir}/bin"/*
mkdir -p "${output}/lib"
cp -a "${temp_dir}/lib"/*.so* "${output}/lib/"
mkdir -p "${output}/lib/fst"
cp -a "${temp_dir}/lib/fst"/*.so* "${output}/lib/fst/"

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -e
if [[ -z "$2" ]]; then
echo "Usage: install-precise.sh precise-engine.tar.gz output-dir/"
exit 1
fi
precise="$(realpath "$1")"
output="$(realpath "$2")"
mkdir -p "${output}/lib/precise"
tar -C "${output}/lib/precise" -xf "${precise}" --strip-components=1
ln -sf "${output}/lib/precise/precise-engine" "${output}/bin/precise-engine"

165
setup.py.in Normal file
View File

@@ -0,0 +1,165 @@
"""Setup script for Rhasspy"""
import typing
from pathlib import Path
import setuptools
this_dir = Path(__file__).parent
# -----------------------------------------------------------------------------
# Load README in as long description
long_description: str = ""
readme_path = this_dir / "README.md"
if readme_path.is_file():
long_description = readme_path.read_text()
# -----------------------------------------------------------------------------
def to_python_name(dir_name: str) -> str:
"""Convert kebab-case directory name to python module name."""
# rhasspy-asr-pocketsphinx-hermes => rhasspyasr_pocketsphinx_hermes
python_name_parts = dir_name.split("-")
return "_".join(
[python_name_parts[0] + python_name_parts[1]] + python_name_parts[2:]
)
# Build list of packages/requirements
packages: typing.Dict[str, Path] = {}
# RHASSPY_DIRS contains a list of all directories with Rhasspy libraries/services
with open(this_dir / "RHASSPY_DIRS", "r") as packages_file:
for line in packages_file:
line = line.strip()
if line:
module_dir_name = line
python_name = to_python_name(module_dir_name)
# module name -> module directory
packages[python_name] = this_dir / module_dir_name / python_name
# -----------------------------------------------------------------------------
def is_yes(s):
"""True if string is yes (from configure.ac)"""
return s.lower().strip() == "yes"
# Strip requirements for modules that were disabled during ./configure
# fuzzywuzzy
enable_fuzzywuzzy = "@ENABLE_FUZZYWUZZY@"
if not is_yes(enable_fuzzywuzzy):
packages.pop("rhasspyfuzzywuzzy-hermes")
# pocketsphinx
enable_wake_pocketsphinx = is_yes("@ENABLE_WAKE_POCKETSPHINX@")
enable_stt_pocketsphinx = is_yes("@ENABLE_STT_POCKETSPHINX@")
if not enable_wake_pocketsphinx:
packages.pop("rhasspywake_pocketsphinx_hermes")
if not enable_stt_pocketsphinx:
packages.pop("rhasspyasr_pocketsphinx_hermes")
if (not enable_wake_pocketsphinx) and (not enable_stt_pocketsphinx):
packages.pop("rhasspyasr_pocketsphinx")
# kaldi
enable_kaldi = is_yes("@ENABLE_KALDI@")
if not enable_kaldi:
packages.pop("rhasspyasr_kaldi")
packages.pop("rhasspyasr_kaldi_hermes")
# deepspeech
enable_deepspeech = is_yes("@ENABLE_DEEPSPEECH@")
if not enable_deepspeech:
packages.pop("rhasspyasr_deepspeech")
packages.pop("rhasspyasr_deepspeech_hermes")
# snowboy
enable_snowboy = is_yes("@ENABLE_SNOWBOY@")
if not enable_snowboy:
packages.pop("rhasspywake_snowboy_hermes")
# porcupine
enable_porcupine = is_yes("@ENABLE_PORCUPINE@")
if not enable_porcupine:
packages.pop("rhasspywake_porcupine_hermes")
# snips
enable_snips = is_yes("@ENABLE_SNIPS@")
if not enable_snips:
packages.pop("rhasspysnips_nlu")
packages.pop("rhasspysnips_nlu_hermes")
# -----------------------------------------------------------------------------
# True if Rhasspy Python modules will be used directly from source instead of
# being installed.
in_place = is_yes("@IN_PLACE@")
# Generate requirements from remaining packages
requirements: typing.Set[str] = set()
def add_requirements(requirements_path: Path):
"""Add requirements from a file."""
if requirements_path.is_file():
with open(requirements_path, "r") as requirements_file:
for line in requirements_file:
line = line.strip()
if line:
if in_place and line.startswith("rhasspy-"):
# Exclude Rhasspy modules if "in-place"
continue
requirements.add(line)
# Look in remaining module directories for requirements
for module_python_dir in packages.values():
# rhasspy-module-directory
module_dir = module_python_dir.parent
if in_place:
# Add development requirements for in-place install
add_requirements(module_dir / "requirements_dev.txt")
else:
# Add module as requirement
version_path = module_dir / "VERSION"
if version_path.is_file():
# Use version specified in VERSION file
module_version = version_path.read_text().strip()
requirements.add(f"{module_dir.name}=={module_version}")
else:
# Use latest version
requirements.add(module_dir.name)
# Add requirements from module
add_requirements(module_dir / "requirements.txt")
# -----------------------------------------------------------------------------
setuptools.setup(
name="@PACKAGE_NAME@",
version="@PACKAGE_VERSION@",
author="Michael Hansen",
author_email="@PACKAGE_BUGREPORT@",
url="https://github.com/rhasspy/rhasspy-voltron",
install_requires=list(requirements),
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"License :: OSI Approved :: MIT License",
],
long_description=long_description,
long_description_content_type="text/markdown",
python_requires=">=3.7",
)