diff --git a/tools/chatgui/build.sh b/tools/chatgui/build.sh index c8b42f711..b09366fc9 100755 --- a/tools/chatgui/build.sh +++ b/tools/chatgui/build.sh @@ -29,6 +29,7 @@ while [[ $# -gt 0 ]]; do done [[ "$JOBS" =~ ^[1-9][0-9]*$ ]] || { log "ERROR: invalid job count: $JOBS"; exit 1; } CMAKE_ARGS=() +bash "$SRC_DIR/install_deps_win.sh" 2>&1 | tee -a "$LOG_FILE" if [[ "$BUILD_INSTALLER" = 1 ]]; then bash "$SRC_DIR/package_win.sh" --check 2>&1 | tee -a "$LOG_FILE" CMAKE_ARGS+=(-DCMAKE_BUILD_TYPE=Release) diff --git a/tools/chatgui/build_nix.sh b/tools/chatgui/build_nix.sh index b0e826e5c..59ea67e10 100755 --- a/tools/chatgui/build_nix.sh +++ b/tools/chatgui/build_nix.sh @@ -56,9 +56,9 @@ install_deps() { if [ "$OS_ID" = linux ]; then sudo apt-get update sudo apt-get install -y build-essential cmake qt6-base-dev qt6-multimedia-dev qt6-image-formats-plugins qt6-tools-dev-tools qt6-translations-l10n librlottie-dev zlib1g-dev libssl-dev \ - libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev + libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev libkf6syntaxhighlighting-dev else - sudo pkg install -y cmake qt6-base qt6-multimedia qt6-tools qt6-translations rlottie openssl ffmpeg + sudo pkg install -y cmake qt6-base qt6-multimedia qt6-tools qt6-translations rlottie openssl ffmpeg kf6-syntax-highlighting fi } diff --git a/tools/chatgui/install_deps_win.sh b/tools/chatgui/install_deps_win.sh new file mode 100644 index 000000000..7bfcdafe6 --- /dev/null +++ b/tools/chatgui/install_deps_win.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +# Установить только отсутствующие пакеты GUI из UCRT64. При готовом окружении сеть не используется. +set -euo pipefail + +[[ ${MSYSTEM:-} = UCRT64 ]] || { echo 'ERROR: GUI dependencies require MSYS2 UCRT64' >&2; exit 1; } +command -v pacman >/dev/null || { echo 'ERROR: pacman not found; run the build from MSYS2 UCRT64' >&2; exit 1; } + +required=(make git curl patch tar xz) +for name in gcc cmake ninja pkgconf openssl zlib qt6-base qt6-tools qt6-translations qt6-imageformats qt6-multimedia syntax-highlighting; do + required+=("mingw-w64-ucrt-x86_64-$name") +done +installed=$(pacman -Qq) || { echo 'ERROR: cannot query installed MSYS2 packages' >&2; exit 1; } +declare -A present=() +while IFS= read -r name; do [[ -z "$name" ]] || present["$name"]=1; done <<< "$installed" +missing=() +for name in "${required[@]}"; do [[ -n ${present[$name]:-} ]] || missing+=("$name"); done +if (( ${#missing[@]} == 0 )); then + echo "INFO: GUI dependencies present (${#required[@]} packages); no installation needed" + exit 0 +fi + +echo "INFO: installing missing GUI dependencies (${#missing[@]}): ${missing[*]}" +pacman -S --needed --noconfirm "${missing[@]}" || { + echo 'ERROR: dependency installation failed; check the pacman output. If repositories are outdated, run pacman -Syu and retry.' >&2 + exit 1 +} +pacman -Q "${required[@]}" >/dev/null || { echo 'ERROR: GUI dependencies still missing after installation' >&2; exit 1; } +echo 'INFO: GUI dependencies installed'