How to target older SDK than host macOS #4808
-
I would like to build some bottles for When I manually compile things I set the following variables to target big-sur:
Is there a way to trick homebrew to target an other SDK version than the host, such that it will download |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Not officially, but the idea of how to do this would be to trick When doing anything like this though, I recommend enabling cross-compiling in any configure scripts (e.g. |
Beta Was this translation helpful? Give feedback.
-
OK for future reference in case somebody needs this: I had difficulty getting this to work on ventura, homebrew kept complaining about missing big-sur command line utilities, but it is not possible to install big-sur command line utilities on ventura. Also it is tricky to make homebrew target the correct SDK. However I found a neat solution: In ventura, we cannot virtualize big sur, but we can easily virtualize macos 12 (monterey). So we start with a basic monterey vm:
Now we download and install So we now have a virtual machine that has (only) the big-sur SDK and command line utilities, but still can be virtualized. So the only thing left to do is what Bo98 says above, either shim |
Beta Was this translation helpful? Give feedback.
Not officially, but the idea of how to do this would be to trick
MacOS.full_version
(orsw_vers
) and then pretty much everything else will work from there. Internally we have aHOMEBREW_FAKE_EL_CAPITAN
, but that doesn't extend to arbitrary versions.When doing anything like this though, I recommend enabling cross-compiling in any configure scripts (e.g.
--build=aarch64-apple-darwin22 --host=aarch64-apple-darwin20
). That is because some may do runtime tests when cross-compiling is disabled, which will misconfigure your build for your target.