2 #############################################################################
3 ## Name: script/fix_alien_path.pl
4 ## Purpose: Substitute Alien::wxWidgets path in modules
5 ## Author: Mattia Barbon
8 ## RCS-ID: $Id: fix_alien_path.pl 2057 2007-06-18 23:03:00Z mbarbon $
9 ## Copyright: (c) 2005-2006 Mattia Barbon
10 ## Licence: This program is free software; you can redistribute it and/or
11 ## modify it under the same terms as Perl itself
12 #############################################################################
15 use blib; # to pick the correct 'Wx::build::Options'
16 use Alien::wxWidgets 0.04 ();
17 use Wx::build::Options;
18 use Fatal qw(open close unlink);
21 use File::Spec::Functions qw(splitpath splitdir);
23 # we do not care about the options, just that Alien::wxWidgets
24 # is initialized with the correct key
25 Wx::build::Options->get_makemaker_options( 'saved' );
26 $Alien::wxWidgets::dont_remap = 1;
28 my( $from, $to ) = @ARGV;
29 my $key = Alien::wxWidgets->key;
30 my $version = Alien::wxWidgets->version;
31 my @libs = Alien::wxWidgets->library_keys;
32 my %libs; @libs{@libs} = Alien::wxWidgets->shared_libraries( @libs );
33 my $libs = Data::Dumper::Dumper( \%libs );
36 if( $^O =~ /mswin/i ) {
39 my( $vol, $dir, $file ) = splitpath( Alien::wxWidgets->prefix );
40 $keyd = $file ? $file : ( splitdir( $dir ) )[-1];
44 open my $in, "< $from"; binmode $in;
45 open my $out, "> $to"; binmode $out;
48 s/XXXALIENDXXX/$keyd/g;
50 s/Wx::wxVERSION\(\)/$version/g;