https://github.com/cablehead/luajit-bundle
An experiment at packaging the ability to compile luajit applications to standalone system binaries
https://github.com/cablehead/luajit-bundle
Last synced: 11 months ago
JSON representation
An experiment at packaging the ability to compile luajit applications to standalone system binaries
- Host: GitHub
- URL: https://github.com/cablehead/luajit-bundle
- Owner: cablehead
- Created: 2014-09-19T22:06:35.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-09-19T22:50:19.000Z (over 11 years ago)
- Last Synced: 2025-07-10T11:04:58.318Z (11 months ago)
- Language: Lua
- Homepage:
- Size: 129 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## luajit-bundle
This is an experiment at packaging the ability to compile luajit applications
to standalone system binaries. It's inspired by Luke Gorrie's
[Snabbswitch](https://github.com/SnabbCo/snabbswitch) project.
At the moment it supports compiling a single Lua script to a standalone binary,
and makes the binaries argv and argc available to the Lua script as the
standard Lua arg global.
## Dependencies
```
$ luarocks install stdlib lua-path
```
## Usage
foo.lua:
```lua
for i, v in ipairs(arg) do
print(i, v)
end
```
```bash
$ bin/luajit-bundle foo.lua -o ./foo
...
$ ./foo bar 123
1 bar
2 123
```
## TODO
Compiling a single Lua file isn't particularly useful. This needs the ability
to describe all the Lua modules which should be linked with the binary.
It'd be great if this could just be installed with luarocks. I'm a complete Lua
newb though. Is it possible to distribute runnable commands with luarocks?