-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Support compiling for earlier releases of macOS #960
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
Support compiling for earlier releases of macOS #960
Conversation
Your PR was set to |
Thank you for this PR! While we cannot build older version in our CI (https://github.blog/changelog/2022-07-20-github-actions-the-macos-10-15-actions-runner-image-is-being-deprecated-and-will-be-removed-by-8-30-22/) I do think it's good to have support for older hardware in some capacity. P.S. Do you have any thoughts about statically linking deps during the macOS build? I think it would solve the issues we have with the pkg and dmg packages. |
f30e85b
to
59e907d
Compare
There's nothing wrong with using static linking to smooth out installation. The norm in macOS is to include all of the necessary binaries for an app or package in one way or another, rather than relying on something like a package manager. Using static linking certainly seems like the shortest route to getting there. I'll mention that the other more "mac-like" way to do it would be to package Sunshine into an application bundle and then include all of its needed libraries inside of there, generally in the That all said, my recommendation would still be to use static linking. With static linking in place, the other thing that would be nice is to have Sunshine be installed into a self-contained location like |
Could you fix the lint errors please? |
Allows compiling for macOS 10.12 and later
3d11e00
to
808eb24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this, but the code is well documented and builds fine, so I approve and will merge this.
If you'd be interested in making a PR to statically link the macOS builds it would be really appreciated.
Description
These changes broaden the macOS versions that Sunshine can be compiled for. There are only a few places in the codebase where a macOS API function that requires macOS 10.15 or later is used, and this PR makes it so that these functions are weakly linked and avoids using them when running in macOS 10.14 and earlier.
The other issue with compiling on macOS 10.14 is that its version of libc++ doesn't support some of the later C++ features used throughout the codebase. However, this can be overcome by compiling with a newer installation of LLVM / clang and statically linking against its copy of libc++.
With the changes in this PR, I was able to get Sunshine to compile for macOS 10.12-10.14 by installing clang 15 using MacPorts (along with Sunshine's other dependencies) and then configuring it with the following
cmake
command:(Note that I had to manually supply to paths for both boost and OpenSSL.)
Even if Sunshine will perform worse in them than the latest macOS releases, I think it's important to support older releases of macOS at least in some capacity (even if it requires the user to compile it themselves) since it's very useful for them to have a fully open source streaming solution, as well as there being a lot of reasons to avoid the newer releases of macOS, including lack of support for older macs, poorer options for customization, Apple's continuing agenda of removing user control, and them just generally being frustratingly buggy.
Personally I'm still running macOS 10.14 and have no intention of updating any time soon, if I can manage it! And I'd still like to use Sunshine if I can.
Screenshot
N/A
Issues Fixed or Closed
N/A
Type of Change
.github/...
)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.