On 7 May 2010 16:30, Maab <
maa...@gmail.com> wrote:
>
>
> On May 6, 5:31 pm, Matthew Wild <
mwi...@gmail.com> wrote:
>> You can change the suffix with ./configure --lua-suffix=""
>>
>> The problem with Lua and its libraries on OpenSUSE has been that the
>> Lua package is built to look for libraries in one location, but the
>> library packages themselves install to another location. I have no
>> clue how it managed to get so broken, but to check this is the issues
>> you can run for example: "lua -llfs" to search for the luafilesystem
>> library. I suspect you'll see it looking for lfs.so in a place
>> different to where the package installed it.
>>
>> I'm not sure what to suggest if this is still the case... probably the
>> best way would be to add to the Lua path through the Prosody config.
>>
>> If you can find out where the library packages are being installed to
>> (ie. find the files that the luafilesystem package installed) then I
>> can tell you what you would need to put in the config to help Lua find
>> them.
>
> Ah. Okay, brill. Should have thought of that.
>
> The issue seems to be that lua expects all it's components to be in
> the /usr/local tree, and the openSUSE package is storing them in /usr.
> That and also this is a 64-bit system, so libs built to that
> architecture are in something/lib64.
>
OpenSUSE really need to fix this - if you know the relevant place to
file a bug against their lua package, tell them they should replace
/usr/local with /usr in src/luaconf.h :)
> So I can fix this I believe by creating symbolic links thus:
>
> sudo ln -s /usr/share/lua /usr/local/share/
> sudo ln -s /usr/lib64/lua /usr/local/lib/
> sudo ln -s /usr/lib64/lua /usr/local/lib64/
>
Yes, that's one way. Though it could mess up other apps on your system
that you would ever install there. /usr/local is often used as a
convenient place to keep things separated from other
programs/libraries on the system (usually /usr is managed by a package
manager, /usr/local is not).
> Duuno if that's better than fixing the paths in prosody or not. I
> suppose it would mean that other lua apps, did I have any, might work
> better.
>
Try this at the top of your Prosody config:
package.path = package.path:gsub("/usr/local/", "/usr/")
package.cpath = package.cpath:gsub("/usr/local/", "/usr/")
The former is for the location of pure-Lua modules, the latter for
binary (.so) modules.
Regards,
Matthew