lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 15 July 2016 at 14:41, Hisham <h@hisham.hm> wrote:
> On 15 July 2016 at 05:58, Javier Guerra Giraldez <javier@guerrag.com> wrote:
>> of course, Lua doesn't really need to be patched, carefully handling
>> environment variables work perfectly.  I'd like LuaRocks had that
>> option too.
>
> It has! :) LuaRocks supports $LUAROCKS_CONFIG, through which you can
> point to a config file of your current environment's liking.


nice.  Can I specify LUA_PATH and LUA_CPATH, instead of having to live
with the tree sturcture?  I don't mind if it needs it for compiling,
or bookkeeping; I just want to get the final scripts/libs on
easy-to-actually-use directories.

I understand that to manage diferent versions of Lua and libraries,
and many uses at the same time, a complex tree is needed; but when
used in project-specific configs, there's single Lua and a single
version of each library.

what I would really love:

> mkdir myproj; cd myproj
> source localrocks setup  --lua_path=lib  --lua_cpath=clib    # even better if cpath=path by default
> localrocks install ljsyscall
> localrocks install lpeg
> localrocks install telescope
..... code away!


and get something like this:

myproj/
  +--  .luarocks/
  |
  +--  clib/
  |   +-- lpeg.so
  |
  +--  lib/
  |   +--  lpeg/
  |   |   +-- re.lua
  |   |
  |   +--  syscall/
  |   |   +-- ...
  |   |       ...
  |   |
  |   +--  syscall.lua
  |   +--  telescope.lua
  |
  +-- mymain.lua


now, i haven't checked every environment manager out there, so maybe
somebody has done this already?  The main point is: don't use, modify,
depend, or care about, some "system" or "user" environment, just a
"project"


-- 
Javier