https://kotlinlang.org logo
Title
t

Thomas

12/15/2021, 12:15 PM
Is there a way to build a universal pkg (Intel + ARM64) for Mac? That is needed to be able to upload it to the Apple AppStore.
👀 1
a

Alexander Kurasov[JB]

12/15/2021, 4:00 PM
You can try to add both MacOS dependencies instead of
implementation(compose.desktop.currentOs)
use
implementation(compose.desktop.macos_arm64)
implementation(compose.desktop.macos_x64)
In my undestanding it should include both platform binaries into the bundle
t

Thomas

12/15/2021, 4:12 PM
Thanks, I gave it a try but when doing a right click and get info on the produced
.app
it still shows
Apple Silicon
instead of
Universal
. I am building the project on an M1 Mac with an ARM64 JDK. I am not sure what to do about the bundled JRE. Would I need to include it twice (for Intel and for ARM64) or so?
a

Alexander Kurasov[JB]

12/15/2021, 4:52 PM
That is a good question. Could I ask you to create an issue on github, since the topic seems to be an important one
t

Thomas

12/15/2021, 4:53 PM
Sure. Should I create a single issue for all Apple AppStore related issues and feature requests?
I noticed some stuff that is missing in the jpackage task etc
a

Alexander Kurasov[JB]

12/15/2021, 4:54 PM
Let’s start with a single issue. We can always split it later
👍 1
t

Thomas

12/15/2021, 4:58 PM
@Alexander Kurasov[JB] I have been working on some fixes for the jpackage command, which is required for the App Store. Could you maybe take a look? https://github.com/JetBrains/compose-jb/pull/1613
j

james

05/27/2022, 3:24 AM
@Thomas how far did you get with this? it would be great to not have to switch between an M1 and an Intel mac just to build two different builds of our CfD applications I also noticed this issue which appears stale, and I am wondering if there is some way we can contribute?: https://github.com/JetBrains/compose-jb/issues/518 cc: @Igor Demin
t

Thomas

05/30/2022, 2:15 PM
Have not looked further into this yet. For now I am just uploading an Intel-only build. I think the solution would be: 1. build a universal intel/arm64 jar; 2. merge intel/arm64 JREs into one JRE at build time.
For now I am quite busy with Windows but I plan to pick up the macOS issues in the coming months.
There is an open issue about universal Mac build here: https://github.com/JetBrains/compose-jb/issues/1599
Unfortunately it is not as easy as just building a universal jar, as the jre is not universal.
@james if you have any ideas please share them
To build a universal JRE, I think the way to go would be to use
jlink
twice. One time with an Arm64 JDK, second time with an Intel JDK. Then you have two JREs. Must be the exact same JDK version. Then merge the JREs manually using the Apple tools for this into a universal JDK. Then pass that universal JDK to
jpackage
. At least that is what I am going to try when I look into it again.
a

Alex Styl

11/03/2022, 5:25 AM
Was anyone able to make a universal mac os app ? cc @Thomas
t

Thomas

11/03/2022, 12:24 PM
I have not had the time to look into this further yet, it is not a priority for me at the moment.