Closed GeorgeA93 closed 1 month ago
Hi there George!
Have you tried putting luasteam.so on the same root folder as your .app? I believe this was our solution when we used luasteam on a OSX binary release in a project a few years ago, please try to see if it works and update us in any case
Hi there George!
Have you tried putting luasteam.so on the same root folder as your .app? I believe this was our solution when we used luasteam on a OSX binary release in a project a few years ago, please try to see if it works and update us in any case
Hi rilifon! Gave that a go, and it still gives me the same error.
On that note, its also worth noting im not sure where I need to place the libsteam_api.dylib
too. This might be a combined issue?
Okay I managed to get a somewhat hacky approach to this working. If I modify the package.cpath
in lua to search for the current source directory like so:
local dir = love.filesystem.getSourceBaseDirectory()
package.cpath = package.cpath .. ';' .. dir .. '/?.so'
And put the luasteam.so
and the libsteam_api.dylib
inside of MyApp.app/Contents/Resources
it works!
But I am not stoked about this approach, it feels rather wrong to have to do this. Can I get any confirmation this is an OK thing to do or will I run into issues when actually distributing the app...?
Hey @GeorgeA93 !
I'm afraid that's the solution to be able to place the library next to the love file, and it is indeed what we have done in our game in which we use luasteam (and for which we created luasteam :D)
Check it out here: https://github.com/MarvellousSoft/MarvInc/blob/e914dcd15d7b538793c7dcac27d3350d716d47db/marv/main.lua#L10-L13
This is definitely ok to do. It is something we could explain on the "Getting Started" wiki for this repo.
Hi @yancouto good to see someone else is doing the same thing! I'd be happy to submit a PR which adds this to the Getting Started section. Would deffo help a lot of people out!
My final question, why is this needed? What is the difference about running it as a mac app vs running it via love. The cpath is the same in both scenarios?
I can close out this issue with the PR to add the docs, unless you want to close now.
It has to do with how love sets up cpath
when running lua, in both fused and unfused binaries. This thread has some more info about that. It might be possible to not set the cpath but this was a consistent way to do it across platforms I found, and I haven't look much deeper into that.
I would be glad to review a PR with those changes, no need to close the issue now :)
The link to the "hack" is now in the Getting Started section.
Hello! I am trying to build my game for release on macos. Following the 'Creating a macOS Application' steps here: https://love2d.org/wiki/Game_Distribution
My game runs fine before building, but if I try to run the actual built game I get the follow error:
I have tried placing the luasteam.so in the different directories inside my game, but to no avail.
I think this has something to do with how love is loading (or not loading) libraries in fused mode, but I am a bit stumped as to how to proceed from here.