vhyrro / luarocks-build-rust-binary

A luarocks build step allowing rocks to bundle Rust binaries with the library.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust Binary Bundler for Luarocks

This module allows users to compile any arbitrary binary from crates.io by using cargo install under the hood. The compiled binary is placed into a bin/ subdirectory in the luarocks tree.

Usage

Within your rockspec supply the following build step:

build = {
    type = "rust-binary",
    binary = "<binary name>",
    copy_directories = { --[[ Any custom directories (e.g. "doc") ]], "bin" },
}

Where <binary name> is any binary available on crates.io. If you would like to install a specific version of the binary, set binary to the following (replacing 1.0.0 with your preferred version):

build = {
    type = "rust-binary",
    binary = "binary@1.0.0",
    copy_directories = { "bin" },
}

For user convenience it may make sense to pack your rocks as binary rocks to save the user the compilation hassle.

Known Limitations

  • Installing many binaries is not supported.
  • Installing to a custom directory is not yet supported.

About

A luarocks build step allowing rocks to bundle Rust binaries with the library.

License:MIT License


Languages

Language:Lua 100.0%