Stratus3D / asdf-lua

Lua plugin for asdf version manager. https://github.com/asdf-vm/asdf
MIT License
62 stars 12 forks source link

`linux-readline` support #18

Closed siiky closed 2 years ago

siiky commented 3 years ago

Hello there! I'm pretty new to this (asdf and its plugins), so bear with me. :)

Is there a way to have asdf install Lua with a Readline-enabled interpreter on Linux? Making it an option, not the default, of course! The make target (and the variable target on bin/install) is linux-readline.

If you can point me in the right direction I can try to implement it and send a PR; for now I'll try to hack my way through this, not knowing better.


EDIT: I wonder if an environment variable is OK, or frowned upon... It would be easy to make something like ASDF_LUA_LINUX_READLINE=1 asdf install lua 5.4.2 work.

Stratus3D commented 3 years ago

Is there a way to have asdf install Lua with a Readline-enabled interpreter on Linux? Making it an option, not the default, of course! The make target (and the variable target on bin/install) is linux-readline.

Yes, that should be possible.

If you can point me in the right direction I can try to implement it and send a PR; for now I'll try to hack my way through this, not knowing better.

It's been a while since I've worked on this code, but it's fairly simple so you shouldn't have too much trouble getting something working. Please send a PR if you get something working!

EDIT: I wonder if an environment variable is OK, or frowned upon... It would be easy to make something like ASDF_LUA_LINUX_READLINE=1 asdf install lua 5.4.2 work.

Yes, something like that would be fine. Or you could try something a little more elaborate and detect whether everything needed for readline support is present on the OS and conditionally compile with readline support. Both would be welcome contributions. Let me know if there is anything specific I can help with.

siiky commented 3 years ago

Or you could try something a little more elaborate and detect whether everything needed for readline support is present on the OS and conditionally compile with readline support.

That's way too complicated for me :P

Opened #19.

Stratus3D commented 3 years ago

We need to document this flag in the readme, reopening this ticket.

siiky commented 3 years ago

Yeah, I agree. Since you have an article on it already (very nice, btw), and it seems to be the main usage document, I think the article should be updated.

If you want, though, I can still try to add a note to the readme.

stormwatch commented 3 years ago

I had to explicitly set ASDF_LUA_LINUX_READLINE to 0 (or to 1). Otherwise asdf install lua x will complain and won't be able to finsih.

Stratus3D commented 3 years ago

@ktec fixed that I believe. Try updating to the latest version of this plugin.

Stratus3D commented 2 years ago

Completed by https://github.com/Stratus3D/asdf-lua/pull/27