| 1 | package Perl::Dist::Strawberry::BuildPerl::5123; | ||
| 2 | |||
| 3 | =pod | ||
| 4 | |||
| 5 | =begin readme text | ||
| 6 | |||
| 7 | Perl::Dist::Strawberry::BuildPerl::5123 version 2.5001 | ||
| 8 | |||
| 9 | =end readme | ||
| 10 | |||
| 11 | =for readme stop | ||
| 12 | |||
| 13 | =head1 NAME | ||
| 14 | |||
| 15 | Perl::Dist::Strawberry::BuildPerl::5123 - Files and code for building Perl 5.12.3 | ||
| 16 | |||
| 17 | =head1 VERSION | ||
| 18 | |||
| 19 | This document describes Perl::Dist::Strawberry::BuildPerl::5123 version 2.5001. | ||
| 20 | |||
| 21 | =head1 DESCRIPTION | ||
| 22 | |||
| 23 | This module provides the routines and files that Perl::Dist::Strawberry uses in | ||
| 24 | order to build Perl itself. | ||
| 25 | |||
| 26 | =begin readme | ||
| 27 | |||
| 28 | =head1 INSTALLATION | ||
| 29 | |||
| 30 | To install this module, run the following commands: | ||
| 31 | |||
| 32 | perl Build.PL | ||
| 33 | ./Build | ||
| 34 | ./Build test | ||
| 35 | ./Build install | ||
| 36 | |||
| 37 | =end readme | ||
| 38 | |||
| 39 | =for readme stop | ||
| 40 | |||
| 41 | =head1 SYNOPSIS | ||
| 42 | |||
| 43 | # This module is not to be used independently. | ||
| 44 | # It provides methods to be called on a Perl::Dist::Strawberry object. | ||
| 45 | |||
| 46 | =head1 INTERFACE | ||
| 47 | |||
| 48 | =cut | ||
| 49 | |||
| 50 | use 5.010; | ||
| 51 | use Moose::Role; | ||
| 52 | use File::ShareDir qw(); | ||
| 53 | use Perl::Dist::WiX::Asset::Perl qw(); | ||
| 54 | |||
| 55 | our $VERSION = '2.5001'; | ||
| 56 | |||
| 57 | |||
| 58 | |||
| 59 | |||
| 60 | ##################################################################### | ||
| 61 | # Perl installation support | ||
| 62 | |||
| 63 | =head2 install_perl_plugin | ||
| 64 | |||
| 65 | This routine is called by the | ||
| 66 | C<install_perl|Perl::Dist::WiX::BuildPerl/install_perl> task, and installs | ||
| 67 | perl 5.12.3. | ||
| 68 | |||
| 69 | =cut | ||
| 70 | |||
| 71 | |||
| 72 | |||
| 73 | around '_install_perl_plugin' => sub { | ||
| 74 | shift; # We don't need the original. | ||
| 75 | my $self = shift; | ||
| 76 | |||
| 77 | # Check for an error in the object. | ||
| 78 | if ( not $self->bin_make() ) { | ||
| 79 | PDWiX->throw('Cannot build Perl yet, no bin_make defined'); | ||
| 80 | } | ||
| 81 | |||
| 82 | # Get the information required for Perl's toolchain. | ||
| 83 | my $toolchain = $self->_create_perl_toolchain(); | ||
| 84 | |||
| 85 | # Install perl. | ||
| 86 | my $perl = Perl::Dist::WiX::Asset::Perl->new( | ||
| 87 | parent => $self, | ||
| 88 | url => 'http://strawberryperl.com/package/perl-5.12.3.tar.bz2', | ||
| 89 | toolchain => $toolchain, | ||
| 90 | patch => [ qw{ | ||
| 91 | lib/CPAN/Config.pm | ||
| 92 | win32/config.gc | ||
| 93 | win32/config.gc64nox | ||
| 94 | win32/config_sh.PL | ||
| 95 | win32/config_H.gc | ||
| 96 | win32/config_H.gc64nox | ||
| 97 | win32/FindExt.pm | ||
| 98 | } | ||
| 99 | ], | ||
| 100 | license => { | ||
| 101 | 'perl-5.12.3/Readme' => 'perl/Readme', | ||
| 102 | 'perl-5.12.3/Artistic' => 'perl/Artistic', | ||
| 103 | 'perl-5.12.3/Copying' => 'perl/Copying', | ||
| 104 | }, | ||
| 105 | ); | ||
| 106 | $perl->install(); | ||
| 107 | |||
| 108 | return 1; | ||
| 109 | }; ## end sub install_perl_plugin | ||
| 110 | |||
| 111 | |||
| 112 | |||
| 113 | around '_find_perl_file' => sub { | ||
| 114 | my $orig = shift; | ||
| 115 | my $self = shift; | ||
| 116 | my $file = shift; | ||
| 117 | |||
| 118 | my $location = undef; | ||
| 119 | |||
| 120 | $location = eval { | ||
| 121 | File::ShareDir::module_file( | ||
| 122 | 'Perl::Dist::Strawberry::BuildPerl::5123', $file ); | ||
| 123 | }; | ||
| 124 | |||
| 125 | if ($location) { | ||
| 126 | return $location; | ||
| 127 | } else { | ||
| 128 | return $self->$orig($file); | ||
| 129 | } | ||
| 130 | }; | ||
| 131 | |||
| 132 | no Moose::Role; | ||
| 133 | |||
| 134 | 1; | ||
| 135 | |||
| 136 | __END__ |