Perl-Dist-WiX

changeset 1053:c119e1860e96

Starting work on making more things accessible to the plugins.
author Curtis Jewell <perl@curtisjewell.name>
date Sun Jun 12 18:12:40 2011 -0600 (2011-06-12)
parents 85daa4d3caf6
children 2569a48f8b93
files lib/Perl/Dist/WiX.pm lib/Perl/Dist/WiX/Mixin/Libraries.pm
line diff
     1.1 --- a/lib/Perl/Dist/WiX.pm	Fri Jun 10 06:32:13 2011 -0600
     1.2 +++ b/lib/Perl/Dist/WiX.pm	Sun Jun 12 18:12:40 2011 -0600
     1.3 @@ -2244,6 +2244,21 @@
     1.4  	default  => sub { File::List::Object->new() },
     1.5  );
     1.6  
     1.7 +has '_toolchain_modules' => (
     1.8 +	is       => 'ro',
     1.9 +	isa      => ArrayRef[ Str ],
    1.10 +	init_arg => undef,
    1.11 +	lazy     => 1,
    1.12 +	builder  => '_build_toolchain_modules',
    1.13 +);
    1.14 +
    1.15 +sub _build_toolchain_modules {
    1.16 +
    1.17 +	# Implemented in plugins.
    1.18 +	PDWiX::Unimplemented->throw();
    1.19 +	return [];
    1.20 +}
    1.21 +
    1.22  # This comes from MooseX::Object::Pluggable, and sets up the
    1.23  # fact that Perl::Dist::WiX::BuildPerl::* is where plugins happen to be.
    1.24  has '+_plugin_ns' => ( default => 'BuildPerl', );
    1.25 @@ -2384,7 +2399,7 @@
    1.26  	$ENV{TEMP} = $self->tempenv_dir();
    1.27  	$self->trace_line( 5, 'Emptied: ' . $self->tempenv_dir() . "\n" );
    1.28  
    1.29 -	### *** TODO: Move AppData/.cpan/CPAN/MyConfig.pm out of the way. ***
    1.30 +	### *** TODO: Move AppData/Local/.cpan/CPAN/MyConfig.pm out of the way. ***
    1.31  
    1.32  	# If we have a file:// url for the CPAN, move the
    1.33  	# sources directory out of the way.
    1.34 @@ -2641,7 +2656,8 @@
    1.35  	$self->get_directory_tree()
    1.36  	  ->add_merge_module( $self->image_dir()->stringify(), $mm );
    1.37  
    1.38 -   # Set the file paths that the first portion of the build otherwise would.
    1.39 +    # Set the file paths that the first portion of the build 
    1.40 +	# otherwise would.
    1.41  	$self->_set_bin_perl( $self->file(qw(perl bin perl.exe)) );
    1.42  	$self->_set_bin_make( $self->file(qw(c bin dmake.exe)) );
    1.43  	$self->_set_bin_pexports( $self->file(qw(c bin pexports.exe)) );
     2.1 --- a/lib/Perl/Dist/WiX/Mixin/Libraries.pm	Fri Jun 10 06:32:13 2011 -0600
     2.2 +++ b/lib/Perl/Dist/WiX/Mixin/Libraries.pm	Sun Jun 12 18:12:40 2011 -0600
     2.3 @@ -34,37 +34,51 @@
     2.4  our $VERSION = '1.550';
     2.5  $VERSION =~ s/_//ms;
     2.6  
     2.7 -Readonly my %PACKAGES => (
     2.8 -	'32bit-gcc3' => {
     2.9 -		'dmake'         => 'dmake-4.8-20070327-SHAY.zip',
    2.10 -		'mingw-make'    => 'mingw32-make-3.81-2.tar.gz',
    2.11 -		'pexports'      => '32bit-gcc3/pexports-0.43-1-20100120.zip',
    2.12 -		'gcc-toolchain' => 'mingw32-gcc3-toolchain-20091026-subset.tar.gz',
    2.13 -		'gcc-license'   => undef,
    2.14 +# Readonly my %PACKAGES => (
    2.15 +	# '32bit-gcc3' => {
    2.16 +		# 'dmake'         => 'dmake-4.8-20070327-SHAY.zip',
    2.17 +		# 'mingw-make'    => 'mingw32-make-3.81-2.tar.gz',
    2.18 +		# 'pexports'      => '32bit-gcc3/pexports-0.43-1-20100120.zip',
    2.19 +		# 'gcc-toolchain' => 'mingw32-gcc3-toolchain-20091026-subset.tar.gz',
    2.20 +		# 'gcc-license'   => undef,
    2.21  
    2.22 -# Former components of what's now included in gcc-toolchain.
    2.23 -#		'gcc-core'      => 'gcc-core-3.4.5-20060117-3.tar.gz',
    2.24 -#		'gcc-g++'       => 'gcc-g++-3.4.5-20060117-3.tar.gz',
    2.25 -#		'binutils'      => 'binutils-2.17.50-20060824-1.tar.gz',
    2.26 -#		'mingw-runtime' => 'mingw-runtime-3.13.tar.gz',
    2.27 -#		'w32api'        => 'w32api-3.10.tar.gz',
    2.28 -	},
    2.29 -	'32bit-gcc4' => {
    2.30 -		'dmake'      => '32bit-gcc4/dmake-SVN20091127-bin_20100524.zip',
    2.31 -		'mingw-make' => '32bit-gcc4/gmake-3.81-20090914-bin_20100524.zip',
    2.32 -		'pexports'   => '32bit-gcc4/pexports-0.44-bin_20100120.zip',
    2.33 -		'gcc-toolchain' => '32bit-gcc4/mingw64-w32-20100123-kmx-v2.zip',
    2.34 -		'gcc-license'   => '32bit-gcc4/mingw64-w32-20100123-kmx-v2-lic.zip',
    2.35 -	},
    2.36 -	'64bit-gcc4' => {
    2.37 -		'dmake'         => '64bit-gcc4/dmake-SVN20091127-bin_20100524.zip',
    2.38 -		'mingw-make'    => '64bit-gcc4/gmake-3.81.90_20100127_20100524.zip',
    2.39 -		'pexports'      => '64bit-gcc4/pexports-0.44-bin_20100110.zip',
    2.40 -		'gcc-toolchain' => '64bit-gcc4/mingw64-w64-20100123-kmx-v2.zip',
    2.41 -		'gcc-license'   => '64bit-gcc4/mingw64-w64-20100123-kmx-v2-lic.zip',
    2.42 -	},
    2.43 +# # Former components of what's now included in gcc-toolchain.
    2.44 +# #		'gcc-core'      => 'gcc-core-3.4.5-20060117-3.tar.gz',
    2.45 +# #		'gcc-g++'       => 'gcc-g++-3.4.5-20060117-3.tar.gz',
    2.46 +# #		'binutils'      => 'binutils-2.17.50-20060824-1.tar.gz',
    2.47 +# #		'mingw-runtime' => 'mingw-runtime-3.13.tar.gz',
    2.48 +# #		'w32api'        => 'w32api-3.10.tar.gz',
    2.49 +	# },
    2.50 +	# '32bit-gcc4' => {
    2.51 +		# 'dmake'      => '32bit-gcc4/dmake-SVN20091127-bin_20100524.zip',
    2.52 +		# 'mingw-make' => '32bit-gcc4/gmake-3.81-20090914-bin_20100524.zip',
    2.53 +		# 'pexports'   => '32bit-gcc4/pexports-0.44-bin_20100120.zip',
    2.54 +		# 'gcc-toolchain' => '32bit-gcc4/mingw64-w32-20100123-kmx-v2.zip',
    2.55 +		# 'gcc-license'   => '32bit-gcc4/mingw64-w32-20100123-kmx-v2-lic.zip',
    2.56 +	# },
    2.57 +	# '64bit-gcc4' => {
    2.58 +		# 'dmake'         => '64bit-gcc4/dmake-SVN20091127-bin_20100524.zip',
    2.59 +		# 'mingw-make'    => '64bit-gcc4/gmake-3.81.90_20100127_20100524.zip',
    2.60 +		# 'pexports'      => '64bit-gcc4/pexports-0.44-bin_20100110.zip',
    2.61 +		# 'gcc-toolchain' => '64bit-gcc4/mingw64-w64-20100123-kmx-v2.zip',
    2.62 +		# 'gcc-license'   => '64bit-gcc4/mingw64-w64-20100123-kmx-v2-lic.zip',
    2.63 +	# },
    2.64 +# );
    2.65 +
    2.66 +has '_library_information' => (
    2.67 +	is       => 'ro',
    2.68 +	isa      => HashRef[ Str ],
    2.69 +	init_arg => undef,
    2.70 +	lazy     => 1,
    2.71 +	builder  => '_build_library_information',
    2.72  );
    2.73  
    2.74 +sub _build_library_information {
    2.75 +	# Implemented in plugins.
    2.76 +	return {};
    2.77 +}
    2.78 +
    2.79 +
    2.80  =pod
    2.81  
    2.82  =head2 library_directory
    2.83 @@ -82,9 +96,9 @@
    2.84  sub library_directory {
    2.85  	my $self = shift;
    2.86  
    2.87 -	my $answer = $self->bits() . 'bit-gcc' . $self->gcc_version();
    2.88 -
    2.89 -	return $answer;
    2.90 +	# Implemented as a plugin.
    2.91 +	PDWiX::Unimplemented->throw();
    2.92 +	return '';
    2.93  }
    2.94  
    2.95  
    2.96 @@ -95,20 +109,17 @@
    2.97  	my $package = shift;
    2.98  
    2.99  	my $toolchain = $self->library_directory();
   2.100 -
   2.101 +	my $packages = $self->_library_information();
   2.102 +	
   2.103  	$self->trace_line( 3, "Searching for $package in $toolchain\n" );
   2.104  
   2.105 -	if ( not exists $PACKAGES{$toolchain} ) {
   2.106 -		PDWiX->throw('Can only build 32 or 64-bit versions of perl');
   2.107 -	}
   2.108 -
   2.109 -	if ( not exists $PACKAGES{$toolchain}{$package} ) {
   2.110 +	if ( not exists $packages->{$package} ) {
   2.111  		PDWiX->throw(
   2.112  			'get_package_file was called on a package that was not defined.'
   2.113  		);
   2.114  	}
   2.115  
   2.116 -	my $package_file = $PACKAGES{$toolchain}{$package};
   2.117 +	my $package_file = $packages->{$package};
   2.118  	$self->trace_line( 3, "Package $package is in $package_file\n" );
   2.119  
   2.120  	return $package_file;