2 # If we need to download a custom MinGW, do so here and set the path
5 # Otherwise install MinGW through `pacman`
10 source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
12 MINGW_ARCHIVE_32="i686-12.2.0-release-posix-dwarf-rt_v10-rev0.7z"
13 MINGW_ARCHIVE_64="x86_64-12.2.0-release-posix-seh-rt_v10-rev0.7z"
16 case "${CI_JOB_NAME}" in
20 mingw_archive="${MINGW_ARCHIVE_32}"
25 mingw_archive="${MINGW_ARCHIVE_64}"
28 # aarch64 is a cross-compiled target. Use the x86_64
29 # mingw, since that's the host architecture.
32 mingw_archive="${MINGW_ARCHIVE_64}"
35 echo "src/ci/scripts/install-mingw.sh can't detect the builder's architecture"
36 echo "please tweak it to recognize the builder named '${CI_JOB_NAME}'"
41 if [[ "${CUSTOM_MINGW-0}" -ne 1 ]]; then
42 pacman -S --noconfirm --needed mingw-w64-$arch-toolchain mingw-w64-$arch-cmake \
44 mingw-w64-$arch-python # the python package is actually for python3
45 ciCommandAddPath "$(ciCheckoutPath)/msys2/mingw${bits}/bin"
47 mingw_dir="mingw${bits}"
49 curl -o mingw.7z "${MIRRORS_BASE}/${mingw_archive}"
50 7z x -y mingw.7z > /dev/null
51 ciCommandAddPath "$(pwd)/${mingw_dir}/bin"