Building Lua modules for Lua embedded in Rust (rust-lua53)
<p>I'm currently using the <a href="https://github.com/jcmoyer/rust-lua53" rel="nofollow">rust-lua53</a> crate to embed Lua into a Rust project.  rust-lua53 downloads and builds the Lua tarball during "cargo build" (in its build.rs).</p>

<p>I'd like to make other Lua libraries (written in C) available to Lua code in my application, eg <a href="http://www.inf.puc-rio.br/~roberto/lpeg/" rel="nofollow">LPeg</a> or <a href="https://keplerproject.github.io/luafilesystem/" rel="nofollow">LFS</a>, but it's not obvious to me how to do it.</p>

<p>My ideas so far are:</p>

<ul>
<li>Build the libraries against a stock Lua and hope I get away with it (or have to check it matches every subsequent rust-lua53 release)</li>
<li>Somehow expose the relevant headers from rust-lua53 (can a crate include extra files like that?)</li>
<li>Change to a different Rust/Lua binding which somehow makes this easier.</li>
<li>Fork rust-lua53 and make it embed the extra libraries I want as well as the plain Lua interpreter.</li>
<li>Implement the functionality in Rust instead of relying on C libraries.  Plausible for LFS in my application, but re-implementing LPeg is beyond what I want to do right now!</li>
</ul>