From a5047c29f7e0f2f2e6828d206f8ae017b00fab58 Mon Sep 17 00:00:00 2001 From: evgeny Date: Mon, 21 Sep 2026 00:58:56 +0300 Subject: [PATCH] chatgui: always deploy non-Qt DLLs (FFmpeg, mingw-runtime) next to vibechat.exe --- tools/chatgui/build.sh | 47 +++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/tools/chatgui/build.sh b/tools/chatgui/build.sh index 34ac9301..4790b7b6 100755 --- a/tools/chatgui/build.sh +++ b/tools/chatgui/build.sh @@ -50,29 +50,34 @@ if [ -x "$WINDEPLOYQT" ]; then fi else log " WARN: $WINDEPLOYQT not found (install: pacman -S mingw-w64-ucrt-x86_64-qt5-tools)" - log " Resolving dependencies recursively..." - todo="$BUILD_DIR/vibechat.exe" - while [ -n "$todo" ]; do - next_todo="" - for src in $todo; do - for dep in $(objdump -p "$src" 2>/dev/null | grep "DLL Name:" | awk '{print $3}'); do - case "$dep" in - KERNEL32.dll|msvcrt.dll|USER32.dll|GDI32.dll|SHELL32.dll|ADVAPI32.dll|\ - WS2_32.dll|ole32.dll|OLEAUT32.dll|IPHLPAPI.DLL|BCRYPT.dll|dbghelp.dll|\ - api-ms-win-*) - continue ;; - esac - [ -f "$BUILD_DIR/$dep" ] && continue - if cp "/ucrt64/bin/$dep" "$BUILD_DIR/" 2>/dev/null; then - log " OK: $dep"; next_todo="$next_todo $BUILD_DIR/$dep" - elif cp "/mingw64/bin/$dep" "$BUILD_DIR/" 2>/dev/null; then - log " OK: $dep (mingw64)"; next_todo="$next_todo $BUILD_DIR/$dep" - fi - done +fi + +# Резолвим НЕ-Qt зависимости (FFmpeg, mingw-runtime) всегда: windeployqt копирует только Qt. +FFMPEG_BIN="$SRC_DIR/ffmpeg/ffmpeg_build/install/bin" +log " Resolving non-Qt dependencies recursively..." +todo="$BUILD_DIR/vibechat.exe" +while [ -n "$todo" ]; do + next_todo="" + for src in $todo; do + for dep in $(objdump -p "$src" 2>/dev/null | grep "DLL Name:" | awk '{print $3}'); do + case "$dep" in + KERNEL32.dll|msvcrt.dll|USER32.dll|GDI32.dll|SHELL32.dll|ADVAPI32.dll|\ + WS2_32.dll|ole32.dll|OLEAUT32.dll|IPHLPAPI.DLL|BCRYPT.dll|dbghelp.dll|\ + api-ms-win-*) + continue ;; + esac + [ -f "$BUILD_DIR/$dep" ] && continue + if cp "/ucrt64/bin/$dep" "$BUILD_DIR/" 2>/dev/null; then + log " OK: $dep"; next_todo="$next_todo $BUILD_DIR/$dep" + elif cp "/mingw64/bin/$dep" "$BUILD_DIR/" 2>/dev/null; then + log " OK: $dep (mingw64)"; next_todo="$next_todo $BUILD_DIR/$dep" + elif [ -d "$FFMPEG_BIN" ] && cp "$FFMPEG_BIN/$dep" "$BUILD_DIR/" 2>/dev/null; then + log " OK: $dep (ffmpeg)"; next_todo="$next_todo $BUILD_DIR/$dep" + fi done - todo="$next_todo" done -fi + todo="$next_todo" +done # Qt platform plugin (loaded dynamically, not in import table) mkdir -p "$BUILD_DIR/platforms" for d in /ucrt64/share/qt5/plugins /ucrt64/lib/qt5/plugins; do