Files
MicroslopSam/setup/config.sh
T

51 lines
2.1 KiB
Bash

# shellcheck shell=sh
# Shared configuration for MicroslopSam.
#
# Precedence: environment variables > setup/microslopsam.env (generated by
# setup/install.sh) > built-in defaults.
#
# Source this file near the top of every setup script:
# . "$HERE/config.sh"
#
# All values are absolute paths or tool names. Nothing here depends on the
# project living next to other checkouts, with one exception: the asset repo
# and the Flextalk archive default to sibling directories, which is how the
# development tree is laid out. Set MICROSLOP_ASSETS / MICROSLOP_FLEXTALK_DIR
# to point anywhere else.
: "${HERE:?config.sh: set HERE to the setup directory before sourcing}"
if [ -f "$HERE/microslopsam.env" ]; then
# The generated file uses ': ${VAR:=default}' lines, so values already
# present in the environment win over the file.
. "$HERE/microslopsam.env"
fi
MICROSLOP_ROOT=${MICROSLOP_ROOT:-$(CDPATH= cd -- "$HERE/.." && pwd)}
MICROSLOP_BUILD=${MICROSLOP_BUILD:-$MICROSLOP_ROOT/build}
MICROSLOP_PREFIX=${MICROSLOP_PREFIX:-$HOME/.wine-microslopsam}
MICROSLOP_ASSETS=${MICROSLOP_ASSETS:-$MICROSLOP_ROOT/../Microsoft-Sam-Mary-Mike-TruVoice-WSAPI4}
MICROSLOP_FLEXTALK_DIR=${MICROSLOP_FLEXTALK_DIR:-$MICROSLOP_ROOT/../flextalk}
MICROSLOP_SPEECH_H_DIR=${MICROSLOP_SPEECH_H_DIR:-$MICROSLOP_ROOT/third_party}
MICROSLOP_DISPLAY=${MICROSLOP_DISPLAY:-:77}
MICROSLOP_XVFB=${MICROSLOP_XVFB:-Xvfb}
MICROSLOP_WINE=${MICROSLOP_WINE:-wine}
MICROSLOP_PYTHON=${MICROSLOP_PYTHON:-python3}
MICROSLOP_FFMPEG=${MICROSLOP_FFMPEG:-ffmpeg}
export MICROSLOP_ROOT MICROSLOP_BUILD MICROSLOP_PREFIX MICROSLOP_ASSETS
export MICROSLOP_FLEXTALK_DIR MICROSLOP_SPEECH_H_DIR MICROSLOP_DISPLAY
export MICROSLOP_XVFB MICROSLOP_WINE MICROSLOP_PYTHON MICROSLOP_FFMPEG
# The wine prefix and arch are what the scripts actually need; keep the
# standard names so callers can override them directly too.
export WINEPREFIX=${WINEPREFIX:-$MICROSLOP_PREFIX}
export WINEARCH=${WINEARCH:-win32}
# Convenience alias for scripts that use $ROOT for repo-relative files.
ROOT=$MICROSLOP_ROOT
# Derived helpers.
MICROSLOP_XSOCK="/tmp/.X11-unix/X${MICROSLOP_DISPLAY#:}"
export MICROSLOP_XSOCK