view release on metacpan or search on metacpan
inc/My/Build/Base.pm view on Meta::CPAN
package My::Build::Base;
use strict;
use base qw(Module::Build);
use My::Build::Utility qw(awx_arch_file awx_touch);
use Alien::wxWidgets::Utility qw(awx_sort_config awx_grep_config);
use File::Path ();
use File::Basename ();
use Fatal qw(open close unlink);
use Data::Dumper;
use File::Glob qw(bsd_glob);
use Carp;
use lib '.';
# Ensure deterministic output
$Data::Dumper::Sortkeys = 1;
# use the system version of a module if present; in theory this could lead to
# compatibility problems (if the latest version of one of the dependencies,
# installed in @INC is incompatible with the bundled version of a module)
sub _load_bundled_modules {
inc/My/Build/Base.pm view on Meta::CPAN
sub awx_compiler_version {
return Alien::wxWidgets::Utility::awx_cc_abi_version( $_[1] );
}
sub awx_path_search {
my( $self, $file ) = @_;
foreach my $d ( File::Spec->path ) {
my $full = File::Spec->catfile( $d, $file );
# we are gonna use glob() to accept wildcards
foreach my $f ( bsd_glob( $full ) ) {
return $f if -f $f;
}
}
return;
}
sub awx_uses_bakefile { 1 }
sub ACTION_ppmdist {
inc/My/Build/Win32.pm view on Meta::CPAN
package My::Build::Win32;
use strict;
use base qw(My::Build::Base);
use My::Build::Utility qw(awx_arch_file awx_install_arch_file
awx_install_arch_dir);
use Config;
use Fatal qw(open close);
use Carp qw(cluck);
use File::Glob qw(bsd_glob);
my $initialized;
sub _init {
return if $initialized;
$initialized = 1;
return if Module::Build->current->notes( 'build_wx' );
# install_only is set when a wxWidgets build is already configured
# with Alien::wxWidgets
inc/My/Build/Win32.pm view on Meta::CPAN
}
sub awx_grep_dlls {
my( $self, $libdir, $digits, $mono ) = @_;
my $ret = {};
my $ver = $self->_version_2_dec( $self->awx_w32_bakefile_version );
my $suff = ( $self->awx_unicode ? 'u' : '' ) .
( $self->awx_debug && $ver <= 2.009 ? 'd' : '' );
my @dlls = grep { m/${digits}\d*${suff}_/ }
bsd_glob( File::Spec->catfile( $libdir, '*.dll' ) );
my @libs = grep { m/(?:lib)?wx(?:wince|msw|base)[\w\.]+$/ }
grep { m/${digits}\d*${suff}(_|\.)/ }
bsd_glob( File::Spec->catfile( $libdir, "*$Config{lib_ext}" ) );
# we want builtins on Win32 so that they are available for wxWidgets extensions
my @builtins = grep { m/wx(zlib|regex|expat|png|jpeg|tiff)/ }
bsd_glob( File::Spec->catfile( $libdir, "*$Config{lib_ext}" ) );
$self->{w32builtins} = \@builtins;
foreach my $full ( @dlls, @libs ) {
my( $name, $type );
local $_ = File::Basename::basename( $full );
m/^[^_]+_([^_\.]+)/ and $name = $1;
$name = 'base' if !defined $name || $name =~ m/^(gcc|vc|evc)$/;
$type = m/$Config{lib_ext}$/i ? 'lib' : 'dll';
$ret->{$name}{$type} = $full;
inc/My/Build/Win32_MSVC_Bakefile.pm view on Meta::CPAN
sub build_wxwidgets {
my( $self ) = shift;
my $old_dir = Cwd::cwd();
$self->My::Build::Win32_Bakefile::build_wxwidgets( @_ );
# Compiling with MSVC 9 (VS 2008) and probably with VS 2005, the
# linker creates a manifest that must be embedded in the DLL to
# make it load correctly
chdir File::Spec->catdir( $ENV{WXDIR} );
foreach my $dll ( glob( 'lib/vc_dll*/*.dll' ) ) {
next unless -f "${dll}.manifest";
$self->_system( 'mt', '-nologo', '-manifest', "${dll}.manifest",
"-outputresource:${dll};2" );
unlink "${dll}.manifest";
}
chdir $old_dir;
}
inc/My/Build/Win32_MinGW.pm view on Meta::CPAN
package My::Build::Win32_MinGW;
use strict;
use base qw(My::Build::Win32);
use My::Build::Utility qw(awx_arch_file awx_install_arch_file
awx_install_arch_dir awx_arch_dir);
use Config;
use File::Basename qw();
use File::Glob qw(bsd_glob);
use Data::Dumper;
sub _find_make {
my( @try ) = qw(mingw32-make gmake make);
push @try, $Config{gmake} if $Config{gmake};
foreach my $name ( @try ) {
foreach my $dir ( File::Spec->path ) {
my $abs = File::Spec->catfile( $dir, "$name.exe" );
return $name if -x $abs;
inc/My/Build/Win32_MinGW.pm view on Meta::CPAN
}
print qq(MinGW gcc libs - none found\n) if !@gccdlls;
return %returnfiles;
}
sub awx_strip_dlls {
my( $self ) = @_;
my( $dir ) = grep !/Config/, bsd_glob( awx_arch_dir( '*' ) );
$self->_system( "attrib -r $dir\\lib\\*.dll" );
$self->_system( "strip $dir\\lib\\*.dll" );
$self->_system( "attrib +r $dir\\lib\\*.dll" );
}
1;
inc/inc_File-Fetch/File/Fetch.pm view on Meta::CPAN
Furthermore, ftp uris only support anonymous connections, so no
named user/password pair can be passed along.
C</bin/ftp> is blacklisted by default; see the C<$BLACKLIST> variable
further down.
=head1 GLOBAL VARIABLES
The behaviour of File::Fetch can be altered by changing the following
global variables:
=head2 $File::Fetch::FROM_EMAIL
This is the email address that will be sent as your anonymous ftp
password.
Default is C<File-Fetch@example.com>.
=head2 $File::Fetch::USER_AGENT
inc/inc_IPC-Cmd/IPC/Cmd.pm view on Meta::CPAN
See L<CAVEATS> for remarks on how commands are parsed and their
limitations.
=item verbose
This controls whether all output of a command should also be printed
to STDOUT/STDERR or should only be trapped in buffers (NOTE: buffers
require C<IPC::Run> to be installed or your system able to work with
C<IPC::Open3>).
It will default to the global setting of C<$IPC::Cmd::VERBOSE>,
which by default is 0.
=item buffer
This will hold all the output of a command. It needs to be a reference
to a scalar.
Note that this will hold both the STDOUT and STDERR messages, and you
have no way of telling which is which.
If you require this distinction, run the C<run> command in list context
and inspect the individual buffers.
inc/inc_IPC-Cmd/IPC/Cmd.pm view on Meta::CPAN
);
### dups FDs and stores them in a cache
sub __dup_fds {
my $self = shift;
my @fds = @_;
__PACKAGE__->_debug( "# Closing the following fds: @fds" ) if $DEBUG;
for my $name ( @fds ) {
my($redir, $fh, $glob) = @{$Map{$name}} or (
Carp::carp(loc("No such FD: '%1'", $name)), next );
### MUST use the 2-arg version of open for dup'ing for
### 5.6.x compatibilty. 5.8.x can use 3-arg open
### see perldoc5.6.2 -f open for details
open $glob, $redir . fileno($fh) or (
Carp::carp(loc("Could not dup '$name': %1", $!)),
return
);
### we should re-open this filehandle right now, not
### just dup it
if( $redir eq '>&' ) {
open( $fh, '>', File::Spec->devnull ) or (
Carp::carp(loc("Could not reopen '$name': %1", $!)),
return
inc/inc_IPC-Cmd/IPC/Cmd.pm view on Meta::CPAN
}
### reopens FDs from the cache
sub __reopen_fds {
my $self = shift;
my @fds = @_;
__PACKAGE__->_debug( "# Reopening the following fds: @fds" ) if $DEBUG;
for my $name ( @fds ) {
my($redir, $fh, $glob) = @{$Map{$name}} or (
Carp::carp(loc("No such FD: '%1'", $name)), next );
### MUST use the 2-arg version of open for dup'ing for
### 5.6.x compatibilty. 5.8.x can use 3-arg open
### see perldoc5.6.2 -f open for details
open( $fh, $redir . fileno($glob) ) or (
Carp::carp(loc("Could not restore '$name': %1", $!)),
return
);
### close this FD, we're not using it anymore
close $glob;
}
return 1;
}
}
sub _debug {
my $self = shift;
my $msg = shift or return;
my $level = shift || 0;
inc/inc_IPC-Cmd/IPC/Cmd.pm view on Meta::CPAN
Otherwise we will try and temporarily redirect STDERR and STDOUT, do a
system() call with your command and then re-open STDERR and STDOUT.
This is the method of last resort and will still allow you to execute
your commands cleanly. However, no buffers will be available.
=back
=head1 Global Variables
The behaviour of IPC::Cmd can be altered by changing the following
global variables:
=head2 $IPC::Cmd::VERBOSE
This controls whether IPC::Cmd will print any output from the
commands to the screen or not. The default is 0;
=head2 $IPC::Cmd::USE_IPC_RUN
This variable controls whether IPC::Cmd will try to use L<IPC::Run>
when available and suitable. Defaults to true if you are on C<Win32>.
inc/inc_Module-Load-Conditional/Module/Load/Conditional.pm view on Meta::CPAN
`$cmd`;
}
1;
__END__
=head1 Global Variables
The behaviour of Module::Load::Conditional can be altered by changing the
following global variables:
=head2 $Module::Load::Conditional::VERBOSE
This controls whether Module::Load::Conditional will issue warnings and
explanations as to why certain things may have failed. If you set it
to 0, Module::Load::Conditional will not output any warnings.
The default is 0;
=head2 $Module::Load::Conditional::FIND_VERSION
inc/inc_Params-Check/Params/Check.pm view on Meta::CPAN
will be stored:
my $x;
my $args = check(foo => { default => 1, store => \$x }, $input);
This is basically shorthand for saying:
my $args = check( { foo => { default => 1 }, $input );
my $x = $args->{foo};
You can alter the global variable $Params::Check::NO_DUPLICATES to
control whether the C<store>'d key will still be present in your
result set. See the L<Global Variables> section below.
=item allow
A set of criteria used to validate a particular piece of data if it
has to adhere to particular rules.
See the C<allow()> function for details.
inc/inc_Params-Check/Params/Check.pm view on Meta::CPAN
}
sub last_error { $ErrorString }
}
1;
=head1 Global Variables
The behaviour of Params::Check can be altered by changing the
following global variables:
=head2 $Params::Check::VERBOSE
This controls whether Params::Check will issue warnings and
explanations as to why certain things may have failed.
If you set it to 0, Params::Check will not output any warnings.
The default is 1 when L<warnings> are enabled, 0 otherwise;
=head2 $Params::Check::STRICT_TYPE
This works like the C<strict_type> option you can pass to C<check>,
which will turn on C<strict_type> globally for all calls to C<check>.
The default is 0;
=head2 $Params::Check::ALLOW_UNKNOWN
If you set this flag, unknown options will still be present in the
return value, rather than filtered out. This is useful if your
subroutine is only interested in a few arguments, and wants to pass
the rest on blindly to perhaps another subroutine.
inc/inc_Params-Check/Params/Check.pm view on Meta::CPAN
=head2 $Params::Check::WARNINGS_FATAL
If set to true, L<Params::Check> will C<croak> when an error during
template validation occurs, rather than return C<false>.
Default is 0;
=head2 $Params::Check::CALLER_DEPTH
This global modifies the argument given to C<caller()> by
C<Params::Check::check()> and is useful if you have a custom wrapper
function around C<Params::Check::check()>. The value must be an
integer, indicating the number of wrapper functions inserted between
the real function call and C<Params::Check::check()>.
Example wrapper function, using a custom stacktrace:
sub check {
my ($template, $args_in) = @_;