Strawberry Perl Home

Building your own "Strawberry Perl Plus..."

What do I need?

Start with an installation of either Bootstrap Perl, or a current version of Strawberry Perl 5.12.0.x. You'll need to install Strawberry Perl to a directory OTHER THAN C:\strawberry.

Install 4 modules, in this order:

These modules will install almost all of the others needed. (Most of the prerequisite modules will already be installed on Bootstrap Perl.)

You may wish to install Growl for Windows and Growl::GNTP, as once these two things are installed, Perl::Dist::WiX can use them to announce when builds are finished. This may not be as useful until you have multiple machines (virtual or real) building distributions. (Perl::Dist::WiX assumes there is a local copy of Growl for Windows running to notify, but that copy can redirect notifications to another machine.)

What do I do after everything's installed?

There are two more things to do:

  • Create a file "YourPerlBuild.pm" with these contents, then edit as appropriate:
    package YourPerlBuild;
    
    use 5.008001;
    use strict;
    use warnings;
    use parent qw(Perl::Dist::Strawberry);
    
    our $VERSION = '1.200';
    $VERSION =~ s/_//ms;
    
    sub new {
    	my $class = shift;
    	my %args;
    
    	# Check for the correct version of Perl::Dist::WiX.
    	Perl::Dist::WiX->VERSION(2.10);
    
    	if ( @_ == 1 && 'HASH' eq ref $_[0] ) {
    		%args = %{ $_[0] };
    	} elsif ( 0 == @_ % 2 ) {
    		%args = (@_);
    	} else {
    		PDWiX->throw(
    			'Parameters incorrect (not a hashref or hash) for YourPerlBuild->new()');
    	}
    
    	%args = (
    		# Set this to 2 for now. You can set it to 1 later.
    		trace             => 2,
    		
    		# Change these as appropriate for what you want to call your distribution.
    		app_publisher_url => 'http://yourwebsite.invalid/',
    		app_id            => 'yourperl',
    		app_name          => 'Your Perl',
    		app_publisher     => 'Your Publisher',
    		
    		build_number      => 2,
    		
    		# This specifies which version of Perl to use.
    		perl_version      => '5101',
    		
    		# These are the locations to pull down the msm. 
    		# You'll want to look at the link below to know what to set here.
    		msm_to_use => 'http://strawberryperl.com/download/strawberry-msm/strawberry-perl-5.10.1.2.msm',
    		msm_zip    => 'http://strawberryperl.com/download/strawberry-perl-5.10.1.2.zip',
    		msm_code   => 'BC4B680E-4871-31E7-9883-3E2C74EA4F3C',
    
    		# TODO: Put other arguments here.
    		
    		# If you want more than one routine that installs modules,
    		# you'll need to specify them all in the tasklist.
    		tasklist => [
    			'final_initialization',
    			'initialize_using_msm',
    			'install_your_modules',
    			'install_win32_extras',
    			'install_strawberry_extras',
    			'remove_waste',
    			'regenerate_fragments',
    			'write',
    		],
    		%args,
    	);
    
    	return $class->SUPER::new( \%args );
    } ## end sub new
    
    
    sub install_your_modules {
    	my $self = shift;
    
    	# TODO: List your modules here.
    	# PLEASE NOTE that you must list all the prerequisites
    	# (that aren't installed in Strawberry Perl) in this list.
    	$self->install_modules( qw{
    		Spreadsheet::ParseExcel
    	} );
    }
    
    # Default the output filename to the id plus the current date
    sub _build_output_base_filename {
    	my $self = shift;
    
    	my $bits = ( 64 == $self->bits() ) ? q{-64bit} : q{};
    
    	my $string =
    	    $self->app_id() . q{-}
    	  . $self->perl_version_human() . q{.}
    	  . $self->build_number() . q{-}
    	  . $self->output_date_string()
    	  . $bits;
    
    	return $string;
    } ## end sub _build_output_base_filename
    
    1;
    	  
  • Create a script (let's call it build_perl.pl) and place it in the same directory as MyPerlBuild.pm.
  • use YourPerlBuild;
    
    my $dist = YourPerlBuild->new();
    $dist->run();
    	  

The link referred to above is currently at http://strawberryperl.com/documentation/merge-module/.

Run build_perl.pl, wait a few hours, and you're done.

If you want to do more complicated things than just add additional modules, read the Perl::Dist::WiX documentation, and then e-mail us and we'll do our best to help you out.