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

Fix SteamLibraryLoaderGdx on macOS #133

Closed
wants to merge 3 commits into from

Conversation

Rizato
Copy link
Contributor

@Rizato Rizato commented Sep 27, 2023

Behind the scenes, the libgdx loader extracts libsteam_api.dylib and libsteamworks4j.dylib into separate directories based on the CRC checksum of their contents.
Unfortunately, libsteam_api.dylib has an install name of @loader_path/libsteam_api.dylib.
When loading libsteamworks4j.dylib it expects libsteam_api.dylib to be in the same directory.

This patch hardcodes the result of crc() to 00000000. As a result, both libraries will be extracted inside <libgdx-path>/00000000/ and libsteamworks4j.dylib loads successfully.

Fixes #117

Behind the scenes, the libgdx loader extracts libsteam_api.dylib and
libsteamworks4j.dylib into separate directories based on the CRC
checksum of their contents.
Unfortunately, libsteam_api.dylib has an install name of
@loader_path/libsteam_api.dylib.
When loading libsteamworks4j.dylib it expects libsteam_api.dylib to have
been in the same directory.

This patch hardcodes the result of `crc()` to `00000000`.
As a result, both libraries will be extracted inside
`<libgdx-path>/00000000/` and libsteamworks4j.dylib loads successfully.
@Rizato
Copy link
Contributor Author

Rizato commented Sep 27, 2023

Closing #130 as this solves the problem it tried to workaround.

@Rizato
Copy link
Contributor Author

Rizato commented Sep 27, 2023

Tested on Windows, Intel Mac, and Steam Deck

@Rizato
Copy link
Contributor Author

Rizato commented Sep 27, 2023

@noblemaster Could you try this out for me on an apple silicon mac? I still don't have access to one sadly, but I suspect this will work for you since the previous loader did.

@noblemaster
Copy link

noblemaster commented Sep 29, 2023

Yes, it works on M2! Just merge it when you are ready. 😄

@Rizato
Copy link
Contributor Author

Rizato commented Sep 29, 2023

Yes, it works on M2! Just merge it when you are ready. 😄

Awesome! Thanks.

@Rizato
Copy link
Contributor Author

Rizato commented Sep 29, 2023

@code-disaster Any thoughts?

@kr05
Copy link

kr05 commented Feb 9, 2024

This seems to be the solution I need. How can I test this as well?

@code-disaster
Copy link
Owner

I cherry-picked your change in f0cc286 and made a small adjustment in cb972c9 to remember and reuse the CRC of the first library extracted.

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

Successfully merging this pull request may close these issues.

Unable to load libsteamworks4j.dylib on Apple Silicon M1 (new MAC hardware)
4 participants