diff --git a/build_files/build_environment/cmake/setup_msys2.cmake b/build_files/build_environment/cmake/setup_msys2.cmake index f2c1abf3823..fab395cd942 100644 --- a/build_files/build_environment/cmake/setup_msys2.cmake +++ b/build_files/build_environment/cmake/setup_msys2.cmake @@ -24,7 +24,7 @@ macro(download_package package_name) set(MSYS2_${package_name}_FILE ${_final_filename}) if(NOT EXISTS "${_final_filename}") if(MSYS2_USE_UPSTREAM_PACKAGES) - set(_final_url ${URI}) + set(_final_url ${URL}) else() set(_final_url "https://projects.blender.org/blender/lib-windows_x64/media/branch/build_environment/${_file_name}") endif() @@ -132,6 +132,20 @@ if(NOT EXISTS "${DOWNLOAD_DIR}/msys2/msys64/usr/bin/m4.exe") ) message(STATUS "Installing required packages") + + if(NOT BLENDER_PLATFORM_WINDOWS_ARM) + # A newer runtime package is required since the tools downloaded in the next step + # depend on it, we however cannot update the runtime from a msys2_shell.cmd since + # bash.exe will lock the runtime dlls so we execute pacman directly. + # + # For now only run this on X64 as there are some known issues (but unknown to me) + # with newer msys2 on Windows on ARM. + execute_process( + COMMAND ${DOWNLOAD_DIR}/msys2/msys64/usr/bin/pacman -S msys2-runtime --noconfirm + WORKING_DIRECTORY ${DOWNLOAD_DIR}/msys2/msys64 + ) + endif() + execute_process( COMMAND ${DOWNLOAD_DIR}/msys2/msys64/msys2_shell.cmd -defterm -no-start -clang64 -c "pacman -S patch m4 coreutils pkgconf make diffutils autoconf-wrapper --noconfirm && exit"