diff --git a/.ci/build-mac-arm64.sh b/.ci/build-mac-arm64.sh index 8292329a05..cddcde7028 100644 --- a/.ci/build-mac-arm64.sh +++ b/.ci/build-mac-arm64.sh @@ -3,18 +3,18 @@ # shellcheck disable=SC2086 brew_arm64_install_packages() { for pkg in "$@"; do - echo "Fetching bottle for $pkg..." - bottle_path="$("$BREW_ARM64_PATH/bin/brew" --cache --bottle-tag=arm64_sonoma "$pkg")" + echo "Fetching bottle for $pkg (arm64)..." + bottle_path="$("$BREW_ARM64_PATH/bin/brew" --cache --bottle-tag=arm64_ventura "$pkg")" if [ ! -f "$bottle_path" ]; then - if ! "$BREW_ARM64_PATH/bin/brew" fetch --force --bottle-tag=arm64_sonoma "$pkg"; then + if ! "$BREW_ARM64_PATH/bin/brew" fetch --force --verbose --debug --bottle-tag=arm64_ventura "$pkg"; then echo "Failed to fetch bottle for $pkg" return 1 fi - bottle_path="$("$BREW_ARM64_PATH/bin/brew" --cache --bottle-tag=arm64_sonoma "$pkg")" + bottle_path="$("$BREW_ARM64_PATH/bin/brew" --cache --bottle-tag=arm64_ventura "$pkg")" fi - echo "Installing $pkg..." - "$BREW_ARM64_PATH/bin/brew" install --ignore-dependencies "$bottle_path" || true + echo "Installing $pkg (arm64)..." + "$BREW_ARM64_PATH/bin/brew" install --force --force-bottle --ignore-dependencies "$bottle_path" || true done } @@ -23,9 +23,14 @@ export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 export HOMEBREW_NO_INSTALL_CLEANUP=1 /usr/local/bin/brew update +sudo rm -rf /usr/local/Cellar/curl /usr/local/opt/curl +/usr/local/bin/brew install -f --overwrite curl /usr/local/bin/brew uninstall -f --ignore-dependencies ffmpeg /usr/local/bin/brew install -f --build-from-source ffmpeg@5 || true +/usr/local/bin/brew install -f --overwrite python || true +/usr/local/bin/brew link --overwrite python || true /usr/local/bin/brew install -f --overwrite nasm ninja p7zip ccache pipenv #create-dmg +/usr/local/bin/brew link -f curl || true /usr/local/bin/brew install llvm@$LLVM_COMPILER_VER glew cmake sdl2 vulkan-headers coreutils /usr/local/bin/brew link -f llvm@$LLVM_COMPILER_VER ffmpeg@5 || true @@ -34,8 +39,13 @@ sudo mkdir -p "$BREW_ARM64_PATH" sudo chmod 777 "$BREW_ARM64_PATH" curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C "$BREW_ARM64_PATH" -"$BREW_ARM64_PATH/bin/brew" update -brew_arm64_install_packages 0mq aom aribb24 ca-certificates cjson curl dav1d ffmpeg@5 fontconfig freetype freetype2 gettext glew gmp gnutls lame libbluray libidn2 libnettle libogg libpng librist libsodium libsoxr libtasn libtasn1 libunistring libvmaf libvorbis libvpx libx11 libxau libxcb libxdmcp llvm@$LLVM_COMPILER_VER mbedtls molten-vk nettle opencore-amr openjpeg openssl opus p11-kit pkg-config pkgconfig pzstd rav1e sdl2 snappy speex srt svt-av1 theora vulkan-headers webp x264 x265 xz z3 zeromq zmq zstd +#"$BREW_ARM64_PATH/bin/brew" update +# libvorbis requires Homebrew-installed curl, but we can't run it on x64, and we also need the aarch64 libs, so we swap the binary +brew_arm64_install_packages curl +mv /opt/homebrew1/opt/curl/bin/curl /opt/homebrew1/opt/curl/bin/curl.bak +ln -s /usr/local/opt/curl/bin/curl /opt/homebrew1/opt/curl/bin/curl + +brew_arm64_install_packages 0mq aom aribb24 ca-certificates cjson dav1d ffmpeg@5 fontconfig freetype freetype2 gettext glew gmp gnutls lame libbluray libidn2 libnettle libogg libpng librist libsodium libsoxr libtasn libtasn1 libunistring libvmaf libvorbis libvpx libx11 libxau libxcb libxdmcp llvm@$LLVM_COMPILER_VER mbedtls molten-vk nettle opencore-amr openjpeg openssl opus p11-kit pkg-config pkgconfig pzstd rav1e sdl2 snappy speex srt svt-av1 theora vulkan-headers webp x264 x265 xz z3 zeromq zmq zstd "$BREW_ARM64_PATH/bin/brew" link -f ffmpeg@5 # moltenvk based on commit for 1.2.10 release @@ -125,6 +135,7 @@ export MACOSX_DEPLOYMENT_TARGET=13.0 -DLLVM_TARGET_ARCH=arm64 \ -DCMAKE_OSX_ARCHITECTURES=arm64 \ -DCMAKE_IGNORE_PATH="$BREW_X64_PATH/lib" \ + -DCMAKE_IGNORE_PREFIX_PATH=/usr/local/opt \ -DCMAKE_SYSTEM_PROCESSOR=arm64 \ -DCMAKE_TOOLCHAIN_FILE=buildfiles/cmake/TCDarwinARM64.cmake \ -DCMAKE_CXX_FLAGS="-D__MAC_OS_X_VERSION_MIN_REQUIRED=130000" \