Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Improve MacOS packaging

Open ReenigneArcher opened this issue 2 years ago • 7 comments

Describe the Bug

The dmg packages are not use-able currently and therefore will not be included in release assets until this is resolved.

Known issues:

  • missing libraries (will update this later with more information)
    • libopus.0.dylib (see below)
  • bundle doesn't point to anything, CPACK_BUNDLE_STARTUP_COMMAND is not set
dyld[1028]: Library not loaded: /usr/local/opt/opus/lib/libopus.0.dylib
  Referenced from: /Users/reenignearcher/Downloads/sunshine-macos/Sunshine/usr/local/Sunshine.app/Contents/MacOS/sunshine-0.13.0
  Reason: tried: '/usr/local/opt/opus/lib/libopus.0.dylib' (no such file), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file)
zsh: abort      ./sunshine

Expected Behavior

No response

Additional Context

We could set CPACK_BUNDLE_STARTUP_COMMAND similar to this project: https://github.com/MegaGlest/megaglest-source/blob/1e4441e0996c2045f29998a3fd9b2b7a6c2ad441/mk/macos/CMakeLists.txt#L43

The command points to this file: https://github.com/MegaGlest/megaglest-source/blob/develop/mk/macos/bundle_resources/MegaGlest.sh

Sunshine Host Operating System and Version

MacOS

Architecture

Sunshine Version

0.14.0

GPU Type

GPU Model

GPU Driver/Mesa Version

Capture Method (Linux Only)

ReenigneArcher avatar Jun 12 '22 15:06 ReenigneArcher

Can create a pkg and/or dmg using macports, but still missing the same libraries. Can also create a multipackage; however resulting pkg is ~400mb, which in my opinion is excessively large.

ReenigneArcher avatar Jun 16 '22 18:06 ReenigneArcher

Can create a pkg and/or dmg using macports, but still missing the same libraries. Can also create a multipackage; however resulting pkg is ~400mb, which in my opinion is excessively large.

@ReenigneArcher Is it possible to share a link to the 400mb multipackage? I'm on a Monterey 12.5.1 where I cannot install Xcode and MacPorts.

Dizzo786 avatar Aug 25 '22 20:08 Dizzo786

Sorry, but I think those builds are expired.

ReenigneArcher avatar Aug 25 '22 21:08 ReenigneArcher

I can file a bug as well for this. Im getting Error: Port Sunshine not found when I follow the installation instruction for macOS. Im on Monterey 12.5.1, MacPorts 2.7.2 and XCode 13.4.1

Dizzo786 avatar Aug 26 '22 18:08 Dizzo786

I can file a bug as well for this. Im getting Error: Port Sunshine not found when I follow the installation instruction for macOS. Im on Monterey 12.5.1, MacPorts 2.7.2 and XCode 13.4.1

I found a small typo in the instructions. If you copied and pasted the commands it would have shown an error prior to the error you showed.

I've updated the docs here: https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html#portfile

Those instructions should work as I just tested them.

If those still don't work, then please share the output of these commands. cat /opt/local/etc/macports/sources.conf ls ~/ports/multimedia/sunshine/

ReenigneArcher avatar Aug 26 '22 21:08 ReenigneArcher

I found a small typo in the instructions. If you copied and pasted the commands it would have shown an error prior to the error you showed.

I've updated the docs here: https://lizardbyte--330.org.readthedocs.build/projects/sunshine/en/330/about/installation.html#portfile

Those instructions should work as I just tested them.

If those still don't work, then please share the output of these commands. cat /opt/local/etc/macports/sources.conf ls ~/ports/multimedia/sunshine/

I was able to make it work and it paired great from mac to mac using Moonlight PC.

Link you shared has a typo. This line file://Users/<username>/ports should be file:////Users/<username>/ports.

Would it be possible to share the script to generate multipackage standalone pkg. I want to run sunshine on a mac where I can't install XCode.

Dizzo786 avatar Aug 27 '22 00:08 Dizzo786

Link you shared has a typo.

Looks like we're both wrong... it should be file:///...

https://guide.macports.org/#development.local-repositories.

Would it be possible to share the script to generate multipackage standalone pkg.

I just used macports to create the package. If you already have macports installed and the sunshine port installed, it's quite easy. See here: https://guide.macports.org/#using.binaries.binary-packages

ReenigneArcher avatar Aug 27 '22 00:08 ReenigneArcher

Hi there I'm trying to install Sunshine on a mac running El capitan but I get the Port sunshine not found error every time I try to install.

kid-syre avatar Aug 15 '23 18:08 kid-syre

El Capitan is not supported. Upgrade your OS.

ReenigneArcher avatar Aug 15 '23 20:08 ReenigneArcher

Any news here?

I get this while starting:

dyld[42802]: Library not loaded: /usr/local/opt/boost/lib/libboost_locale-mt.dylib Referenced from: <FC3A383B-8AB9-3F20-9889-8C46F15D02DB> /usr/local/bin/sunshine-0.20.0 Reason: tried: '/usr/local/opt/boost/lib/libboost_locale-mt.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/boost/lib/libboost_locale-mt.dylib' (no such file), '/usr/local/opt/boost/lib/libboost_locale-mt.dylib' (no such file), '/usr/local/lib/libboost_locale-mt.dylib' (no such file), '/usr/lib/libboost_locale-mt.dylib' (no such file, not in dyld cache) fish: Job 1, 'sunshine' terminated by signal SIGABRT (Abort)

iMonZ avatar Sep 11 '23 21:09 iMonZ

Mac builds are x64 only right now, which probably means its not usable on ARM macs due to library incompatibility issues.

A manual to get as far as I got:

  • Download dmg from the releases page ( https://github.com/LizardByte/Sunshine/releases/download/v0.20.0/sunshine.dmg ).
  • Command-line browse to /Volumes/Sunshine/usr/bin
  • un ./sunshine-0.20.0 - this won't be allowed. But, now you can go to the security/privacy system settings where sunshine is now listed as something that was blocked. Allow it.
  • Run it again. Can't find libopus. Install it. I decided to just create a softlink from the place it says it looks to where it actually is:
brew install opus
sudo mkdir -p /usr/local/opt/opus/lib
sudo ln -s /opt/homebrew/Cellar/opus/1.4/lib/libopus.0.dylib /usr/local/opt/opus/lib
  • Run it again. This time:
dyld[12498]: Library not loaded: '/usr/local/opt/opus/lib/libopus.0.dylib'
  Referenced from: '/Volumes/Sunshine/usr/bin/sunshine-0.20.0'
  Reason: tried: '/usr/local/opt/opus/lib/libopus.0.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file), '/opt/homebrew/Cellar/opus/1.4/lib/libopus.0.dylib' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64))), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file)

i.e. the mac is willing to emulate the x64 build, but is not willing to mix architectures.

There is a very promising link in this ticket, by @ReenigneArcher - https://lizardbyte--330.org.readthedocs.build/projects/sunshine/en/330/about/installation.html#portfile - but that link no longer works, unfortunately.

rzwitserloot avatar Sep 29 '23 08:09 rzwitserloot

Just use the portfile and be done with it.

https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html#portfile

ReenigneArcher avatar Sep 29 '23 11:09 ReenigneArcher

Hi @ReenigneArcher, I follow your guide to use macport and portfile. Tried v0.20.0, v0.19.1, and your suggestion build in (https://github.com/LizardByte/Sunshine/issues/1348#issuecomment-1701570544). That build has no boost180 Macports issue, but still not usable on ARM macs due to library incompatibility issues.

dyld[8266]: Library not loaded: /opt/local/lib/libopus.0.dylib
Referenced from: <0C19FBAA-29B7-3EB4-BDE3-B7446FF26290> /opt/local/bin/sunshine-0.18.3
Reason: tried: '/opt/local/lib/libopus.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/local/lib/libopus.0.dylib' (no such file), '/opt/local/lib/libopus.0.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/local/lib/libopus.0.dylib' (no such file), '/usr/lib/libopus.0.dylib' (no such file, not in dyld cache)
[1] 8266 abort sunshine

vukael39 avatar Oct 03 '23 18:10 vukael39

Try nightly portfile

ReenigneArcher avatar Oct 03 '23 18:10 ReenigneArcher

Try nightly portfile

Maybe it’s a great idea to switch to Homebrew. Postfile isn’t up to date anymore and I a pain to use in modern macOS Systems. Took me nearly an hour to figure out how to install it or set it up. While Homebrew installation itself works much more user friendly

iMonZ avatar Oct 03 '23 18:10 iMonZ

Try nightly portfile

Thanks, I'll try that.

Try nightly portfile

Maybe it’s a great idea to switch to Homebrew. Postfile isn’t up to date anymore and I a pain to use in modern macOS Systems. Took me nearly an hour to figure out how to install it or set it up. While Homebrew works out of the box.

Did you use homebrew to solve problem?

Thank u both!

vukael39 avatar Oct 03 '23 18:10 vukael39

Why does Sunshine need Xorg libraries to compile? Isn't this completely legacy and unnecessary?

iMonZ avatar Oct 03 '23 19:10 iMonZ

Try nightly portfile

I can't find a nightly option anywhere. Where can I download the nightly Portfile?

tqoo avatar Oct 03 '23 19:10 tqoo

Try nightly portfile

I can't find a nightly option anywhere. Where can I download the nightly Portfile?

https://github.com/LizardByte/Sunshine/blob/nightly/packaging/macos/Portfile

It's still compiling the dependencies for like 40 min... Thats why using MacPort isnt the best idea.

iMonZ avatar Oct 03 '23 19:10 iMonZ

Postfile isn’t up to date anymore

Yes it is... we build it on every single PR and push event, so often multiple times a day.

https://github.com/LizardByte/Sunshine/blob/nightly/packaging/macos/Portfile

That is NOT the portfile to use... that one is used to generate the portfile that we publish.

Links to downloads can be found on the website. https://app.lizardbyte.dev/Sunshine/

ReenigneArcher avatar Oct 03 '23 20:10 ReenigneArcher

Postfile isn’t up to date anymore

Yes it is... we build it on every single PR and push event, so often multiple times a day.

https://github.com/LizardByte/Sunshine/blob/nightly/packaging/macos/Portfile

That is NOT the portfile to use... that one is used to generate the portfile that we publish.

Links to downloads can be found on the website. https://app.lizardbyte.dev/Sunshine/

Maybe it's a good idea to replace the release files for macOS from an DMG to a pkg installer DMG are only for .app files with an GUI which Sunshine isn't

iMonZ avatar Oct 03 '23 21:10 iMonZ

A PR would be welcomed as long as it addresses the linking issues. dmg and pkg will have the same linking problems.

https://github.com/LizardByte/Sunshine/pull/1141

Also, I think pkg and/or dmg will not be compatible with arm architecture. GitHub only gives us access to x86_64 runners so we can't compile on arm.

Setting up Sunshine for cross compilation is probably a completely separate topic.

ReenigneArcher avatar Oct 03 '23 21:10 ReenigneArcher

Try nightly portfile

Nightly portfile worked and finish installation. Then I run sunshine command to load, another issue appear.

[2023:10:04:04:52:51]: Info: Sunshine version: 0.20.0
[2023:10:04:04:52:51]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:10:04:04:52:51]: Info: Trying encoder [videotoolbox]
[2023:10:04:04:52:51]: Info: SDR color coding [Rec. 601]
[2023:10:04:04:52:51]: Info: Color depth: 8-bit
[2023:10:04:04:52:51]: Info: Color range: [JPEG]
[2023:10:04:04:52:52]: Info: [h264_videotoolbox @ 0x132f09d70] This device does not support the AllowOpenGop option. Value ignored.
[1]    79603 segmentation fault  sudo sunshine

Could you give me a link if the issue is already mentioned? Thank you for your support.

vukael39 avatar Oct 03 '23 21:10 vukael39

Another dev just mentioned they have fixed these issues. I'm sure they'll put up a PR soon.

ReenigneArcher avatar Oct 03 '23 22:10 ReenigneArcher

Try nightly portfile

Nightly portfile worked and finish installation. Then I run sunshine command to load, another issue appear.

[2023:10:04:04:52:51]: Info: Sunshine version: 0.20.0
[2023:10:04:04:52:51]: Info: // Testing for available encoders, this may generate errors. You can safely ignore those errors. //
[2023:10:04:04:52:51]: Info: Trying encoder [videotoolbox]
[2023:10:04:04:52:51]: Info: SDR color coding [Rec. 601]
[2023:10:04:04:52:51]: Info: Color depth: 8-bit
[2023:10:04:04:52:51]: Info: Color range: [JPEG]
[2023:10:04:04:52:52]: Info: [h264_videotoolbox @ 0x132f09d70] This device does not support the AllowOpenGop option. Value ignored.
[1]    79603 segmentation fault  sudo sunshine

Could you give me a link if the issue is already mentioned? Thank you for your support.

h264_videotoolbox doesnt sound right. We need hevc instead of h264 on macOS

iMonZ avatar Oct 03 '23 22:10 iMonZ

A PR would be welcomed as long as it addresses the linking issues. dmg and pkg will have the same linking problems.

#1141

Also, I think pkg and/or dmg will not be compatible with arm architecture. GitHub only gives us access to x86_64 runners so we can't compile on arm.

Setting up Sunshine for cross compilation is probably a completely separate topic.

https://github.blog/2023-10-02-introducing-the-new-apple-silicon-powered-m1-macos-larger-runner-for-github-actions/

iMonZ avatar Oct 03 '23 22:10 iMonZ

Are you going to pay the bill?

ReenigneArcher avatar Oct 03 '23 22:10 ReenigneArcher

Another dev just mentioned they have fixed these issues. I'm sure they'll put up a PR soon.

PR is pull request? So I need to wait for new update nightly portfile right? Thank you.

vukael39 avatar Oct 03 '23 22:10 vukael39

Are you going to pay the bill?

So cross compilation is the way we need to go?

iMonZ avatar Oct 03 '23 22:10 iMonZ

Finally, I can successful running sunshine pretty well. I downloaded v0.19.1 Portfile and edit boost.version to 1.81. Thanks @ReenigneArcher for your support.

vukael39 avatar Oct 04 '23 04:10 vukael39