diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d191d87b76..8ec0183605 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -97,9 +97,17 @@ jobs: - { name: macOS Release, os: macos-latest, + host: x86_64, buildtype: release, args: -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true -Dvapoursynth=enabled --force-fallback-for=ffms2 } + - { + name: macOS Release (arm64), + os: macos-latest, + host: arm64, + buildtype: release, + args: --cross-file arm64-apple-macos11.txt -Ddefault_library=static -Dbuild_osx_bundle=true -Dlocal_boost=true -Dvapoursynth=enabled --force-fallback-for=ffms2 + } steps: - uses: actions/checkout@v3 @@ -131,7 +139,7 @@ jobs: Get-Location | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Install dependencies (MacOS) - if: matrix.config.os == 'macos-latest' + if: matrix.config.os == 'macos-latest' && matrix.config.host == 'x86_64' run: | brew update brew install luarocks ninja @@ -140,12 +148,50 @@ jobs: brew install libass zlib ffms2 fftw hunspell brew install pulseaudio # NO OpenAL in github CI + - name: Install dependencies (MacOS arm64) + if: matrix.config.os == 'macos-latest' && matrix.config.host == 'arm64' + run: | + mkdir arm64-homebrew + curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C arm64-homebrew + + for package in pkg-config libass zlib fftw hunspell pulseaudio; do + arm64-homebrew/bin/brew fetch --force --bottle-tag=arm64_big_sur ${package} + arm64-homebrew/bin/brew install $(arm64-homebrew/bin/brew --cache --bottle-tag=arm64_big_sur ${package}) + done + - name: Install dependencies (Linux) if: startsWith(matrix.config.os, 'ubuntu-') run: | sudo apt-get update sudo apt-get install ninja-build build-essential libx11-dev libwxgtk3.0-gtk3-dev libfreetype6-dev pkg-config libfontconfig1-dev libass-dev libasound2-dev libffms2-dev intltool libboost-all-dev libhunspell-dev libuchardet-dev libpulse-dev libopenal-dev libjansson-dev nasm + - name: Set up cross file (arm64) + if: matrix.config.os == 'macos-latest' && matrix.config.host == 'arm64' + run: | + cat < arm64-apple-macos11.txt + [binaries] + c = 'clang' + cpp = 'clang++' + objc = 'clang' + objc++ = 'clang++' + pkg-config = 'arm64-homebrew/bin/pkg-config' + + [constants] + target_flags = ['target', 'arm64-apple-macos11'] + + [built-in options] + c_args = target_flags + cpp_args = target_flags + objc_args = target_flags + objcpp_args = target_flags + + [host_machine] + system = 'darwin' + cpu_family = 'aarch64' + cpu = 'aarch64' + endian = 'little' + EOT + - name: Configure run: meson setup build ${{ matrix.config.args }} -Dbuildtype=${{ matrix.config.buildtype }}