Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ You can also read my [Lua Version Management with asdf-lua](http://stratus3d.com

### Linux Readline

If you are installing Lua 5.4.x or greater on linux by default Lua will be compiled without readline. You can override this behavior by setting `ASDF_LUA_LINUX_READLINE=1` before running `asdf install`. See this thread for the details - http://lua-users.org/lists/lua-l/2020-07/msg00363.html
If you are installing Lua 5.4.x on Linux, Lua will be compiled without
readline.

@Stratus3D Stratus3D Aug 17, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Formatting seems a little off here.

Also might be good to note that 5.1 to 5.3 require readline, and 5.5.x and newer will have readline support dynamically included, so if you want readline make sure it's installed before installing lua.


You can override this behavior by setting `ASDF_LUA_LINUX_READLINE=1` before running `asdf install`.

(See this thread for the details - http://lua-users.org/lists/lua-l/2020-07/msg00363.html)

## Development

Expand Down
17 changes: 8 additions & 9 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,16 @@ get_target() {
# If on OSX (Darwin) then the target is macosx
if [ "$os" = "Darwin" ]; then
echo "macosx"
elif [ "${ASDF_LUA_LINUX_READLINE-}" == "1" ]; then
# Readline is required for 5.1 - 5.3, optional for 5.4, and dynamically included for 5.5
elif [ "${ASDF_LUA_LINUX_READLINE-}" == "1" ] && version_5_4_x "$version"; then
echo "linux-readline"
elif [ "${lua_type}" = "LuaJIT" ]; then
# LuaJIT doesn't use targets like regular Lua
echo ""
else # Otherwise let the lua Makefile guess for us
if less_than_version_5_4x "$version"; then
echo "linux"
else
echo "guess"
fi
elif [ "$os" = "Linux" ]; then
echo "linux"
else
echo "guess"
fi
}

Expand Down Expand Up @@ -176,11 +175,11 @@ version_5_2x_or_greater() {
fi
}

less_than_version_5_4x() {
version_5_4_x() {
version=$1
IFS='.' read -ra version_array <<<"$version"
major_minor_version="${version_array[0]}0${version_array[1]}"
if (("$major_minor_version" < 504)); then
if (("$major_minor_version" >= 504)) && (("$major_minor_version" < 505)); then
return 0
else
return 1
Expand Down
Loading