From c59cf6d34daa3660075b5d4ee09724cfaf7b1833 Mon Sep 17 00:00:00 2001 From: Markus Perl <1220081+markus-perl@users.noreply.github.com> Date: Sat, 20 Jul 2024 10:46:55 +0200 Subject: [PATCH] MacOs fixes --- .github/workflows/build.yml | 2 +- build-ffmpeg | 30 +++++++++++++++++++++++------- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1359e70..a6aab34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: build-macos: name: build in native macOS - runs-on: macos-latest + runs-on: macos-14 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/build-ffmpeg b/build-ffmpeg index c8aee7b..a504142 100755 --- a/build-ffmpeg +++ b/build-ffmpeg @@ -470,14 +470,30 @@ fi if command_exists "python3"; then # dav1d needs meson and ninja along with nasm to be built if command_exists "pip3"; then - # meson and ninja can be installed via pip3 - execute pip3 install pip setuptools --quiet --upgrade --no-cache-dir --disable-pip-version-check - for r in meson ninja; do - if ! command_exists ${r}; then - execute pip3 install ${r} --quiet --upgrade --no-cache-dir --disable-pip-version-check + + #set variable meson and ninja installed to false + MESON_INSTALLED=false + + #check if macOs and brew is available + if [[ "$OSTYPE" == "darwin"* ]]; then + if ! command_exists "brew"; then + brew install python-setuptools meson ninja + MESON_INSTALLED=true fi - export PATH=$PATH:~/Library/Python/3.9/bin - done + fi + + #check if meson and ninja are installed MESON_INSTALLED + if ! $MESON_INSTALLED; then + # meson and ninja can be installed via pip3 + execute pip3 install pip setuptools --quiet --upgrade --no-cache-dir --disable-pip-version-check + for r in meson ninja; do + if ! command_exists ${r}; then + execute pip3 install ${r} --quiet --upgrade --no-cache-dir --disable-pip-version-check + fi + export PATH=$PATH:~/Library/Python/3.9/bin + done + fi + fi if command_exists "meson"; then if build "dav1d" "1.4.2"; then