2010/10/6 steve donovan <[email protected]>: > On Wed, Oct 6, 2010 at 12:38 PM, Jerome Vuarand > <[email protected]> wrote: >> One of my modules has optional dependencies, that is, it can use some >> other modules (struct and luabitop), but it works perfectly (with some >> features unavailable) if those dependencies are missing. > > One solution is to have two packages; say we have 'frodo', but then > there's also 'frodo-extra' which depends on frodo and ensures that the > optional dependencies are also met.
Ok, thanks for the tip, I'll probably go down that route, but rather with a frodo-core and a more inclusive frodo since dependencies are available most of the time. >> How can I tell LuaRocks that if C module >> compilation is available it should build it, and otherwise just ignore >> the C module? > > AFAIK no support for that. It's hard to do such a check in a > cross-platform way. You can't use makefiles to do the check because > maybe there isn't make! A rock can execute an arbitrary command as a > post-install hook, which could conditiionally invoke LuaRocks itself. > The post-install hook could run an installed Lua program, so in > principle it could be done. (That is, the rock installs a bin script, > which then gets invoked afterwards.) > > LuaRocks dependency checking is very pass/fail. apt-get and friends > have the concept of 'recommended' packages. Not a disaster if you > don't need them, or if they fail to install. It's perhaps something we > should think about. What would happen if I try to install a C module as source on a luarocks installation without C compiler? Would it fail for the whole rock or issue warnings for just these modules? Maybe we could have a new field in the builtin module description, next to 'sources' or 'incdirs'. Something like 'fallback', which would describe the action to take if a C module cannot be compiled, and could be set to 'ignore', 'warning' or 'error', with the current behavior as default. The 'fallback' could even be the name of a Lua file containing a pure Lua implementation of the C module. That sounds clean enough, but I'm a "luarocks newbie", so I may be wrong :-) _______________________________________________ Luarocks-developers mailing list [email protected] http://lists.luaforge.net/cgi-bin/mailman/listinfo/luarocks-developers
