Alien-wxWidgets

 view release on metacpan or  search on metacpan

inc/My/Build/Any_wx_config.pm  view on Meta::CPAN

    my $base = `$wx_config --basename`;
    $wx_debug = $base =~ m/d$/ ? 1 : 0;
    $wx_unicode = $base =~ m/ud?$/ ? 1 : 0;

    $WX_CONFIG_LIBSEP = `$wx_config --libs base > /dev/null 2>&1 || echo 'X'` eq "X\n" ? '=' : ' ';
    $wx_monolithic = `$wx_config --libs${WX_CONFIG_LIBSEP}adv` eq
                     `$wx_config --libs${WX_CONFIG_LIBSEP}core`;

    sub awx_is_debug {
        $_[0]->notes( 'build_wx' )
          ? $_[0]->SUPER::awx_is_debug
          : $wx_debug;
    }
    sub awx_is_unicode {
        $_[0]->notes( 'build_wx' )
          ? $_[0]->SUPER::awx_is_unicode
          : $wx_unicode;
    }
    sub awx_is_monolithic {
        $_[0]->notes( 'build_wx' )
          ? $_[0]->SUPER::awx_is_monolithic
          : $wx_monolithic;
    }
}

package My::Build::Any_wx_config::Base;

use strict;
use base qw(My::Build::Base);
use Fatal qw(chdir mkdir);
use Cwd ();
use Config;
use My::Build::Utility qw(awx_arch_dir awx_install_arch_dir);

sub awx_configure {
    My::Build::Any_wx_config::_init( $_[0] );

    my $self = shift;
    my %config = $self->SUPER::awx_configure;
    my $cf = $self->wx_config( 'cxxflags' );

    $config{prefix} = $self->wx_config( 'prefix' );
    $cf =~ m/__WX(x11|msw|motif|gtk|mac|osx_carbon|osx_cocoa)__/i or
      die "Unable to determine toolkit!";
    $config{config}{toolkit} = lc $1;
    $config{config}{build} = $self->awx_is_monolithic ? 'mono' : 'multi';

    if( $config{config}{toolkit} eq 'gtk' ) {
        $self->wx_config( 'basename' ) =~ m/(gtk2?)/i or

inc/My/Build/Base.pm  view on Meta::CPAN

                   Archive::Extract
                   File::Fetch);
}

sub ACTION_build {
    my $self = shift;
    # try to make "perl Makefile.PL && make test" work
    # but avoid doubly building wxWidgets when doing
    # "perl Makefile.PL && make && make test"
    unlink 'configured' if -f 'configured';
    $self->SUPER::ACTION_build;
}

sub ACTION_code {
    my $self = shift;

    $self->SUPER::ACTION_code;
    # install_only is set when a wxWidgets build is already configured
    # with Alien::wxWidgets
    return if $self->notes( 'install_only' );
    # see comment in ACTION_build for why 'configured' is used
    return if -f 'configured';
    $self->depends_on( 'build_wx' );
    $self->create_config_file( awx_arch_file( 'Config/Config.pm' ) );
    $self->install_wxwidgets;
    # see comment in ACTION_build for why 'configured' is used
    awx_touch( 'configured' );

inc/My/Build/Base.pm  view on Meta::CPAN

        $self->extract_wxwidgets;
        $self->massage_environment;
        $self->build_wxwidgets;
        $self->massage_environment; # twice on purpose
    }
}

sub ACTION_build_perl {
    my $self = shift;

    $self->SUPER::ACTION_build;
    $self->massage_environment;
    $self->create_config_file( awx_arch_file( 'Config/Config.pm' ) );
}

sub ACTION_install_wx {
    my $self = shift;

    $self->depends_on( 'build_perl' );
    $self->install_wxwidgets;
}

sub ACTION_install {
    my $self = shift;

    $self->SUPER::ACTION_install;
    $self->install_system_wxwidgets;
}

sub _check_data_file {
    my( $self, $file, $manifest ) = @_;

    require File::Spec::Unix;

    my $data = do {
        package main;

inc/My/Build/Base.pm  view on Meta::CPAN


    foreach my $data ( grep m{^patches/data}, keys %$files ) {
        print "Checking $data\n";
        $self->_check_data_file( $data, $files );
    }
}

sub ACTION_distcheck {
    my $self = shift;

    $self->SUPER::ACTION_distcheck;
    $self->_check_data_files;
}

sub ACTION_dist {
    my $self = shift;

    $self->_check_data_files;
    $self->SUPER::ACTION_dist;
}

sub awx_key {
    my( $self ) = @_;

    die unless $self->{awx_key};

    return $self->{awx_key};
}

inc/My/Build/MacOSX_wx_config.pm  view on Meta::CPAN

package My::Build::MacOSX_wx_config;

use strict;
use base qw(My::Build::Any_wx_config);

use Config;

sub awx_wx_config_data {
    my $self = shift;
    return $self->{awx_data} if $self->{awx_data};
    my %data = ( linkflags => '', %{$self->SUPER::awx_wx_config_data} );

    # MakeMaker does not like some options
    $data{libs} =~ s{-framework\s+\w+}{}g;
    $data{libs} =~ s{-isysroot\s+\S+}{}g;
    $data{libs} =~ s{-L/usr/local/lib\s}{}g;

    $data{libs} =~ s{\s(-arch\s+\w+)}
                    {$data{linkflags} .= " $1 ";
                     $data{cxxflags} .= " $1 ";
                     ' '}eg;

    $data{cxx} =~ s{-isysroot\s+\S+}{}g;
    $data{ld} = $data{cxx};
    $data{cxxflags} .= ' -UWX_PRECOMP ';

    $self->{awx_data} = \%data;
}

sub awx_configure {
    my $self = shift;
    my %config = $self->SUPER::awx_configure;

    $config{link_flags} .= $self->wx_config( 'linkflags' );

    return %config;
}

sub wxwidgets_configure_extra_flags {
    my( $self ) = @_;
    my $extra_flags = $self->notes( 'extraflags' );
    

inc/My/Build/MacOSX_wx_config.pm  view on Meta::CPAN

=======================================================================
The 2.8.x wxWidgets for OS X does not support 64-bit. In order to build
wxPerl you will need to either recompile Perl as a 32-bit binary or (if
using the Apple-provided Perl) force it to run in 32-bit mode (see "man
perl").  Alpha 64-bit wx for OS X is in 2.9.x, but untested in wxPerl.
=======================================================================
EOT
        exit 1;
    }

    $self->SUPER::build_wxwidgets;
}

1;

inc/My/Build/Win32.pm  view on Meta::CPAN

    return { 'wxdir'       => $wxdir,
             'wxdir_build' => $wxdir_b,
             'wxinc'       => File::Spec->catdir( $wxdir_b, 'include' ),
             'wxcontrinc'  => File::Spec->catdir( $wxdir_b, 'contrib',
                                                 'include' ),
             };
}

sub awx_configure {
    my $self = shift;
    my %config = $self->SUPER::awx_configure;

    $config{prefix} = $self->wx_config( 'wxdir' );
    $config{config}{toolkit} = $self->is_wince ? 'wce' : 'msw';
    $config{shared_library_path} = awx_install_arch_file( $self, "rEpLaCe/lib" );

    $self->awx_w32_find_setup_dir( $self->wx_config( 'cxxflags' ) );

    return %config;
}

inc/My/Build/Win32_MSVC.pm  view on Meta::CPAN

package My::Build::Win32_MSVC;

use strict;
use base qw(My::Build::Win32);
use My::Build::Utility qw(awx_install_arch_file awx_install_arch_dir);
use Alien::wxWidgets::Utility qw(awx_cc_version);
use Config;

sub awx_configure {
    my $self = shift;
    my %config = $self->SUPER::awx_configure;

    $config{c_flags} .= ' -GF -TP ';

    if( $self->awx_debug ) {
        $config{link_flags} .= ' -debug ';
    }

    my $cccflags = $self->wx_config( 'cxxflags' );
    my $libs = $self->wx_config( 'libs' );
    my $incdir = $self->awx_wx_config_data->{wxinc};

inc/My/Build/Win32_MSVC_Bakefile.pm  view on Meta::CPAN

}

sub awx_wx_config_data {
    my $self = shift;

    My::Build::Win32::_init();
    $self->_check_nmake();

    return $self->{awx_data} if $self->{awx_data};

    my %data = ( %{$self->SUPER::awx_wx_config_data},
                 'cxx'     => 'cl',
                 'ld'      => 'link',
               );

    my $make =  File::Basename::basename( lc $Config{make}, '.exe' );
    die "PANIC: you are not using nmake!" unless $make eq 'nmake';

    my $orig_libdir;
    my $final = $self->awx_debug ? 'BUILD=debug   DEBUG_RUNTIME_LIBS=0'
                                 : 'BUILD=release DEBUG_RUNTIME_LIBS=0';

inc/My/Build/Win32_MinGW.pm  view on Meta::CPAN

            my $abs = File::Spec->catfile( $dir, "$name.exe" );
            return $name if -x $abs;
        }
    }

    return 'make';
}

sub awx_configure {
    my $self = shift;
    my %config = $self->SUPER::awx_configure;

	my $mxarchflags = ( $Config{ptrsize} == 8 ) ? '-m64' : '-m32';

    if( $self->awx_debug ) {
        $config{c_flags} .= qq( -g $mxarchflags );
        $config{link_flags} .= qq( $mxarchflags );
    } else {
        $config{c_flags} .= qq( $mxarchflags );
        $config{link_flags} .= qq( -s $mxarchflags );
    }

inc/My/Build/Win32_MinGW.pm  view on Meta::CPAN

    
    if(!@gccdlls) {
        # check for special case ActivePerl mingw 3.4 PPM
        my $ppmmingw = qq($Config{sitearch}/auto/MinGW/bin/mingwm10.dll);
        if( -f $ppmmingw ) {
            my $dll = File::Basename::basename( $ppmmingw );
            push @gccdlls, [ $ppmmingw, $dll  ];
        }
    }
    
    my %returnfiles = $self->SUPER::files_to_install();
    
    for( @gccdlls ) {
    	$returnfiles{$_->[0]} = awx_arch_file( "rEpLaCe/lib/$_->[1]" );
    }
    
    print qq(MinGW gcc libs - none found\n) if !@gccdlls;
    
    return %returnfiles;

}

inc/My/Build/Win32_MinGW_Bakefile.pm  view on Meta::CPAN

use My::Build::Utility qw(awx_install_arch_file awx_install_arch_auto_file);
use Config;
use Fatal qw(chdir);

sub awx_wx_config_data {
    My::Build::Win32::_init();

    my $self = shift;
    return $self->{awx_data} if $self->{awx_data};

    my %data = ( %{$self->SUPER::awx_wx_config_data},
                 'cxx'     => 'g++',
                 'ld'      => 'g++',
               );

    my $cflags = 'CXXFLAGS=" -Os -DNO_GCC_PRAGMA "';
        
    my $final = $self->awx_debug ? 'BUILD=debug'
                                 : 'BUILD=release';
                                 
    if( my $xbuildflags = $self->awx_w32_extra_buildflags ) {

inc/bin/patch  view on Meta::CPAN

            $i = shift @i_hunk;
        }
        while ($o =~ s/^[!+]/+/) {
            push @hunk, $o;
            $o = shift @o_hunk;
        }
        push @hunk, $i;
    }
    push @hunk, @i_hunk, @o_hunk;

    $self->SUPER::apply($i_start, $o_start, @hunk);
}

# Check for filename in diff header, then in 'Index:' line.
sub rummage {
    my ($self, $garbage) = @_;

    my @files = grep -e, map $self->strip,
        map /^\s*(?:\*\*\*|---) (\S+)/, @$garbage[-1, -2];

    my $file =
        @files == 1 ? $files[0] :
        @files == 2 ? $files[length $files[0] > length $files[1]] :
        $self->SUPER::rummage($garbage);

    return $file;
}




package Patch::Ed;

BEGIN { Patch->import }

inc/bin/patch  view on Meta::CPAN

# Convert hunk to unified diff, then apply.
sub apply {
    my ($self, $i_start, $o_start, $cmd, $d_hunk, $a_hunk) = @_;

    $i_start++ if $cmd eq 'a';
    $o_start++ if $cmd eq 'd';
    my @hunk;
    push @hunk, map "-$_", @$d_hunk;
    push @hunk, map "+$_", @$a_hunk;

    $self->SUPER::apply($i_start, $o_start, @hunk);
}




package Patch::Unified;

BEGIN { Patch->import }

# Check for filename in diff header, then in 'Index:' line.
sub rummage {
    my ($self, $garbage) = @_;

    my @files = grep -e, map $self->strip,
        map /^\s*(?:---|\+\+\+) (\S+)/, @$garbage[-1, -2];

    my $file =
        @files == 1 ? $files[0] :
        @files == 2 ? $files[length $files[0] > length $files[1]] :
        $self->SUPER::rummage($garbage);

    return $file;
}




package Pushback;

# Create filehandles that can unread or push lines back into queue.



( run in 1.355 second using v1.01-cache-2.11-cpan-49f99fa48dc )