From 50fd4b1cad79c59417e948d62cfd2cc5c4a7fa47 Mon Sep 17 00:00:00 2001 From: Bashy Date: Sat, 21 Nov 2026 14:45:26 +0200 Subject: [PATCH] tts setup: detect libespeak-ng by file, ldconfig is not on a user's PATH Co-Authored-By: Claude Opus 5.5 --- tools/tts/setup.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/tts/setup.sh b/tools/tts/setup.sh index 413e1c0..2940fca 100755 --- a/tools/tts/setup.sh +++ b/tools/tts/setup.sh @@ -8,7 +8,12 @@ cd "$(dirname "$0")" missing=() command -v ffmpeg >/dev/null || missing+=(ffmpeg) -ldconfig -p 2>/dev/null | grep -q libespeak-ng || missing+=(espeak-ng) +# libespeak-ng (comes with espeak-ng). Look for the file: ldconfig is in /sbin, not on a normal user's PATH +has_espeak() { + compgen -G '/usr/lib/*/libespeak-ng.so*' >/dev/null || compgen -G '/usr/lib*/libespeak-ng.so*' >/dev/null || + /sbin/ldconfig -p 2>/dev/null | grep -q libespeak-ng +} +has_espeak || missing+=(espeak-ng) python3 -c 'import venv, ensurepip' 2>/dev/null || missing+=(python3-venv) if ((${#missing[@]})); then echo "First install: sudo apt install ${missing[*]}"; exit 1; fi