https://github.com/mlua-rs/luarocks-build-rust-mlua
A LuaRocks build backend for Lua modules written in Rust using mlua
https://github.com/mlua-rs/luarocks-build-rust-mlua
Last synced: 11 months ago
JSON representation
A LuaRocks build backend for Lua modules written in Rust using mlua
- Host: GitHub
- URL: https://github.com/mlua-rs/luarocks-build-rust-mlua
- Owner: mlua-rs
- License: mit
- Created: 2021-04-14T11:49:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-26T22:50:45.000Z (over 1 year ago)
- Last Synced: 2025-04-11T11:05:44.598Z (12 months ago)
- Language: Lua
- Size: 29.3 KB
- Stars: 16
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# luarocks-build-rust-mlua
A [LuaRocks] build backend for Lua modules written in Rust using [mlua].
[LuaRocks]: http://luarocks.org
[mlua]: http://github.com/mlua-rs/mlua
# Example rockspec
```lua
package = "my_module"
version = "0.1.0-1"
source = {
url = "git+https://github.com/username/my_module",
tag = "0.1.0",
}
description = {
summary = "Example Lua module in Rust",
detailed = "...",
homepage = "https://github.com/username/my_module",
license = "MIT"
}
dependencies = {
"lua >= 5.1",
"luarocks-build-rust-mlua",
}
build = {
type = "rust-mlua",
modules = {
-- Native library expected in `/release/libmy_module.so` (linux; uses right name on macos/windows)
"my_module",
-- More complex case, native library expected in `/release/libalt_name.so`
["my_module"] = "alt_name",
},
-- Optional: target_path if cargo "target" directory not in the module root
target_path = "path/to/cargo/target/directory"
-- Optional: if set to `false` pass `--no-default-features` to cargo
default_features = false,
-- Optional: copy additional files to lua dir, can specify source path
include = {
"file.lua",
["path/to/another/file.lua"] = "another-file.lua",
},
-- Optional: pass additional features
features = {"extra", "features"}
}
```