Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package perl-FFI-CheckLib for openSUSE:Factory checked in at 2022-10-10 18:43:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/perl-FFI-CheckLib (Old) and /work/SRC/openSUSE:Factory/.perl-FFI-CheckLib.new.2275 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-FFI-CheckLib" Mon Oct 10 18:43:46 2022 rev:7 rq:1007971 version:0.31 Changes: -------- --- /work/SRC/openSUSE:Factory/perl-FFI-CheckLib/perl-FFI-CheckLib.changes 2022-10-01 17:42:02.033547389 +0200 +++ /work/SRC/openSUSE:Factory/.perl-FFI-CheckLib.new.2275/perl-FFI-CheckLib.changes 2022-10-10 18:43:58.398792559 +0200 @@ -1,0 +2,12 @@ +Sat Oct 1 03:06:46 UTC 2022 - Tina M??ller <timueller+p...@suse.de> + +- updated to 0.31 + see /usr/share/doc/packages/perl-FFI-CheckLib/Changes + + 0.31 2022-09-30 07:42:44 -0600 + - Better support for Homebrew and MacPorts on macOS (gh#46 cdalvaro++) + - New environment variable FFI_CHECKLIB_PACKAGE (gh#46) + - New environment variable FFI_CHECKLIB_PATH (gh#50, gh#52) + - Documentation improvements (gh#49, gh#52) + +------------------------------------------------------------------- Old: ---- FFI-CheckLib-0.30.tar.gz New: ---- FFI-CheckLib-0.31.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ perl-FFI-CheckLib.spec ++++++ --- /var/tmp/diff_new_pack.9HLdxO/_old 2022-10-10 18:43:58.890793618 +0200 +++ /var/tmp/diff_new_pack.9HLdxO/_new 2022-10-10 18:43:58.890793618 +0200 @@ -18,7 +18,7 @@ %define cpan_name FFI-CheckLib Name: perl-FFI-CheckLib -Version: 0.30 +Version: 0.31 Release: 0 License: Artistic-1.0 OR GPL-1.0-or-later Summary: Check that a library is available for FFI @@ -28,11 +28,13 @@ BuildArch: noarch BuildRequires: perl BuildRequires: perl-macros +BuildRequires: perl(File::Which) BuildRequires: perl(List::Util) >= 1.33 BuildRequires: perl(Test2::API) >= 1.302015 BuildRequires: perl(Test2::Require::EnvVar) >= 0.000121 BuildRequires: perl(Test2::Require::Module) >= 0.000121 BuildRequires: perl(Test2::V0) >= 0.000121 +Requires: perl(File::Which) Requires: perl(List::Util) >= 1.33 %{perl_requires} ++++++ FFI-CheckLib-0.30.tar.gz -> FFI-CheckLib-0.31.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/Changes new/FFI-CheckLib-0.31/Changes --- old/FFI-CheckLib-0.30/Changes 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/Changes 2022-09-30 15:42:45.000000000 +0200 @@ -1,5 +1,11 @@ Revision history for FFI-CheckLib +0.31 2022-09-30 07:42:44 -0600 + - Better support for Homebrew and MacPorts on macOS (gh#46 cdalvaro++) + - New environment variable FFI_CHECKLIB_PACKAGE (gh#46) + - New environment variable FFI_CHECKLIB_PATH (gh#50, gh#52) + - Documentation improvements (gh#49, gh#52) + 0.30 2022-09-22 04:24:26 -0600 - [ BREAKING CHANGE ] If the alien option is provided, the libraries provided by aliens will be diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/MANIFEST new/FFI-CheckLib-0.31/MANIFEST --- old/FFI-CheckLib-0.30/MANIFEST 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/MANIFEST 2022-09-30 15:42:45.000000000 +0200 @@ -37,6 +37,9 @@ corpus/unix/lib/libfoo.so.2 corpus/unix/lib/libfoo.so.2.3 corpus/unix/lib/libfoo.so.2.3.4 +corpus/unix/path/path1/libfoo.so.1 +corpus/unix/path/path2/libfoo.so.2 +corpus/unix/path/path3/libfoo.so.3 corpus/unix/usr/lib/libbar.so corpus/unix/usr/lib/libbar.so.1 corpus/unix/usr/lib/libbar.so.1.2 @@ -85,6 +88,7 @@ xt/author/no_tabs.t xt/author/pod.t xt/author/pod_coverage.t +xt/author/pod_link.t xt/author/pod_spelling_common.t xt/author/pod_spelling_system.t xt/author/strict.t diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/META.json new/FFI-CheckLib-0.31/META.json --- old/FFI-CheckLib-0.30/META.json 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/META.json 2022-09-30 15:42:45.000000000 +0200 @@ -86,6 +86,7 @@ "requires" : { "FindBin" : "0", "Perl::Critic" : "0", + "Test2::Require::EnvVar" : "0.000121", "Test2::Require::Module" : "0.000121", "Test2::Tools::PerlCritic" : "0", "Test2::V0" : "0.000121", @@ -96,6 +97,7 @@ "Test::NoTabs" : "0", "Test::Pod" : "0", "Test::Pod::Coverage" : "0", + "Test::Pod::LinkCheck::Lite" : "0", "Test::Pod::Spelling::CommonMistakes" : "0", "Test::Spelling" : "0", "Test::Strict" : "0", @@ -104,6 +106,7 @@ }, "runtime" : { "requires" : { + "File::Which" : "0", "List::Util" : "1.33", "perl" : "5.006" } @@ -131,7 +134,7 @@ }, "x_IRC" : "irc://irc.perl.org/#native" }, - "version" : "0.30", + "version" : "0.31", "x_contributors" : [ "Graham Ollis <plice...@cpan.org>", "Bakkiaraj Murugesan (bakkiaraj)", @@ -140,10 +143,11 @@ "Shawn Laffan (SLAFFAN)", "Petr P\u00edsa\u0159 (ppisar)", "Michael R. Davis (MRDVT)", - "Shawn Laffan (SLAFFAN)" + "Shawn Laffan (SLAFFAN)", + "Carlos D. \u00c1lvaro (cdalvaro)" ], - "x_generated_by_perl" : "v5.37.3", - "x_serialization_backend" : "Cpanel::JSON::XS version 4.32", + "x_generated_by_perl" : "v5.36.0", + "x_serialization_backend" : "Cpanel::JSON::XS version 4.30", "x_spdx_expression" : "Artistic-1.0-Perl OR GPL-1.0-or-later", "x_use_unsafe_inc" : 0 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/META.yml new/FFI-CheckLib-0.31/META.yml --- old/FFI-CheckLib-0.30/META.yml 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/META.yml 2022-09-30 15:42:45.000000000 +0200 @@ -22,6 +22,7 @@ directory: - corpus requires: + File::Which: '0' List::Util: '1.33' perl: '5.006' resources: @@ -29,7 +30,7 @@ bugtracker: https://github.com/PerlFFI/FFI-CheckLib/issues homepage: https://metacpan.org/pod/FFI::CheckLib repository: git://github.com/PerlFFI/FFI-CheckLib.git -version: '0.30' +version: '0.31' x_contributors: - 'Graham Ollis <plice...@cpan.org>' - 'Bakkiaraj Murugesan (bakkiaraj)' @@ -39,7 +40,8 @@ - 'Petr P??sa?? (ppisar)' - 'Michael R. Davis (MRDVT)' - 'Shawn Laffan (SLAFFAN)' -x_generated_by_perl: v5.37.3 + - 'Carlos D. ??lvaro (cdalvaro)' +x_generated_by_perl: v5.36.0 x_serialization_backend: 'YAML::Tiny version 1.73' x_spdx_expression: 'Artistic-1.0-Perl OR GPL-1.0-or-later' x_use_unsafe_inc: 0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/Makefile.PL new/FFI-CheckLib-0.31/Makefile.PL --- old/FFI-CheckLib-0.30/Makefile.PL 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/Makefile.PL 2022-09-30 15:42:45.000000000 +0200 @@ -25,7 +25,8 @@ "lib/FFI/CheckLib.pm" => "\$(INST_LIB)/FFI/CheckLib.pm" }, "PREREQ_PM" => { - "List::Util" => "1.33" + "File::Which" => 0, + "List::Util" => "1.33" }, "TEST_REQUIRES" => { "Test2::API" => "1.302015", @@ -33,13 +34,14 @@ "Test2::Require::Module" => "0.000121", "Test2::V0" => "0.000121" }, - "VERSION" => "0.30", + "VERSION" => "0.31", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( + "File::Which" => 0, "List::Util" => "1.33", "Test2::API" => "1.302015", "Test2::Require::EnvVar" => "0.000121", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/README new/FFI-CheckLib-0.31/README --- old/FFI-CheckLib-0.30/README 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/README 2022-09-30 15:42:45.000000000 +0200 @@ -4,7 +4,7 @@ VERSION - version 0.30 + version 0.31 SYNOPSIS @@ -237,6 +237,51 @@ This function is not exportable, even on request. +ENVIRONMENT + + FFI::CheckLib responds to these environment variables: + + FFI_CHECKLIB_PACKAGE + + On macOS platforms with Homebrew <http://brew.sh> and/or MacPorts + <https://www.macports.org> installed, their corresponding lib paths + will be automatically appended to $system_path. In case of having + both managers installed, Homebrew will appear before. + + This behaviour can be overridden using the environment variable + FFI_CHECKLIB_PACKAGE. + + Allowed values are: + + - none: Won't use either Homebrew's path nor MacPorts - homebrew: + Will append $(brew --prefix)/lib to the system paths - macports: Will + append port's default lib path + + A comma separated list is also valid: + + export FFI_CHECKLIB_PACKAGE=macports,homebrew + + Order matters. So in this example, MacPorts' lib path appears before + Homebrew's path. + + FFI_CHECKLIB_PATH + + List of directories that will be considered by FFI::CheckLib as + additional "system directories". They will be searched before other + system directories but after libpath. The variable is colon separated + on Unix and semicolon separated on Windows. If you use this variable, + FFI_CHECKLIB_PACKAGE will be ignored. + + PATH + + On Windows the PATH environment variable will be used as a search + path for libraries. + + On some operating systems LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, + DYLD_FALLBACK_LIBRARY_PATH or others may be used as part of the search + for dynamic libraries and may be used (indirectly) by FFI::CheckLib as + well. + FAQ Why not just use dlopen? @@ -321,6 +366,8 @@ Shawn Laffan (SLAFFAN) + Carlos D. ??lvaro (cdalvaro) + COPYRIGHT AND LICENSE This software is copyright (c) 2014-2022 by Graham Ollis. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/author.yml new/FFI-CheckLib-0.31/author.yml --- old/FFI-CheckLib-0.30/author.yml 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/author.yml 2022-09-30 15:42:45.000000000 +0200 @@ -21,6 +21,11 @@ - ppisar - UX - MRDVT + - macOS + - Homebrew + - MacPorts + - cdalvaro + - lvaro pod_coverage: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/corpus/unix/path/path1/libfoo.so.1 new/FFI-CheckLib-0.31/corpus/unix/path/path1/libfoo.so.1 --- old/FFI-CheckLib-0.30/corpus/unix/path/path1/libfoo.so.1 1970-01-01 01:00:00.000000000 +0100 +++ new/FFI-CheckLib-0.31/corpus/unix/path/path1/libfoo.so.1 2022-09-30 15:42:45.000000000 +0200 @@ -0,0 +1 @@ +path1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/corpus/unix/path/path2/libfoo.so.2 new/FFI-CheckLib-0.31/corpus/unix/path/path2/libfoo.so.2 --- old/FFI-CheckLib-0.30/corpus/unix/path/path2/libfoo.so.2 1970-01-01 01:00:00.000000000 +0100 +++ new/FFI-CheckLib-0.31/corpus/unix/path/path2/libfoo.so.2 2022-09-30 15:42:45.000000000 +0200 @@ -0,0 +1 @@ +path2 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/corpus/unix/path/path3/libfoo.so.3 new/FFI-CheckLib-0.31/corpus/unix/path/path3/libfoo.so.3 --- old/FFI-CheckLib-0.30/corpus/unix/path/path3/libfoo.so.3 1970-01-01 01:00:00.000000000 +0100 +++ new/FFI-CheckLib-0.31/corpus/unix/path/path3/libfoo.so.3 2022-09-30 15:42:45.000000000 +0200 @@ -0,0 +1 @@ +3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/dist.ini new/FFI-CheckLib-0.31/dist.ini --- old/FFI-CheckLib-0.30/dist.ini 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/dist.ini 2022-09-30 15:42:45.000000000 +0200 @@ -3,7 +3,7 @@ license = Perl_5 copyright_holder = Graham Ollis copyright_year = 2014-2022 -version = 0.30 +version = 0.31 [@Author::Plicease] :version = 2.72 @@ -49,6 +49,7 @@ contributor = Petr P??sa?? (ppisar) contributor = Michael R. Davis (MRDVT) contributor = Shawn Laffan (SLAFFAN) +contributor = Carlos D. ??lvaro (cdalvaro) [MetaNoIndex] directory = corpus diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/lib/FFI/CheckLib.pm new/FFI-CheckLib-0.31/lib/FFI/CheckLib.pm --- old/FFI-CheckLib-0.30/lib/FFI/CheckLib.pm 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/lib/FFI/CheckLib.pm 2022-09-30 15:42:45.000000000 +0200 @@ -5,6 +5,7 @@ use File::Spec; use List::Util 1.33 qw( any ); use Carp qw( croak carp ); +use Env qw( @FFI_CHECKLIB_PATH ); use base qw( Exporter ); our @EXPORT = qw( @@ -23,13 +24,45 @@ ); # ABSTRACT: Check that a library is available for FFI -our $VERSION = '0.30'; # VERSION +our $VERSION = '0.31'; # VERSION our $system_path = []; our $os ||= $^O; my $try_ld_on_text = 0; +sub _homebrew_lib_path { + require File::Which; + return undef unless File::Which::which('brew'); + chomp(my $brew_path = (qx`brew --prefix`)[0]); + return "$brew_path/lib"; +} + +sub _macports_lib_path { + require File::Which; + my $port_path = File::Which::which('port'); + return undef unless $port_path; + $port_path =~ s|bin/port|lib|; + return $port_path; +} + +sub _darwin_extra_paths { + my $pkg_managers = lc( $ENV{FFI_CHECKLIB_PACKAGE} || 'homebrew,macports' ); + return () if $pkg_managers eq 'none'; + my $supported_managers = { + homebrew => \&_homebrew_lib_path, + macports => \&_macports_lib_path + }; + my @extra_paths = (); + foreach my $pkg_manager (split( /,/, $pkg_managers )) { + if (my $lib_path = $supported_managers->{$pkg_manager}()) { + push @extra_paths, $lib_path; + } + } + return @extra_paths; +} + +my @extra_paths = (); if($os eq 'MSWin32' || $os eq 'msys') { $system_path = eval { @@ -47,6 +80,7 @@ \@DynaLoader::dl_library_path; }; die $@ if $@; + @extra_paths = _darwin_extra_paths() if $os eq 'darwin'; } our $pattern = [ qr{^lib(.*?)\.so(?:\.([0-9]+(?:\.[0-9]+)*))?$} ]; @@ -151,9 +185,37 @@ my @path = @{ $args{libpath} }; @path = map { _recurse($_) } @path if $recursive; - push @path, grep { defined } defined $args{systempath} - ? @{ $args{systempath} } - : @$system_path; + + if(defined $args{systempath}) + { + push @path, grep { defined } @{ $args{systempath} } + } + else + { + # This is a little convaluted, but: + # 1. These are modifications of what we consider the "system" path + # if systempath isn't explicitly passed in as systempath + # 2. FFI_CHECKLIB_PATH is considered an authortative modification + # so it goes first and overrides FFI_CHECKLIB_PACKAGE + # 3. otherwise FFI_CHECKLIB_PACKAGE does its thing and goes on + # the end because homebrew does a good job of not replacing + # anything in the system by default. + # 4. We finally add what we consider the "system" path to the end of + # the search path so that libpath will be searched first. + my @system_path = @$system_path; + if($ENV{FFI_CHECKLIB_PATH}) + { + @system_path = (@FFI_CHECKLIB_PATH, @system_path); + } + else + { + foreach my $extra_path (@extra_paths) + { + push @path, $extra_path unless any { $_ eq $extra_path } @path; + } + } + push @path, @system_path; + } my $any = any { $_ eq '*' } @{ $args{lib} }; my %missing = map { $_ => 1 } @{ $args{lib} }; @@ -406,7 +468,7 @@ =head1 VERSION -version 0.30 +version 0.31 =head1 SYNOPSIS @@ -646,6 +708,51 @@ This function is not exportable, even on request. +=head1 ENVIRONMENT + +L<FFI::CheckLib> responds to these environment variables: + +=over 4 + +=item FFI_CHECKLIB_PACKAGE + +On macOS platforms with L<Homebrew|http://brew.sh> and/or L<MacPorts|https://www.macports.org> +installed, their corresponding lib paths will be automatically appended to C<$system_path>. +In case of having both managers installed, Homebrew will appear before. + +This behaviour can be overridden using the environment variable C<FFI_CHECKLIB_PACKAGE>. + +Allowed values are: + +- C<none>: Won't use either Homebrew's path nor MacPorts +- C<homebrew>: Will append C<$(brew --prefix)/lib> to the system paths +- C<macports>: Will append C<port>'s default lib path + +A comma separated list is also valid: + + export FFI_CHECKLIB_PACKAGE=macports,homebrew + +Order matters. So in this example, MacPorts' lib path appears before Homebrew's path. + +=item FFI_CHECKLIB_PATH + +List of directories that will be considered by L<FFI::CheckLib> as additional "system +directories". They will be searched before other system directories but after C<libpath>. +The variable is colon separated on Unix and semicolon separated on Windows. If you +use this variable, C<FFI_CHECKLIB_PACKAGE> will be ignored. + +=item PATH + +On Windows the C<PATH> environment variable will be used as a search path for +libraries. + +=back + +On some operating systems C<LD_LIBRARY_PATH>, C<DYLD_LIBRARY_PATH>, +C<DYLD_FALLBACK_LIBRARY_PATH> or others I<may> be used as part of the search +for dynamic libraries and I<may> be used (indirectly) by L<FFI::CheckLib> +as well. + =head1 FAQ =over 4 @@ -737,6 +844,8 @@ Shawn Laffan (SLAFFAN) +Carlos D. ??lvaro (cdalvaro) + =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2014-2022 by Graham Ollis. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/t/00_diag.t new/FFI-CheckLib-0.31/t/00_diag.t --- old/FFI-CheckLib-0.30/t/00_diag.t 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/t/00_diag.t 2022-09-30 15:42:45.000000000 +0200 @@ -13,6 +13,7 @@ DynaLoader ExtUtils::MakeMaker FFI::Platypus + File::Which List::Util Test2::API Test2::Require::EnvVar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/t/ffi_checklib.t new/FFI-CheckLib-0.31/t/ffi_checklib.t --- old/FFI-CheckLib-0.30/t/ffi_checklib.t 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/t/ffi_checklib.t 2022-09-30 15:42:45.000000000 +0200 @@ -2,6 +2,8 @@ use Test2::V0 -no_srand => 1; use Test2::Plugin::FauxOS 'linux'; use Test2::Tools::FauxDynaLoader; +use File::Spec; +use File::Basename qw( basename ); use FFI::CheckLib qw( find_lib which where has_symbols ); subtest 'recursive' => sub { @@ -215,4 +217,25 @@ }; +subtest 'FFI_CHECKLIB_PATH' => sub { + + $FFI::CheckLib::system_path = [File::Spec->rel2abs('corpus/unix/path/path1')]; + $ENV{FFI_CHECKLIB_PATH} = File::Spec->rel2abs('corpus/unix/path/path2'); + note "system_path = @{[ @$FFI::CheckLib::system_path ]}"; + note "FFI_CHECKLIB_PATH = $ENV{FFI_CHECKLIB_PATH}"; + + my $lib = FFI::CheckLib::find_lib( lib => 'foo' ); + + note "lib=$lib"; + + is(basename($lib), "libfoo.so.2"); + + $lib = FFI::CheckLib::find_lib( lib => 'foo', libpath => 'corpus/unix/path/path3' ); + + note "lib=$lib"; + + is(basename($lib), "libfoo.so.3"); + +}; + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/t/ffi_checklib__os_darwin.t new/FFI-CheckLib-0.31/t/ffi_checklib__os_darwin.t --- old/FFI-CheckLib-0.30/t/ffi_checklib__os_darwin.t 2022-09-22 12:24:28.000000000 +0200 +++ new/FFI-CheckLib-0.31/t/ffi_checklib__os_darwin.t 2022-09-30 15:42:45.000000000 +0200 @@ -217,4 +217,64 @@ }; +subtest '_darwin_extra_libraries' => sub { + my $homebrew_lib_path = '/opt/homebrew/lib'; + my $macports_lib_path = '/opt/local/lib'; + my $mock = mock 'FFI::CheckLib'; + $mock->override( + _homebrew_lib_path => sub {$homebrew_lib_path}, + _macports_lib_path => sub {$macports_lib_path} + ); + + subtest 'default' => sub { + local %ENV = %ENV; + delete $ENV{FFI_CHECKLIB_PACKAGE}; + is( + [ FFI::CheckLib::_darwin_extra_paths() ], + [ $homebrew_lib_path, $macports_lib_path ], + 'homebrew and macports lib paths added' + ); + }; + + subtest 'none' => sub { + local %ENV = %ENV; + $ENV{FFI_CHECKLIB_PACKAGE} = 'NONE'; + is( + [ FFI::CheckLib::_darwin_extra_paths() ], + [], + 'None extra lib paths added' + ); + }; + + subtest 'homebrew' => sub { + local %ENV = %ENV; + $ENV{FFI_CHECKLIB_PACKAGE} = 'Homebrew'; + is( + [ FFI::CheckLib::_darwin_extra_paths() ], + [ $homebrew_lib_path ], + 'homebrew lib path added' + ); + }; + + subtest 'macports' => sub { + local %ENV = %ENV; + $ENV{FFI_CHECKLIB_PACKAGE} = 'MacPorts'; + is( + [ FFI::CheckLib::_darwin_extra_paths() ], + [ $macports_lib_path ], + 'macports lib path loaded' + ); + }; + + subtest 'macports,homebrew' => sub { + local %ENV = %ENV; + $ENV{FFI_CHECKLIB_PACKAGE} = 'macports,homebrew'; + is( + [ FFI::CheckLib::_darwin_extra_paths() ], + [ $macports_lib_path, $homebrew_lib_path ], + 'macports and homebrew lib paths added (order matters)' + ); + }; +}; + done_testing; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/FFI-CheckLib-0.30/xt/author/pod_link.t new/FFI-CheckLib-0.31/xt/author/pod_link.t --- old/FFI-CheckLib-0.30/xt/author/pod_link.t 1970-01-01 01:00:00.000000000 +0100 +++ new/FFI-CheckLib-0.31/xt/author/pod_link.t 2022-09-30 15:42:45.000000000 +0200 @@ -0,0 +1,31 @@ +use Test2::Require::Module 'Test::Pod::LinkCheck::Lite'; +use Test2::Require::EnvVar 'POD_CHECK'; +use Test2::V0; +use Test::Pod::LinkCheck::Lite; + +my @checks; + +if(-d 'blib/script') +{ + push @checks, 'blib/script'; +} +elsif(-d 'bin') +{ + push @checks, 'bin'; +} + +if(-d 'blib') +{ + push @checks, 'blib'; +} +else +{ + push @checks, 'lib'; + diag "checking lib instead of blib"; +} + +Test::Pod::LinkCheck::Lite + ->new + ->all_pod_files_ok(@checks); + +done_testing;