Skip to content

Instantly share code, notes, and snippets.

@dbrookman
Last active November 8, 2025 21:39
Show Gist options
  • Save dbrookman/74b8bcfb37a23452f7137b83bca9580f to your computer and use it in GitHub Desktop.
Save dbrookman/74b8bcfb37a23452f7137b83bca9580f to your computer and use it in GitHub Desktop.

Revisions

  1. dbrookman revised this gist Nov 15, 2023. 2 changed files with 2 additions and 2 deletions.
    2 changes: 1 addition & 1 deletion build-mpv_silicon.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/usr/bin/env bash

    # Builds mpv & mpv.app on Apple silicon (M1 / M2) Macs.
    # Builds mpv & mpv.app on Apple silicon Macs.
    # Run this script from the root directory of the mpv repo.

    # if anything fails, gtfo
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ### Preparations

    Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, there's a couple of required dependencies you'll need to install if you haven't already:
    Before you can build __mpv__ & __mpv.app__ on an Apple silicon Mac, there's a couple of required dependencies you'll need to install if you haven't already:

    1. Go to __System Preferences__ > __Software Update__. If there's anything there to update, do it.

  2. dbrookman revised this gist Nov 15, 2023. No changes.
  3. dbrookman revised this gist Nov 15, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, th

    3. If you don't have __Homebrew__ installed, follow the instructions [here](https://brew.sh/#install).

    4. If you don't have all of __mpv__'s [dependencies](https://github.com/mpv-player/mpv#compilation) installed, run `brew install --build-from-source --only-dependencies mpv`.
    4. If you don't have all of __mpv__'s [dependencies](https://github.com/mpv-player/mpv#compilation) installed, run `brew install --build-from-source --only-dependencies mpv && brew install libplacebo`.

    You'll also need a local copy of the mpv repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

  4. dbrookman revised this gist Aug 15, 2023. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -8,9 +8,7 @@ Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, th

    3. If you don't have __Homebrew__ installed, follow the instructions [here](https://brew.sh/#install).

    4. If you don't have __pkg-config__ or __meson__ installed, run `brew install pkg-config meson`.

    5. If you don't have all of __mpv__'s [dependencies](https://github.com/mpv-player/mpv#compilation) installed, run `brew install --only-dependencies mpv`.
    4. If you don't have all of __mpv__'s [dependencies](https://github.com/mpv-player/mpv#compilation) installed, run `brew install --build-from-source --only-dependencies mpv`.

    You'll also need a local copy of the mpv repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

  5. dbrookman revised this gist Aug 15, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion build-mpv_silicon.sh
    Original file line number Diff line number Diff line change
    @@ -13,7 +13,7 @@ meson compile -C build

    ./TOOLS/osxbundle.py --skip-deps build/mpv
    if [[ $1 == "--static" ]]; then
    dylibbundler --bundle-deps --dest-dir build/mpv.app/Contents/lib/ --create-dir --install-path @executable_path/../lib/ --fix-file build/mpv.app/Contents/MacOS/mpv
    dylibbundler --bundle-deps --dest-dir build/mpv.app/Contents/MacOS/lib/ --install-path @executable_path/lib/ --fix-file build/mpv.app/Contents/MacOS/mpv
    # test the app binary to make sure all the dylibs made it okay
    ./build/mpv.app/Contents/MacOS/mpv --version
    fi
  6. dbrookman revised this gist Aug 8, 2023. 1 changed file with 3 additions and 9 deletions.
    12 changes: 3 additions & 9 deletions build-mpv_silicon.sh
    Original file line number Diff line number Diff line change
    @@ -3,23 +3,17 @@
    # Builds mpv & mpv.app on Apple silicon (M1 / M2) Macs.
    # Run this script from the root directory of the mpv repo.

    BUNDLE_STATIC=false
    if [[ $1 == "--static" ]]; then
    BUNDLE_STATIC=true
    fi

    # if anything fails, gtfo
    set -ex

    meson setup build
    meson compile -C build

    # test the binary we just built
    ./build/mpv --version
    ./TOOLS/osxbundle.py --skip-deps build/mpv

    if $BUNDLE_STATIC; then
    dylibbundler --bundle-deps --dest-dir ./build/mpv.app/Contents/lib/ --create-dir --install-path @executable_path/../lib/ --fix-file ./build/mpv.app/Contents/MacOS/mpv
    ./TOOLS/osxbundle.py --skip-deps build/mpv
    if [[ $1 == "--static" ]]; then
    dylibbundler --bundle-deps --dest-dir build/mpv.app/Contents/lib/ --create-dir --install-path @executable_path/../lib/ --fix-file build/mpv.app/Contents/MacOS/mpv
    # test the app binary to make sure all the dylibs made it okay
    ./build/mpv.app/Contents/MacOS/mpv --version
    fi
  7. dbrookman revised this gist Aug 8, 2023. No changes.
  8. dbrookman revised this gist Aug 7, 2023. 2 changed files with 19 additions and 0 deletions.
    11 changes: 11 additions & 0 deletions build-mpv_silicon.sh
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,11 @@
    # Builds mpv & mpv.app on Apple silicon (M1 / M2) Macs.
    # Run this script from the root directory of the mpv repo.

    BUNDLE_STATIC=false
    if [[ $1 == "--static" ]]; then
    BUNDLE_STATIC=true
    fi

    # if anything fails, gtfo
    set -ex

    @@ -12,3 +17,9 @@ meson compile -C build
    # test the binary we just built
    ./build/mpv --version
    ./TOOLS/osxbundle.py --skip-deps build/mpv

    if $BUNDLE_STATIC; then
    dylibbundler --bundle-deps --dest-dir ./build/mpv.app/Contents/lib/ --create-dir --install-path @executable_path/../lib/ --fix-file ./build/mpv.app/Contents/MacOS/mpv
    # test the app binary to make sure all the dylibs made it okay
    ./build/mpv.app/Contents/MacOS/mpv --version
    fi
    8 changes: 8 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -16,6 +16,14 @@ You'll also need a local copy of the mpv repo, which you can get by running `git

    You can now run the attached script to build __mpv__ & __mpv.app__ on an Apple silicon Mac yourself. Just make sure to run it from the root directory of the cloned repo.

    #### Static Build

    If you want to bundle a static build of __mpv.app__, perform these steps following the ones above.

    1. Run `brew install dylibbundler`.

    2. Run the script from the root directory of the cloned repo, but append `--static` to the command, like `./build-mpv_silicon.sh --static`.

    ---

    ### Updating
  9. dbrookman revised this gist Aug 7, 2023. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions build-mpv_silicon.sh
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,14 @@
    #!/usr/bin/env bash

    # builds mpv & mpv.app on Apple silicon (M1 / M2) Macs
    # run this script from the root directory of the mpv repo
    # Builds mpv & mpv.app on Apple silicon (M1 / M2) Macs.
    # Run this script from the root directory of the mpv repo.

    # if anything fails, gtfo
    set -ex

    meson setup build
    meson compile -C build

    # test the binary we just built
    ./build/mpv --version
    ./TOOLS/osxbundle.py --skip-deps build/mpv
  10. dbrookman revised this gist Aug 7, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, th

    4. If you don't have __pkg-config__ or __meson__ installed, run `brew install pkg-config meson`.

    5. If you don't have all of __mpv__'s dependencies installed, run `brew install --only-dependencies mpv`.
    5. If you don't have all of __mpv__'s [dependencies](https://github.com/mpv-player/mpv#compilation) installed, run `brew install --only-dependencies mpv`.

    You'll also need a local copy of the mpv repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

  11. dbrookman revised this gist Aug 7, 2023. 1 changed file with 3 additions and 5 deletions.
    8 changes: 3 additions & 5 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -8,15 +8,13 @@ Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, th

    3. If you don't have __Homebrew__ installed, follow the instructions [here](https://brew.sh/#install).

    4. If you've never run `brew install --only-dependencies mpv`, do so now.
    4. If you don't have __pkg-config__ or __meson__ installed, run `brew install pkg-config meson`.

    5. If you've never run `brew install pkg-config`, do so now.

    5. If you've never run `brew install meson`, do so now.
    5. If you don't have all of __mpv__'s dependencies installed, run `brew install --only-dependencies mpv`.

    You'll also need a local copy of the mpv repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

    You can now run the attached script to build __mpv__ & __mpv.app__ on an Apple silicon Mac yourself. Just make sure you're in the root directory of the cloned repo beforehand.
    You can now run the attached script to build __mpv__ & __mpv.app__ on an Apple silicon Mac yourself. Just make sure to run it from the root directory of the cloned repo.

    ---

  12. dbrookman revised this gist Aug 7, 2023. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,8 @@ Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, th

    4. If you've never run `brew install --only-dependencies mpv`, do so now.

    5. If you've never run `brew install pkg-config`, do so now.

    5. If you've never run `brew install meson`, do so now.

    You'll also need a local copy of the mpv repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.
  13. dbrookman revised this gist Jan 25, 2023. 2 changed files with 6 additions and 26 deletions.
    30 changes: 4 additions & 26 deletions build-mpv_silicon.sh
    Original file line number Diff line number Diff line change
    @@ -3,33 +3,11 @@
    # builds mpv & mpv.app on Apple silicon (M1 / M2) Macs
    # run this script from the root directory of the mpv repo

    set -x
    # if anything fails, gtfo
    set -ex

    # use standalone tools, not Xcode's (avoids xcrun errors)
    export DEVELOPER_DIR="/Library/Developer/CommandLineTools/"

    LUAJIT_PATH="$(brew --prefix --installed luajit)" || exit 1
    LUAJIT_PKG_CONFIG_PATH="$LUAJIT_PATH/lib/pkgconfig"
    export PKG_CONFIG_PATH="$LUAJIT_PKG_CONFIG_PATH"

    # if we don't have the latest ffmpeg...
    if ! brew --prefix --installed ffmpeg; then
    # ...but we do have ffmpeg@4, use it instead
    if FFMPEG4_PATH="$(brew --prefix --installed ffmpeg@4)"; then
    FFMPEG4_PKG_CONFIG_PATH="$FFMPEG4_PATH/lib/pkgconfig"
    export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$FFMPEG4_PKG_CONFIG_PATH"
    # if we have neither version, gtfo
    else
    exit 1
    fi
    fi

    # if any of the following fail, immediately gtfo
    set -e

    ./bootstrap.py
    ./waf configure --lua=luajit
    ./waf build
    meson setup build
    meson compile -C build
    # test the binary we just built
    ./build/mpv --version
    ./TOOLS/osxbundle.py --skip-deps build/mpv
    2 changes: 2 additions & 0 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,8 @@ Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, th

    4. If you've never run `brew install --only-dependencies mpv`, do so now.

    5. If you've never run `brew install meson`, do so now.

    You'll also need a local copy of the mpv repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

    You can now run the attached script to build __mpv__ & __mpv.app__ on an Apple silicon Mac yourself. Just make sure you're in the root directory of the cloned repo beforehand.
  14. dbrookman revised this gist Dec 18, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion build-mpv_silicon.sh
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ set -x
    # use standalone tools, not Xcode's (avoids xcrun errors)
    export DEVELOPER_DIR="/Library/Developer/CommandLineTools/"

    LUAJIT_PATH="$(brew --prefix --installed luajit-openresty)" || exit 1
    LUAJIT_PATH="$(brew --prefix --installed luajit)" || exit 1
    LUAJIT_PKG_CONFIG_PATH="$LUAJIT_PATH/lib/pkgconfig"
    export PKG_CONFIG_PATH="$LUAJIT_PKG_CONFIG_PATH"

  15. dbrookman revised this gist Dec 18, 2022. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion build-mpv_silicon.sh
    100644 → 100755
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,8 @@ if ! brew --prefix --installed ffmpeg; then
    fi
    fi

    set -e # if any of the following fail, immediately gtfo
    # if any of the following fail, immediately gtfo
    set -e

    ./bootstrap.py
    ./waf configure --lua=luajit
  16. dbrookman revised this gist Jul 21, 2022. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -2,11 +2,13 @@

    Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, there's a couple of required dependencies you'll need to install if you haven't already:

    1. If you don't have the __Xcode Command Line Tools__ installed, run `xcode-select --install` and select _Install_ on the prompt that appears.
    1. Go to __System Preferences__ > __Software Update__. If there's anything there to update, do it.

    2. If you don't have __Homebrew__ installed, follow the instructions [here](https://brew.sh/#install).
    2. If you don't have the __Xcode Command Line Tools__ installed, run `xcode-select --install` and select _Install_ on the prompt that appears.

    3. If you've never run `brew install --only-dependencies mpv`, do so now.
    3. If you don't have __Homebrew__ installed, follow the instructions [here](https://brew.sh/#install).

    4. If you've never run `brew install --only-dependencies mpv`, do so now.

    You'll also need a local copy of the mpv repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

  17. dbrookman revised this gist Jul 4, 2022. 2 changed files with 7 additions and 7 deletions.
    2 changes: 1 addition & 1 deletion build-mpv_m1.sh → build-mpv_silicon.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    #!/usr/bin/env bash

    # builds mpv on M1 Macs
    # builds mpv & mpv.app on Apple silicon (M1 / M2) Macs
    # run this script from the root directory of the mpv repo

    set -x
    12 changes: 6 additions & 6 deletions readme.md
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,16 @@
    ### Preparations

    Before you can build _mpv.app_ on an M1 Mac, there's a couple of required dependencies you'll need to install if you haven't already:
    Before you can build __mpv__ & __mpv.app__ on an Apple silicon (M1 / M2) Mac, there's a couple of required dependencies you'll need to install if you haven't already:

    1. If you don't have the _Xcode Command Line Tools_ installed, run `xcode-select --install` and select __Install__ on the prompt that appears.
    1. If you don't have the __Xcode Command Line Tools__ installed, run `xcode-select --install` and select _Install_ on the prompt that appears.

    2. If you don't have _Homebrew_ installed, follow the instructions [here](https://brew.sh/#install).
    2. If you don't have __Homebrew__ installed, follow the instructions [here](https://brew.sh/#install).

    3. If you've never run `brew install --only-dependencies mpv`, do so now.

    You'll also need a local copy of the _mpv_ repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.
    You'll also need a local copy of the mpv repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

    You can now run the attached script to build _mpv.app_ on an M1 Mac yourself. Just make sure you're in the root directory of the cloned repo beforehand.
    You can now run the attached script to build __mpv__ & __mpv.app__ on an Apple silicon Mac yourself. Just make sure you're in the root directory of the cloned repo beforehand.

    ---

    @@ -21,4 +21,4 @@ Going forward, you can update your local copy of the repo by running the followi
    git reset --hard
    git clean --force -d -x
    git pull origin master
    ```
    ```
  18. dbrookman revised this gist May 27, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -31,4 +31,4 @@ set -e # if any of the following fail, immediately gtfo
    ./waf build
    # test the binary we just built
    ./build/mpv --version
    ./TOOLS/osxbundle.py -s build/mpv
    ./TOOLS/osxbundle.py --skip-deps build/mpv
  19. dbrookman revised this gist May 20, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@

    set -x

    # use standalone tools, not Xcode's (avoid xcrun errors)
    # use standalone tools, not Xcode's (avoids xcrun errors)
    export DEVELOPER_DIR="/Library/Developer/CommandLineTools/"

    LUAJIT_PATH="$(brew --prefix --installed luajit-openresty)" || exit 1
  20. dbrookman revised this gist May 20, 2022. 1 changed file with 6 additions and 1 deletion.
    7 changes: 6 additions & 1 deletion build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,13 @@
    #!/usr/bin/env bash
    set -x

    # builds mpv on M1 Macs
    # run this script from the root directory of the mpv repo

    set -x

    # use standalone tools, not Xcode's (avoid xcrun errors)
    export DEVELOPER_DIR="/Library/Developer/CommandLineTools/"

    LUAJIT_PATH="$(brew --prefix --installed luajit-openresty)" || exit 1
    LUAJIT_PKG_CONFIG_PATH="$LUAJIT_PATH/lib/pkgconfig"
    export PKG_CONFIG_PATH="$LUAJIT_PKG_CONFIG_PATH"
  21. dbrookman revised this gist Mar 8, 2022. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,6 @@ set -x

    # run this script from the root directory of the mpv repo

    ./bootstrap.py || exit 1

    LUAJIT_PATH="$(brew --prefix --installed luajit-openresty)" || exit 1
    LUAJIT_PKG_CONFIG_PATH="$LUAJIT_PATH/lib/pkgconfig"
    export PKG_CONFIG_PATH="$LUAJIT_PKG_CONFIG_PATH"
    @@ -23,6 +21,7 @@ fi

    set -e # if any of the following fail, immediately gtfo

    ./bootstrap.py
    ./waf configure --lua=luajit
    ./waf build
    # test the binary we just built
  22. dbrookman revised this gist Mar 8, 2022. 1 changed file with 19 additions and 11 deletions.
    30 changes: 19 additions & 11 deletions build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,30 @@
    #!/usr/bin/env bash
    set -ex
    set -x

    # run this script from the root directory of the mpv repo

    ./bootstrap.py
    ./bootstrap.py || exit 1

    LUAJIT_PKG_CONFIG_PATH="$(brew --prefix luajit-openresty)/lib/pkgconfig"
    LUAJIT_PATH="$(brew --prefix --installed luajit-openresty)" || exit 1
    LUAJIT_PKG_CONFIG_PATH="$LUAJIT_PATH/lib/pkgconfig"
    export PKG_CONFIG_PATH="$LUAJIT_PKG_CONFIG_PATH"

    # if we only have ffmpeg@4, and not the latest ffmpeg, point to ffmpeg@4
    if [[ -z "$(brew ls --versions ffmpeg)" && -n "$(brew ls --versions ffmpeg@4)" ]]; then
    FFMPEG4_PKG_CONFIG_PATH="$(brew --prefix ffmpeg@4)/lib/pkgconfig"
    export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$FFMPEG4_PKG_CONFIG_PATH"
    # if we have neither version of ffmpeg, gtfo
    elif [[ -z "$(brew ls --versions ffmpeg ffmpeg@4)" ]]; then
    exit 1
    # if we don't have the latest ffmpeg...
    if ! brew --prefix --installed ffmpeg; then
    # ...but we do have ffmpeg@4, use it instead
    if FFMPEG4_PATH="$(brew --prefix --installed ffmpeg@4)"; then
    FFMPEG4_PKG_CONFIG_PATH="$FFMPEG4_PATH/lib/pkgconfig"
    export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$FFMPEG4_PKG_CONFIG_PATH"
    # if we have neither version, gtfo
    else
    exit 1
    fi
    fi

    set -e # if any of the following fail, immediately gtfo

    ./waf configure --lua=luajit
    ./waf build
    ./TOOLS/osxbundle.py -s build/mpv
    # test the binary we just built
    ./build/mpv --version
    ./TOOLS/osxbundle.py -s build/mpv
  23. dbrookman revised this gist Mar 5, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion readme.md
    Original file line number Diff line number Diff line change
    @@ -10,7 +10,7 @@ Before you can build _mpv.app_ on an M1 Mac, there's a couple of required depend

    You'll also need a local copy of the _mpv_ repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

    You can now run the attached script to build _mpv.app_ on an M1 Mac yourself. Just make sure you're in the root directory of the cloned repo before doing so so.
    You can now run the attached script to build _mpv.app_ on an M1 Mac yourself. Just make sure you're in the root directory of the cloned repo beforehand.

    ---

  24. dbrookman renamed this gist Feb 22, 2022. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  25. dbrookman revised this gist Feb 22, 2022. 2 changed files with 39 additions and 17 deletions.
    24 changes: 24 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    ### Preparations

    Before you can build _mpv.app_ on an M1 Mac, there's a couple of required dependencies you'll need to install if you haven't already:

    1. If you don't have the _Xcode Command Line Tools_ installed, run `xcode-select --install` and select __Install__ on the prompt that appears.

    2. If you don't have _Homebrew_ installed, follow the instructions [here](https://brew.sh/#install).

    3. If you've never run `brew install --only-dependencies mpv`, do so now.

    You'll also need a local copy of the _mpv_ repo, which you can get by running `git clone https://github.com/mpv-player/mpv`.

    You can now run the attached script to build _mpv.app_ on an M1 Mac yourself. Just make sure you're in the root directory of the cloned repo before doing so so.

    ---

    ### Updating

    Going forward, you can update your local copy of the repo by running the following commands from its root directory:
    ```
    git reset --hard
    git clean --force -d -x
    git pull origin master
    ```
    32 changes: 15 additions & 17 deletions build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,22 @@
    # only run these commands the first time
    brew install --only-dependencies mpv
    git clone https://github.com/mpv-player/mpv
    #!/usr/bin/env bash
    set -ex

    cd mpv

    # only run these commands if you want to update to the latest source
    git reset --hard
    git clean --force -d -x
    git pull origin master
    # run this script from the root directory of the mpv repo

    ./bootstrap.py
    export PKG_CONFIG_PATH="$(brew --prefix luajit-openresty)/lib/pkgconfig"
    # if we have ffmpeg@4 instead of the latest ffmpeg, point to ffmpeg@4

    LUAJIT_PKG_CONFIG_PATH="$(brew --prefix luajit-openresty)/lib/pkgconfig"
    export PKG_CONFIG_PATH="$LUAJIT_PKG_CONFIG_PATH"

    # if we only have ffmpeg@4, and not the latest ffmpeg, point to ffmpeg@4
    if [[ -z "$(brew ls --versions ffmpeg)" && -n "$(brew ls --versions ffmpeg@4)" ]]; then
    export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix ffmpeg@4)/lib/pkgconfig"
    fi
    if ! ./waf configure --lua=luajit; then
    exit 1
    fi
    if ! ./waf build; then
    FFMPEG4_PKG_CONFIG_PATH="$(brew --prefix ffmpeg@4)/lib/pkgconfig"
    export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$FFMPEG4_PKG_CONFIG_PATH"
    # if we have neither version of ffmpeg, gtfo
    elif [[ -z "$(brew ls --versions ffmpeg ffmpeg@4)" ]]; then
    exit 1
    fi

    ./waf configure --lua=luajit
    ./waf build
    ./TOOLS/osxbundle.py -s build/mpv
  26. dbrookman revised this gist Feb 20, 2022. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -9,9 +9,6 @@ git reset --hard
    git clean --force -d -x
    git pull origin master

    if [ -d "build" ]; then
    rm -r build
    fi
    ./bootstrap.py
    export PKG_CONFIG_PATH="$(brew --prefix luajit-openresty)/lib/pkgconfig"
    # if we have ffmpeg@4 instead of the latest ffmpeg, point to ffmpeg@4
  27. dbrookman revised this gist Feb 20, 2022. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -9,8 +9,15 @@ git reset --hard
    git clean --force -d -x
    git pull origin master

    if [ -d "build" ]; then
    rm -r build
    fi
    ./bootstrap.py
    export PKG_CONFIG_PATH="$(brew --prefix luajit-openresty)/lib/pkgconfig"
    # if we have ffmpeg@4 instead of the latest ffmpeg, point to ffmpeg@4
    if [[ -z "$(brew ls --versions ffmpeg)" && -n "$(brew ls --versions ffmpeg@4)" ]]; then
    export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(brew --prefix ffmpeg@4)/lib/pkgconfig"
    fi
    if ! ./waf configure --lua=luajit; then
    exit 1
    fi
  28. dbrookman created this gist Feb 16, 2022.
    20 changes: 20 additions & 0 deletions build-mpv_m1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # only run these commands the first time
    brew install --only-dependencies mpv
    git clone https://github.com/mpv-player/mpv

    cd mpv

    # only run these commands if you want to update to the latest source
    git reset --hard
    git clean --force -d -x
    git pull origin master

    ./bootstrap.py
    export PKG_CONFIG_PATH="$(brew --prefix luajit-openresty)/lib/pkgconfig"
    if ! ./waf configure --lua=luajit; then
    exit 1
    fi
    if ! ./waf build; then
    exit 1
    fi
    ./TOOLS/osxbundle.py -s build/mpv