Giter Site home page Giter Site logo

Releasing on MacOS about luasteam HOT 7 OPEN

uspgamedev avatar uspgamedev commented on May 24, 2024
Releasing on MacOS

from luasteam.

Comments (7)

yancouto avatar yancouto commented on May 24, 2024 1

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 :)

from luasteam.

rilifon avatar rilifon commented on May 24, 2024

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

from luasteam.

GeorgeA93 avatar GeorgeA93 commented on May 24, 2024

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.

from luasteam.

GeorgeA93 avatar GeorgeA93 commented on May 24, 2024

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?

from luasteam.

GeorgeA93 avatar GeorgeA93 commented on May 24, 2024

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...?

from luasteam.

yancouto avatar yancouto commented on May 24, 2024

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.

from luasteam.

GeorgeA93 avatar GeorgeA93 commented on May 24, 2024

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.

from luasteam.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.