#!/usr/bin/env bash
# MS gdiplus.dll — без этого .NET падает на GenericSansSerif (GdipGetGenericFontFamilySansSerif).
set -euo pipefail
GOG_DIR="$(cd "$(dirname "$0")" && pwd)"
# shellcheck source=config.sh
source "${GOG_DIR}/config.sh"

gog_wine_check
command -v winetricks >/dev/null || { echo "brew install winetricks"; exit 1; }

export WINE="${WINE64}"
export WINEPREFIX="${BOTTLE_DIR}"
export DYLD_LIBRARY_PATH="${WINE_LIB}:${DYLD_LIBRARY_PATH:-}"
export WINEDEBUG=-all

echo "winetricks gdiplus (~3–5 мин, скачает win7sp1)…"
winetricks -q gdiplus

touch "${BOTTLE_DIR}/.gog_gdiplus_installed"
echo "OK: gdiplus в ${BOTTLE_NAME}"
