lua-users home
lua-l archive

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


Hi,

There was a recent thread about lua.pc which reminded me of a related issue for downstream packagers.

Downstream often need to deal with the difference of "vendor" modules (moduels shipped with distro package manager) and locally installed, "site" modules.

Distro packages that ship lua modules (eg "vendor" modules) are normally installed in /usr, while /usr/local is reserved for locally "site" specific installs.

Downstream packagers often want Lua to find both "site" modules and "vendor" modules.

And example patch that Alpine Linux use that has its origin from debian:
What I would like propose is that upstream Lua provides the concept of vendor_prefix and site_prefix so we could have a clean way to specify the vendor and site search paths.

Maybe something like:
# define LUA_VENDOR_ROOT "/usr/"
# define LUA_VENDOR_LDIR LUA_VENDOR_ROOT "share/lua" LUA_VDIR
# define LUA_VENDOR_CDIR LUA_VENDOR_ROOT "lib/lua" LUA_VDIR

# define LUA_SITE_ROOT "/usr/local/"
# define LUA_SITE_LDIR LUA_SITE_ROOT "share/lua" LUA_VDIR
# define LUA_SITE_CDIR LUA_SITE_ROOT "lib/lua" LUA_VDIR

...

It would also be awesome if this could be detected at runtime:

lua -e 'print(package.vendor_path)'
lua -e 'print(package.site_path)'

Some variables for those in lua-<version>.pc would also be nice.

That way we packages could install things in the vendor_path without worrying that we conflict with locally, manually built/managed modules.

--
Natanael Copa