tech-pkg archive

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

Re: pkg-config files for multiversion Lua



"OBATA Akio" <obata%lins.jp@localhost> writes:

> Hi,
>
> On Sun, 27 Apr 2014 02:06:53 +0900, Alexander Nasonov 
> <alnsn%yandex.ru@localhost> wrote:
>
>> Hi,
>>
>> For a multiversion support of Lua packages lang/lua51 and lang/lua52
>> I need to decide how to handle two currently conflicting lua.pc
>> files. In my current local version they're split into two: lua-5.1.pc
>> and lua-5.2.pc. But at least one package www/lua-curl checks for a
>> package called 'lua'. Because there is no lua.pc file in the buildlink
>> shadow directory, pkg-config fails for this package.
>>
>> I wanted to add a symbolic link lua.pc -> lua-${_LUA_DOT_VERSION}.pc to
>> the shadow directory but I don't see any support for it in the buildlink
>> framework. I see many versioned .pc files in /usr/pkg/lib/pkgconfig but
>> I couldn't find any package that checks unversioned .pc file at config
>> stage. I only checked few packages, though.
>
> You can use BUILDLINK_FNAME_TRANSFORM.
>
> BUILDLINK_FNAME_TRANSFORM.lua51+=     -e 
> 's|lib/pkgconfig/lua-5.1.pc|lib/pkgconfig/lua.pc|'

So this will put lua.pc in the bl3 tree so that depending packages find
it.

> And it is nice to use ALTERNATIVES for out of pkgsrc framework.
>
> bin/lua5.1 @PREFIX@/bin/lua
> lib/pkgconfig/lua-5.1.pc @PREFIX@/lib/pkgconfig/lua.pc

And this will let programs being built not under pkgsrc, or something
typing 'lua foo' get lua51, while allowing a way to switch that to 52.

I wonder  why, given the rampant "#!/usr/bin/env python" that is out
there, we don't have a culture of doing this for python?

Attachment: pgpp0C1sjy2vK.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index