Skip to content
New issue

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

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

Already on GitHub? # to your account

[Feature] Build for macOS #1

Open
HongyuS opened this issue Dec 4, 2023 · 2 comments
Open

[Feature] Build for macOS #1

HongyuS opened this issue Dec 4, 2023 · 2 comments

Comments

@HongyuS
Copy link

HongyuS commented Dec 4, 2023

Since Avalonia UI is cross-platform, it is possible to distribute the program for macOS.

I took some time to look into this, and found out that Ryujinx has a set of build scripts to do this. So I copied and pasted them into my fork, and with only a few changes, it just works!

Modifications I made:

  • All libs needed by this app are already universal binaries (both x86_64 and arm64e), so I removed the python script to do this;
  • To make the folder structure more straightforward, I added PublishSingleFile=true as argument to the dotnet publish command;
  • To make the app independent from external .Net Runtime, I also added --self-contained true;
  • The self-contained Avalonia UI app is too big, so I added PublishTrimmed=true to reduce binary size.

The output macOS App Bundle has folder structure like this:

Audio.app
└── Contents
    ├── Frameworks
    │   ├── libAvaloniaNative.dylib
    │   ├── libHarfBuzzSharp.dylib
    │   └── libSkiaSharp.dylib
    ├── Info.plist
    ├── MacOS
    │   └── Audio
    ├── PkgInfo
    ├── Resources
    │   └── Icon.icns
    └── _CodeSignature
        └── CodeResources

Usage:

cd /path/to/<directory of Audio.sln>
# chmod +x ./distribution/macos/create_macos_build.sh
# chmod +x ./distribution/macos/create_app_bundle.sh
./distribution/macos/create_macos_build.sh

The app will be in ./distribution/macos/publish/

Please refer to the scripts in this commit for more information.

Here is a binary file if anyone wants to test it:
raztools-audio-macos-universal.7z.zip

@HongyuS
Copy link
Author

HongyuS commented Dec 4, 2023

I have only tested these scripts on an M1 Mac. Linux support for these scripts should be BROKEN for now. And these is NO support for GitHub Actions yet.

@HongyuS
Copy link
Author

HongyuS commented Dec 4, 2023

Here is how the app looks on macOS:
image

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant