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

Using third party Lua libraries #39

Open
jugglerchris opened this issue Apr 4, 2016 · 6 comments
Open

Using third party Lua libraries #39

jugglerchris opened this issue Apr 4, 2016 · 6 comments

Comments

@jugglerchris
Copy link
Contributor

Hi,
It would be useful to include some third-party Lua libraries like LuaFilesystem into an application using rust-lua53. Since it builds its own copy of Lua, is there a good way to do this?
Thanks,
Chris

@jcmoyer
Copy link
Owner

jcmoyer commented Jul 1, 2016

You can either load the lfs C library from Lua using require, or you can wrap lfs yourself if you need to make calls to it directly from Rust.

@SpaceManiac
Copy link
Contributor

@jugglerchris I'm interested in addressing this issue. Could you describe the troubles you ran into in more detail?

@jugglerchris
Copy link
Contributor Author

@SpaceManiac My concern was about compiling Lua libraries against the same Lua headers as the rust-lua53 was using. But I don't think it's that important - the Lua ABI is fairly well set, so separately-compiled modules should be fine.
This was thinking ahead - so far I haven't needed to install third party Lua modules in my application.

@SpaceManiac
Copy link
Contributor

Alright, sounds fine. Just as a note for the future, if this does become an issue, the build script can export an environment variable which is accessible to the build scripts of dependencies, and this could be used to pass along the Lua include directory.

@jugglerchris
Copy link
Contributor Author

That sounds like a useful technique, thanks! I'm not sure how to use it here, as rust-lua53 and other packages would both be dependencies of a larger project, rather than rust-lua53 depending on it.

@SpaceManiac
Copy link
Contributor

SpaceManiac commented Sep 4, 2016

Other way around: lua-sys exports DEP_LUA_INCLUDE, external-lua-lib-sys depends on lua-sys and adds that value to the include path.

EDIT: whoops. Know not to respond to emails using that client anymore...

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

No branches or pull requests

3 participants