Closed ffxsam closed 5 months ago
Hi, would love to see this merge request to be accepted - I'm using Windows and Linux builds from here, and OS X builds would be great.
Could you explain what has to be done to build FFmpeg/FFprobe 5.1 using this fork of BtbN:master?
I think you are misunderstanding this PR. It will still only produce Windows and Linux builds, but built on OSX.
You're right - I misunderstood that. I hoped we could get OSX builds of ffmpeg/ffprobe here. Sorry for the inconvinience I caused...
To build for OSX itself, we'd need a properly working cross compiler, and Apple is doing its utmost to prevent that from happening.
I also would have no way to test anything (beyond compiling itself) without spending way too much money on at least two Apple devices. For that reason I'm also rather conflicted about this PR alone, and still haven't merged or worked on it more. I can't test it at all, and will very likely accidentally break it again soon after merging.
So if there will be a cross compiler, you can add me to the list of people willing to help building and testing an OSX version
@MrRickwi What's your specific use case? Any reason just installing it via Homebrew won't work for you?
Use case is to have same version across windows, linux and mac environments, build with exactly same features. And to have statically linked executables in all cases to reduce installation overhead. Nevertheless, currently it's fine to use the brew installed version.
@MrRickwi That's actually a great point. Many times, I've been bitten by ffmpeg in production failing because it's a more limited build than the one on my Mac.
Moving to #335
I'm opening this as a draft PR for discussion. I know there are a lot of developers on macOS who are interested in custom ffmpeg builds, so I wanted to put this out there.
I tested amd64 & arm64 builds and both worked fine, at least with my particular selection of scripts in
scripts.d
. Some of them raised exceptions when building, but I don't have time to dig into those at the moment. This needs to be fully tested on Linux. I don't have access to a Linux system, and I was told that running this on a Linux VM may not behave predictably.A few notes about some of these changes.
This was done to avoid using the super dusty
/bin/bash
on macOS. Doing it this way allows someone to install a newer version of bash via Homebrew and use that instead.This was done to handle cases where someone happens to remove all folders in
scripts.d
, otherwise it would throw an error:On line 100 in
generate.sh
:The
-s
option for sed doesn't exist on Darwin, so I removed it. I did compare the sed results on Mac vs Linux, and the-s
flag didn't appear to make a difference as far as I could tell.If all of this is too hacky and isn't appropriate to merge, I get it, and I'll just keep this fork handy for my own purposes and anyone else who wishes to use it.