70 lines
2.1 KiB
Bash
70 lines
2.1 KiB
Bash
check_dependencies git uv
|
|
|
|
# shellcheck disable=SC2154 # installPath is exported by linux-game-manager.sh
|
|
gameRoot="${installPath}/PlayPalace11"
|
|
desktopPath="${gameRoot}/clients/desktop"
|
|
hostLibDir="${desktopPath}/.host-libs"
|
|
speechdLibPath=""
|
|
libCandidates=(
|
|
"/usr/lib/libspeechd.so.2"
|
|
"/usr/lib64/libspeechd.so.2"
|
|
"/usr/lib/x86_64-linux-gnu/libspeechd.so.2"
|
|
"/lib/x86_64-linux-gnu/libspeechd.so.2"
|
|
"/lib64/libspeechd.so.2"
|
|
)
|
|
|
|
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
|
|
|
|
if command -v ldconfig > /dev/null 2>&1; then
|
|
speechdLibPath="$(ldconfig -p 2> /dev/null | awk '/libspeechd\.so\.2/{print $NF; exit}')"
|
|
fi
|
|
|
|
if [[ -z "${speechdLibPath}" ]]; then
|
|
for libPath in "${libCandidates[@]}"; do
|
|
if [[ -r "${libPath}" ]]; then
|
|
speechdLibPath="${libPath}"
|
|
break
|
|
fi
|
|
done
|
|
fi
|
|
|
|
if [[ -z "${speechdLibPath}" ]]; then
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not find libspeechd.so.2.\nInstall speech-dispatcher (Arch) or a libspeechd package (Debian/Ubuntu) and try again."
|
|
exit 1
|
|
fi
|
|
|
|
mkdir -p "${hostLibDir}" || {
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not create ${hostLibDir}."
|
|
exit 1
|
|
}
|
|
|
|
if ! cp -Lf "${speechdLibPath}" "${hostLibDir}/libspeechd.so.2"; then
|
|
ui_msgbox "Game Installer" "Game Installer" "Could not copy ${speechdLibPath} into ${hostLibDir}."
|
|
exit 1
|
|
fi
|