PerlFFI/FFI-CheckLib

Feature Request: Allow regex as a lib argument in find_lib function

bakkiaraj opened this issue · 3 comments

As of now, FFI::CheckLib provides find_lib function with 'lib' argument takes a 'string.

$libPath = find_lib(lib=>'gio-2.0',libpath=>'/usr/lib64');

Consider, If I write a module based on FFI::CheckLib and the module will run on may machines, The lib version on the target machine may vary. So please allow regex as a argument to lib, So I can preciously set my lib requirements (Ex: what version etc..)

Ex:
$libPath = find_lib(lib=>'gio-2./d+',libpath=>'/usr/lib64');

I think what you want is this:

find_lib( lib => '*', verify => sub { $_[0] =~ /^gio-2\.[0-9]+/ } )

Ohh Great. This will help me. This is what I was looking for.

On Sat, Mar 7, 2015 at 8:05 PM, Graham Ollis notifications@github.com
wrote:

I think what you want is this:

find_lib( lib => '*', verify => sub { $_[0] =~ /^gio-2.[0-9]+/ } )


Reply to this email directly or view it on GitHub
#4 (comment).

Regards,
Bakkiaraj M

With the "verify" option, This requirement can be achieved. Hence, I am closing the ticket.