LocalAI/scripts/prepare-libs.sh
Ettore Di Giacinto 683c306f90
ci(Makefile): adds tts in binary releases ()
* ci(Makefile): run tts and stablediffusion in dist

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* re-add macos-13

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* rely on detection

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* move logic to a script

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* missing some libs still

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
2024-07-05 23:19:24 +02:00

23 lines
513 B
Bash
Executable File

#!/bin/bash
mkdir -p backend-assets/lib
OS="$(uname)"
if [ "$OS" == "Darwin" ]; then
LIBS="$(otool -L $1 | awk 'NR > 1 { system("echo " $1) } ' | xargs echo)"
elif [ "$OS" == "Linux" ]; then
LIBS="$(ldd $1 | awk 'NF == 4 { system("echo " $3) } ' | xargs echo)"
else
echo "Unsupported OS"
exit 1
fi
for lib in $LIBS; do
cp -f $lib backend-assets/lib
done
echo "==============================="
echo "Copied libraries to backend-assets/lib"
echo "$LIBS"
echo "==============================="