Files
2026-10-27 17:58:28 +08:00

20 lines
497 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# 通过清华 TUNA 镜像为 MSYS2 安装 mingw-w64 gcc(Fyne/cgo 必需)
set -e
for f in /etc/pacman.d/mirrorlist.*; do
sed -i 's|repo.msys2.org|mirrors.tuna.tsinghua.edu.cn/msys2|g' "$f"
done
echo "--- mirror ---"
grep -m1 '^Server' /etc/pacman.d/mirrorlist.mingw64 || true
echo "--- sync db ---"
pacman -Sy --noconfirm
echo "--- install gcc ---"
pacman -S --noconfirm --needed mingw-w64-x86_64-gcc
echo "--- verify ---"
/mingw64/bin/gcc.exe --version | head -n 1