70 lines
2.4 KiB
Bash
70 lines
2.4 KiB
Bash
check_dependencies git uv python-speechd:speechd
|
|
|
|
# shellcheck disable=SC2154 # set by linux-game-manager.sh
|
|
gameRoot="${installPath}/PlayPalace11"
|
|
desktopPath="${gameRoot}/clients/desktop"
|
|
hostPythonDir="${desktopPath}/.host-python"
|
|
speechdFilePath=""
|
|
speechdCopySourcePath=""
|
|
|
|
if [[ -e "${gameRoot}" ]]; then
|
|
ui_msgbox "Game Installer" "Game Installer" "\"${gameRoot}\" already exists. Remove it first or choose a different game."
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "${installPath}" || {
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not create ${installPath}."
|
|
exit 1
|
|
}
|
|
|
|
if ! git -C "${installPath}" clone "https://github.com/XGDevGroup/PlayPalace11.git"; then
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not clone Play Palace from GitHub."
|
|
exit 1
|
|
fi
|
|
|
|
if ! pushd "${desktopPath}" > /dev/null; then
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not find desktop client path at ${desktopPath}."
|
|
exit 1
|
|
fi
|
|
|
|
if ! uv sync; then
|
|
popd > /dev/null || exit 1
|
|
ui_msgbox "Game Installer" "Game Installer" "uv sync failed for Play Palace."
|
|
exit 1
|
|
fi
|
|
popd > /dev/null || exit 1
|
|
|
|
speechdFilePath="$(python3 -c 'import pathlib,speechd; print(pathlib.Path(speechd.__file__).resolve())' 2> /dev/null)"
|
|
if [[ -z "${speechdFilePath}" ]]; then
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not import python module speechd from host Python.\nInstall speech-dispatcher python bindings and try again."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "${speechdFilePath##*/}" == "__init__.py" ]]; then
|
|
speechdCopySourcePath="${speechdFilePath%/*}"
|
|
elif [[ "${speechdFilePath##*/}" == "speechd.py" ]]; then
|
|
speechdCopySourcePath="${speechdFilePath}"
|
|
else
|
|
speechdCopySourcePath="${speechdFilePath}"
|
|
fi
|
|
|
|
if ! [[ -r "${speechdCopySourcePath}" ]]; then
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not read speechd python binding at ${speechdCopySourcePath}."
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "${hostPythonDir}" || {
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not create ${hostPythonDir}."
|
|
exit 1
|
|
}
|
|
|
|
if [[ -d "${speechdCopySourcePath}" ]]; then
|
|
if ! cp -a "${speechdCopySourcePath}" "${hostPythonDir}/"; then
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not copy speechd package into ${hostPythonDir}."
|
|
exit 1
|
|
fi
|
|
elif ! cp -a "${speechdCopySourcePath}" "${hostPythonDir}/speechd.py"; then
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not copy speechd module into ${hostPythonDir}."
|
|
exit 1
|
|
fi
|