Skip to content
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 for macos? #41

Open
Catizard opened this issue Oct 7, 2024 · 5 comments
Open

Support for macos? #41

Catizard opened this issue Oct 7, 2024 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Catizard
Copy link

Catizard commented Oct 7, 2024

Tried building project from source but get link library error: Failed to load library: liblwjgl.dylib
Seems like the gradle should import something likelwjgl:native-macos, but I don't quite understand how dependency is managed

@seraxis
Copy link
Owner

seraxis commented Oct 7, 2024

in the move to gradle an early decision was made to still create an "uber jar" to retain the portability that upstream beatoraja achieves and allow for the drop-in replacement of Endless Dream jars. When creating an uberjar like this gradle will download all platform natives and package them, I wrote a build plugin that filters those down to a few supported architectures in a slightly hacky way.

Modifying the build scripts to support MacOS should be relatively simple but I don't have a MacOS machine to validate any build I would produce, but PRs to assist are more than welcome!

@seraxis seraxis added enhancement New feature or request help wanted Extra attention is needed labels Oct 7, 2024
@Catizard Catizard closed this as completed Oct 8, 2024
@Catizard Catizard reopened this Oct 8, 2024
@Catizard
Copy link
Author

Catizard commented Oct 8, 2024

↑mistake :(
I have platform=macos in my gradle.properties but it didn't give me correct dependency.
I will do some research in my spare time, thanks :D

@seraxis
Copy link
Owner

seraxis commented Oct 8, 2024

As stated above platform=macos does not currently work, if you'd like to contribute I would definitely appreciate it and you can use this issue to track your progress

@Catizard
Copy link
Author

Catizard commented Oct 9, 2024

I managed to run MainLoader :D

Following your comment I found that PlatformFilter has filtered lwjgl:natives-macos-arm64.jar and kept lwjgl:natives-macos.jar, which leads to the initial "Failed to load library" problem. It seems also influence arm linux users by providing the similar 2 packages lwjgl:natives-linux-arm64.jar and lwjgl:natives-linux.jar.

It's a little bit strange that lwjgl:natives-macos.jar is abbreviating the x86-64 suffix. Maybe we need to do some workaround to fix this (like giving the arm64 suffix when the arch is specified as aarch64).

However, when I pressed the Play button, the game crashed. And it says cannot find sqlite and imgui-java64 library :(

Raw exception messages:

Caused by: java.lang.Exception: No native library is found for os.name=Mac and os.arch=aarch64. path=/org/sqlite/native/Mac/aarch64
Caused by: java.lang.UnsatisfiedLinkError: no imgui-java64 in java.library.path: /Users/suzume/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.

Seems like still architecture problem. I think I can figure it out soon :D

UPD: imgui-java64 needs to upgrade to 1.87.0 to support macos-arm64 and yes, it brings some api changes :(
UPD2: Sqlite connector version is too low that doesn't give support for macos-arm64. After upgrading its version to 3.42.0.0 I finally launched Endless Dream in success :D

@seraxis
Copy link
Owner

seraxis commented Oct 22, 2024

Ahh yes now I remember, the sqlite package gets mangled by the platform filter unintentionally as it uses different prefixes I believe? It might need it's own separate dependency pass to reduce file size (I intentionally try and get it lower than upstream).

Glad to hear you got it working! If you want to open a PR that would be much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants