{"id":32985677,"url":"https://github.com/philanc/slua","last_synced_at":"2025-11-18T02:02:10.562Z","repository":{"id":215177295,"uuid":"44291770","full_name":"philanc/slua","owner":"philanc","description":"A static build of Lua for Linux, with compression and crypto built-in","archived":false,"fork":false,"pushed_at":"2023-01-22T18:17:11.000Z","size":8624,"stargazers_count":26,"open_issues_count":1,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-07-24T04:33:24.443Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/philanc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-10-15T03:33:13.000Z","updated_at":"2024-07-23T09:42:35.000Z","dependencies_parsed_at":"2024-01-03T01:19:22.825Z","dependency_job_id":"f99a8e4d-5812-4ba8-acc9-c9637b33fca5","html_url":"https://github.com/philanc/slua","commit_stats":null,"previous_names":["philanc/slua"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/philanc/slua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philanc%2Fslua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philanc%2Fslua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philanc%2Fslua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philanc%2Fslua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/philanc","download_url":"https://codeload.github.com/philanc/slua/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/philanc%2Fslua/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284988465,"owners_count":27095952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-18T02:00:05.759Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-13T08:00:33.766Z","updated_at":"2025-11-18T02:02:10.556Z","avatar_url":"https://github.com/philanc.png","language":"C","funding_links":[],"categories":["Resources"],"sub_categories":["Build Tools and Standalone Makers"],"readme":"![CI](https://github.com/philanc/slua/workflows/CI/badge.svg)\n\n# slua\n\nA static build of [Lua](http://www.lua.org/) 5.4 for Linux, with a few extension libraries.\n\nFor convenience, a slua binary is provided for x86_64.\n\n### Preloaded libraries\n\nAdditional libraries are *pre-loaded*. They must be require()'d before use.\n\n- [luazen](https://github.com/philanc/luazen), a small library with LZMA compression and various crypto functions.\n- [lualinux](https://github.com/philanc/lualinux), a minimal binding to common Linux/Posix functions. -- see a list of [lualinux available functions](https://github.com/philanc/lualinux#available-functions))\n- [linenoise](src/linenoise.md) - slua is built on Linux with linenoise to replace readline. A limited Lua binding to linenoise is also provided to allow usage of linenoise in applications.\n\n\n### Extension mechanism\n\n[srlua](https://webserver2.tecgraf.puc-rio.br/~lhf/ftp/lua/#srlua) by Luiz Henrique de Figueiredo (lhf@tecgraf.puc-rio.br) is included. As put by its author, this is a self-running Lua interpreter.  It is meant to be combined with a Lua program  into a single, stand-alone program that  will execute the given Lua program when it is run.\n\nIt has been slightly modified:\n\n* `srlua` and its companion program `srglue` are statically built (do `make srlua`). They are used exactly as the original `srlua` and `srglue`. See for example the target `srlua` in the Makefile.\n\n* The additional slua libraries are also built in `srlua`.\n\n* `srlua` uses `/proc/self/exe` instead of `argv[0]` to find the executable program and read the embedded Lua code. It allows the program to be placed somewhere in $PATH and called by just its name from anywhere. \n\n\n### Static build\n\nslua is linked completely statically. It uses no dynamic library, not even libc.  So it can be used anywhere, whatever the platform dynamic linker and libraries versions. It is built with the Musl C library which allows a very compact executable. \n\nIt can be dropped and run from any directory, without interference with the local dynamic libraries and linker.  \n\nOn the other end, obviously, slua cannot load dynamic C libraries. It is *not* intended to be a replacement for a full fledged Lua installation.\n\nslua respects the environment variables LUA_PATH and LUA_CPATH.\n\n### Installation\n\nThe `src` directory includes all the required sources, so building `slua` doesn't require any external dependencies.\n\nThere is no installation. The slua executable is static. It can be placed and executed anywhere. \n\nThe default slua build procedure assumes that the C compiler is gcc and that musl libc is installed. It uses the `musl-gcc`  wrapper.\n\nWith a recent Debian (or Ubuntu, Mint, ...) musl libc can be installed with\n```\n sudo apt install  musl  musl-dev musl-tools\n ```\n \n In that case, the makefile can be used as-is.\n \nOther distributions may include musl packages. Alternatively musl libc can easily be built  form source. See instructions at https://www.musl-libc.org/\n\nIf the `musl-gcc` wrapper is not accessible in `$PATH`, or if another toolchain is used, the makefile must be adjusted accordingly.\n\nThen run 'make' at the root of the project tree:\n```\n  make\n```\n\nThe default target buils the `slua` executable, the associated `sluac` Lua compiler, and `srlua` and its companion `srglue` (See \"extension mechanism\" above). All these programs are statically linked.\n\n### Pre-built binary\n\nA binary version of slua is provided here for convenience. This is a standalone executable, statically compiled with musl-1.2.2 for Linux x86_64.\n\n### Package versions\n\nlua-5.4.3 - http://www.lua.org/ftp/lua-5.4.3.tar.gz\n\nluazen-2.1 - https://github.com/philanc/luazen\n\nlualinux-0.3 - https://github.com/philanc/lualinux\n\nlinenoise - The full *readline* library is not used. It is replaced by the much smaller *linenoise* library.  The linenoise implementation included here has been simplified to keep only functions used by the Lua REPL and extended to include a Lua binding. It is derived from Linenoise v1.0 - commit 027dbce - https://github.com/antirez/linenoise\n\n### Modifications of the vanilla Lua\n\nlua.c is not used. It is replaced with src/slua.c. The only differences between lua.c and slua.c are the replacement of the readline interface with linenoise, and the addition of the preloaded libraries (look for \"preloaded libraries\", close to the end of slua.c)\n\n### License and credits\n\nLua and all extension libraries are distributed under the terms of their respective licenses (MIT or equivalent - see in the ./src directory).\n\nI am of course grateful to the PUC-Rio team for the great [Lua](http://www.lua.org/) language.\n\nThe built-in libraries include some code from various authors:\n- linenoise by Salvatore Sanfilippo - https://github.com/antirez/linenoise\n- lzma compression by Igor Pavlov - https://www.7-zip.org/sdk.html\n- xchacha20/poly1305, blake2b, argon2i, x25519 DH key exchange and ed25519 signature from Loup Vaillant's Monocypher -  https://monocypher.org/\n- srlua by Luiz Henrique de Figueiredo (public domain)\n\nslua itslef and the library bindings are distributed under the MIT License (see file LICENSE)\n\nCopyright (c) 2022  Phil Leblanc \n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilanc%2Fslua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphilanc%2Fslua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphilanc%2Fslua/lists"}