Alien-wxWidgets
view release on metacpan or search on metacpan
'repository' => 'http://svn.code.sf.net/p/wxperl/code/Alien-wxWidgets',
'MailingList' => 'http://lists.perl.org/list/wxperl-users.html',
},
},
);
my $accept_defaults = $ENV{PERL5_CPANPLUS_IS_RUNNING}
|| $ENV{CPAN_SHELL_LEVEL};
my $build_wx_dflt = 'yes';
my $build_wx_opengl_dflt = 'yes';
my $build_prompt = 'Do you want to fetch and build wxWidgets from sources?';
my $have_alien_configuration = 0;
# try to detect if wxWidgets has been installed using Alien::wxWidgets and if
# it is the latest version; the rule is:
#
# if there is any any wxWidgets installation registered with Alien::wxWidgets
# it will only get upgraded if it was compiled using Alien::wxWidgets itself and
# it is older than $DEFAULT_VERSION
my $ok = eval {
# if anything went wrong in the autodetection, revert to the correct
# default
if( !$ok ) {
$build_wx_dflt = 'yes';
}
# detect wxWidgets using WXDIR/WXWIN environment variables on Win32
# and wx-config on other platforms
if( $^O eq 'MSWin32' && ( $ENV{WXWIN} || $ENV{WXDIR} ) ) {
$build_wx_dflt = 'no';
$build_prompt = sprintf <<EOP, ( $ENV{WXWIN} || $ENV{WXDIR} );
A wxWidgets build seems to be in '%s', so it should be safe to answer
'no' to the following question
$build_prompt
EOP
} else {
require My::Build::Base;
my $env_wxconfig = $ENV{WX_CONFIG};
if ( $env_wxconfig && !-e $env_wxconfig && $env_wxconfig !~ /wx-config$/ ) {
print STDERR qq(
=============================================================================
The specified environment WX_CONFIG does not appear to be a valid wx-config :
$env_wxconfig
}
my $wx_config = $env_wxconfig || My::Build::Base->awx_path_search( 'wx-config' );
if( $wx_config ) {
my $ans = `$wx_config --version`;
if( $ans =~ /^[23]\./ ) {
my $prefix = `$wx_config --prefix`;
chomp foreach $ans, $prefix;
if( _check_installed_widgets_ok($ans, $prefix) ) {
$build_wx_dflt = 'no' ;
$build_prompt = sprintf <<EOP, $ans, $prefix;
wxWidgets %s seems to be installed in '%s', so it should be safe to
answer 'no' to the following question:
$build_prompt
EOP
}
}
}
}
if( $^O ne 'darwin' && $^O ne 'MSWin32' ) {
$build_wx_opengl_dflt = 'no';
}
if( $ENV{AWX_URL} ) {
$build_wx_dflt = 'yes';
{
my $ans = `gmake -v`;
unless( $ans =~ /gnu make/i ) {
print <<EOT;
Could not find GNU Make as 'gmake': aborting
EOT
exit 0;
}
}
}
chomp $build_prompt;
my $build_wx = _askyn( $build, 'wxWidgets-build',
$build_prompt, $build_wx_dflt );
my $wx_version;
$build->notes( 'build_wx' => $build_wx );
$build->notes( 'mk_portable' => $build->args('wxWidgets-portable') );
$build->notes( 'install_only' => $have_alien_configuration && !$build_wx && $accept_defaults );
$build->notes( 'extraflags' => $build->args('wxWidgets-extraflags') || '' );
$build->notes( 'userpatch' => $build->args('wxWidgets-userpatch') || '' );
$build->notes( 'graphicscontext' => $build->args('wxWidgets-graphicscontext') );
if( $build_wx ) {
$wx_version = _askmulti( $build, 'wxWidgets-version',
return $res
}
sub _askmulti {
my( $build, $arg, $question, $options, $default ) = @_;
$question .= " (" . join( ', ', @$options ) . ")";
my $res =
defined $build->args( $arg ) ? $build->args( $arg ) :
exists $ENV{"AWX_\U$arg"} ? $ENV{"AWX_\U$arg"} :
$accept_defaults ? $default :
$build->prompt( $question, $default );
die "Invalid value '$res' for option '$arg': must be one of ",
join( ', ', map "'$_'", @$options ), "\n"
unless grep $_ eq $res, @$options;
return $res
}
sub _ask {
my( $build, $arg, $question, $default ) = @_;
my $res =
defined $build->args( $arg ) ? $build->args( $arg ) :
exists $ENV{"AWX_\U$arg"} ? $ENV{"AWX_\U$arg"} :
$accept_defaults ? $default :
$build->prompt( $question, $default );
return $res
}
sub _get_default_wxwidgets_version_and_type {
# default version and archive type
my $defver = '3.0.2';
my $deftype = 'tar.bz2';
0.41 Mon Oct 27 22:22:25 CET 2008
- Rewrite show_configurations to display a pretty-printed version of
the available wxWidgets builds.
- When load() fails to find a compatible configuration, display a
the selection criteria and a list of available configurations.
0.40 Wed Oct 15 20:23:15 CEST 2008
- Always use Archive::Extract to extract the wxWidgets archive
since it now handles .bz2 files correctly on all platforms.
- Add a manifest to the bundled patch.exe to avoid triggering
an UAC prompt under Windows Vista.
0.39 Mon Sep 8 20:56:44 CEST 2008
- Add missing file to MANIFEST.
0.38 Sun Aug 24 11:17:37 CEST 2008
- Patch and build wxWidgets 2.8.8.
- When running with AUTOMATED_TESTING try to detect GTK+2
presence and abort early if it can't be found.
0.37 Sun Jun 29 21:40:16 CEST 2008
Makefile.PL view on Meta::CPAN
# Note: this file was auto-generated by Module::Build::Compat version 0.4222
require 5.006;
unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";
require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');
unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}
require Cwd;
require File::Spec;
require CPAN;
Only relevant for wxWidgets 2.8.x, indicate if you want a unicode build.
--wxWidgets-unicode=1|0, default is 1
perl Build.PL --wxWidgets-build=0
Indicate if you want wxWidgets to be downloaded and built
--wxWidgets-build=1|0, default depends on whether Aline-wxWidgets finds
a usable wxWidgets installation on your system. An explict value always
overrides the default.
Always use an explicit flag if you want to avoid prompts.
perl Build.PL --wxWidgets-version=2.8.12
If --wxWidgets-build=1, indicate the version of wxWidgets to build.
e.g. --wxWidgets-version=2.9.4. The current default is 2.8.12.
Always use an explicit flag if you want to avoid prompts.
perl Build.PL --wxWidgets-source=tar.gz
If --wxWidgets-build=1, indicate the type of archive to download
e.g. --wxWidgets-source=tar.bz2, then default for wxWidgets 2.8.x is
tar.gz and the default for wxWidgets 2.9.x is tar.bz2.
Always use an explicit flag if you want to avoid prompts.
perl Build.PL --wxWidgets-build-opengl=1
Build the wxGLCanvas libraries.
--wxWidgets-build-opengl=1|0 default is 1.
Always use an explicit flag if you want to avoid prompts.
perl Build.PL --wxWidgets-extraflags="--disable-compat26"
On Unices and Mac OS X you may use this to pass through any flags you
may wish to configure. Doing so however will drop any additional default
flags that Alien wxWidgets would normally pass to configure to ensure
that wxWidgets builds as required on your system. This approach is used
so that you can use this to configure precisely to your requirement
and not have Alien-wxWidgets override it.
inc/bin/patch view on Meta::CPAN
@{caller() . '::ISA'} = 'Patch';
}
# Simple throw/catch error handling.
sub throw {
$@ = join '', @_;
$@ .= sprintf " at %s line %d\n", (caller)[1..2] unless $@ =~ /\n\z/;
goto CATCH;
}
# Prints a prompt message and returns response.
sub prompt {
print @_;
local $_ = <STDIN>;
chomp;
$_;
}
# Constructs a Patch object.
sub new {
my $class = shift;
my %copy = %{$_[0]} if ref $_[0];
inc/bin/patch view on Meta::CPAN
$orig = $self->rummage($garbage); # ...from leading garbage
if (defined $orig) {
$self->note(
"The text leading up to this was:\n",
"--------------------------\n",
map("|$_", @$garbage),
"--------------------------\n",
);
} else {
$self->skip if $self->{force} || $self->{batch};
$orig = prompt ('File to patch: '); # ...from user
}
}
# Make sure original file exists.
if ($self->{force} || $self->{batch}) {
-e $orig or $self->skip;
} else {
until (-e $orig) {
$self->skip unless prompt (
'No file found--skip this patch? [n] '
) =~ /^[yY]/;
$orig = prompt (
'File to patch: '
);
}
}
my ($in, $out);
# Create backup file. I have no clue what Plan A is really supposed to be.
if ($self->{check}) {
$self->note("Checking patch against file $orig using Plan C...\n");
($in, $out) = ($orig, '');
} elsif (defined $self->{output}) {
$self->note("Patching file $orig using Plan T...\n");
local $_ = $self->{output};
$self->skip if -e && not rename $_, $self->backup($_) and
$self->{force} || $self->{batch} || prompt (
'Failed to backup output file--skip this patch? [n] '
) =~ /^[yY]/;
($in, $out) = ($orig, $self->{output});
} else {
$self->note("Patching file $orig using Plan A...\n");
my $back = $self->backup($orig);
if (rename $orig, $back) {
($in, $out) = ($back, $orig);
} else {
$self->skip unless $self->{force} || $self->{batch} or prompt (
'Failed to backup original file--skip this patch? [n] '
) !~ /^[yY]/;
($in, $out) = ($orig, $orig);
}
}
# Open original file.
local *IN;
open IN, "< $in" or $self->skip("Couldn't open INFILE: $!\n");
binmode IN;
inc/bin/patch view on Meta::CPAN
# Check for 'Prereq:' line.
unless ($self->{force}) {
my $prereq = (map /^Prereq:\s*(\S+)/, @$garbage)[-1];
if (defined $prereq) {
$prereq = qr/\b$prereq\b/;
my $found;
while (<IN>) {
$found++, last if /$prereq/;
}
seek IN, 0, 0 or $self->skip("Couldn't seek INFILE: $!\n");
$self->skip if not $found and $self->{batch} || prompt (
'File does not match "Prereq: $1"--skip this patch? [n] '
) =~ /^[yY]/;
}
}
SKIP:
$_[0] = $self;
}
# Skip current patch.
inc/bin/patch view on Meta::CPAN
@context = map /^[ -](.*)/s, @hunk or last;
$fuzz++;
}
# If there's nowhere to apply the first hunk, we check if it is
# a reversed patch.
if ($self->{hunk} == 1) {
if ($self->{reverse_check}) {
$self->{reverse_check} = 0;
if ($position) {
unless ($self->{batch}) {
local $_ = prompt (
'Reversed (or previously applied) patch detected!',
' Assume -R? [y] '
);
if (/^[nN]/) {
$self->{reverse} = 0;
$position = 0;
prompt ('Apply anyway? [n] ') =~ /^[yY]/
or throw 'SKIP...ignore this patch';
}
}
} else {
throw 'SKIP...ignore this patch' if $self->{forward};
}
} else {
unless ($position || $self->{reverse} || $self->{force}) {
$self->{reverse_check} = 1;
$self->{reverse} = 1;
( run in 1.333 second using v1.01-cache-2.11-cpan-0b5f733616e )