├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | =============================================================================== 2 | 3 | ULua: Universal Lua Distribution. 4 | 5 | Copyright (C) 2015-2016 Stefano Peluchetti. All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | 25 | [ MIT license: http://opensource.org/licenses/MIT ] 26 | 27 | =============================================================================== 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ULua: Universal Lua Distribution 3 | ================================ 4 | 5 | A Lua distribution for Windows, OSX and Linux based on LuaJIT: 6 | 7 | | OS | Architecture | Version | 8 | |---------|--------------|-------------------------------------------| 9 | | Windows | x86/x64 | from Windows 7 onward | 10 | | OSX | x86/x64 | from 10.5 (Leopard) onward | 11 | | Linux | x86/x64 | all common distributions from 2009 onward | 12 | 13 | ## Features 14 | 15 | - binary distribution: no need for a C/C++ compiler, adding new packages is quick and painless 16 | - portable: it's self-contained in a single folder which can be safely relocated, even to a different OS 17 | - no installer is needed and all required dynamic libraries are included 18 | - includes a package manager to install new packages and to keep ULua up to date (LuaJIT binaries and package manager itself included) 19 | 20 | ## Install 21 | 22 | Download and unzip [ulua~latest.zip](http://ulua.io/download/ulua~latest.zip) into an arbitrary folder. This will create a single sub-folder named `ulua` which contains the ULua distribution. 23 | 24 | ``` 25 | ulua 26 | ├── lua.cmd # LuaJIT executable for Windows. 27 | ├── lua # LuaJIT executable for OSX and Linux. 28 | ├── host 29 | │ ├── config.lua # Global configuration (see PKG). 30 | │ ├── init # Initialization scripts folder. 31 | │ ├── tmp # Temporary files folder. 32 | │ └── pkg # Downloaded packages cache folder. 33 | ├── bin 34 | │ ├── upkg.cmd # Package manager executable for Windows. 35 | │ ├── upkg # Package manager executable for OSX and Linux. 36 | │ └── ... # Other executables depending on installed packages. 37 | ├── pkg # Package manager package. 38 | └── ... # Other installed packages. 39 | ``` 40 | 41 | ## Run 42 | 43 | The `lua` executable starts LuaJIT, the [Lua manual](http://www.lua.org/manual/5.1/manual.html#6) and the [LuaJIT manual](http://luajit.org/running.html) document its usage: 44 | 45 | ``` 46 | # On Windows: 47 | > cd folder_containing_ulua/ulua 48 | > lua [options] [script [args]] 49 | 50 | # On OSX and Linux: 51 | > cd folder_containing_ulua/ulua 52 | > ./lua [options] [script [args]] 53 | ``` 54 | 55 | By default LuaJIT runs in 32-bit mode, to run it in 64-bit mode set the environment variable `BIT=64`: 56 | 57 | ``` 58 | # On Windows: 59 | > set BIT=64 60 | 61 | # On OSX and Linux: 62 | > export BIT=64 63 | ``` 64 | 65 | On Linux, if LuaJIT 32-bit is executed on a distribution lacking the 32-bit C runtime, this will result in a meaningless error such as `luajit: command not found`. Either launch LuaJIT in 64-bit mode or install the required Linux libraries. 66 | 67 | ## Packages 68 | 69 | The `upkg` executable provides a convenient way of managing ULua: 70 | 71 | ``` 72 | # On Windows: 73 | > cd folder_containing_ulua/ulua/bin 74 | > upkg available # List all available packages. 75 | > upkg add socket # Download and install the socket package (LuaSocket library). 76 | > upkg add pl # Download and install the pl package (PenLight library). 77 | > upkg update # Update all packages to the latest version. 78 | 79 | # On OSX and Linux: 80 | > cd folder_containing_ulua/ulua/bin 81 | > ./upkg available # List all available packages. 82 | > ./upkg add socket # Download and install the socket package (LuaSocket library). 83 | > ./upkg add pl # Download and install the pl package (PenLight library). 84 | > ./upkg update # Update all packages to the latest version. 85 | ``` 86 | 87 | ## Luarocks 88 | 89 | ULua features [LuaRocks](https://luarocks.org/) integration: new and updated rocks are automatically tracked, compiled and made available in ULua. More than 300 of such packages are currently available for installation. 90 | 91 | ## Documentation 92 | 93 | Refer to the [official documentation](http://ulua.io). 94 | --------------------------------------------------------------------------------