Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[desktop] Create ffmpeg universal binaries for macOS #2965

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions desktop/.github/workflows/desktop-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,31 @@ jobs:
- name: Install dependencies
run: yarn install

- name: Create universal ffmpeg binaries for macOS
if: startsWith(matrix.os, 'ubuntu')
# Currently, the ffmpeg-static binaries are not universal (Not
# their fault, we thank them for their useful package, the issue
# is that there don't seem to be well known upstream sources that
# provide a universal binary).
#
# As a workaround, we invoke ffmpeg-static twice to download both
# the Intel and ARM binaries, and combine them into a single
# universal binary using lipo.
#
# Note that the yarn install will run again, as part of the
# "build:ci" step, so we're relying on ffmpeg-static install.js's
# behaviour of not overwriting the existing file named `ffmpeg`.
run: |
rm -f node_modules/ffmpeg-static/ffmpeg
npm rebuild --arch=arm64 -f ffmpeg-static
mv node_modules/ffmpeg-static/ffmpeg node_modules/ffmpeg-static/ffmpeg-arm64
npm rebuild --arch=x64 -f ffmpeg-static
mv node_modules/ffmpeg-static/ffmpeg node_modules/ffmpeg-static/ffmpeg-x64
cd node_modules/ffmpeg-static/
lipo -create ffmpeg-arm64 ffmpeg-x64 -output ffmpeg
rm ffmpeg-arm64 ffmpeg-x64
file ffmpeg # print what we ended up with

- name: Install libarchive-tools for pacman build
if: startsWith(matrix.os, 'ubuntu')
# See:
Expand Down