ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/App-Staticperl/patch-postinstall.sh
Revision: 1.5
Committed: Mon Mar 5 07:20:46 2012 UTC (14 years, 6 months ago) by root
Content type: application/x-sh
Branch: MAIN
CVS Tags: rel-1_42
Changes since 1.4: +1 -1 lines
Log Message:
1.42

File Contents

# Content
1 #! sh
2
3 # helper to apply patches after installation
4
5 patch() {
6 path="$PERL_PREFIX/lib/$1"
7 cache="$STATICPERL/patched/$2"
8 sed="$3"
9
10 if "$PERL_PREFIX/bin/perl" -e 'exit ((stat shift)[9] <= (stat shift)[9])' "$path" "$cache"; then
11 echo "patching $path for a better tomorrrow"
12
13 if ! sed -e "$sed" <"$path" > "$cache~"; then
14 echo
15 echo "*** FATAL: error while patching $path"
16 echo
17 else
18 rm -f "$cache"
19 mv "$cache~" "$cache"
20 rm -f "$path"
21 cp "$cache" "$path"
22 fi
23 fi
24 }
25
26 # patch CPAN::HandleConfig.pm to always include _our_ MyConfig.pm,
27 # not the one in the users homedirectory, to avoid clobbering his.
28 patch CPAN/HandleConfig.pm cpan_handleconfig_pm '
29 1i\
30 use CPAN::MyConfig; # patched by staticperl
31 '
32
33 # patch ExtUtils::MM_Unix to always search blib for modules
34 # when building a perl - this works around Pango/Gtk2 being misdetected
35 # as not being an XS module.
36 patch ExtUtils/MM_Unix.pm mm_unix_pm '
37 /^sub staticmake/,/^}/ s/if (@{$self->{C}}) {/if (@{$self->{C}} or $self->{NAME} =~ m%^(Pango|Gtk2)$%) { # patched by staticperl/
38 '
39
40 # patch ExtUtils::MM_Any *temporarily* because it breaks Pod::Parser
41 patch ExtUtils/MM_Any.pm mm_any_pm '
42 /^sub metafile_data/ a\
43 return; # patched by staticperl
44 '
45
46 # patch ExtUtils::Miniperl to always add DynaLoader
47 # this is required for dynamic loading in static perls,
48 # and static loading in dynamic perls, when rebuilding a new perl.
49 # Why this patch is necessray I don't understand. Yup.
50 patch ExtUtils/Miniperl.pm extutils_miniperl.pm '
51 /^sub writemain/ a\
52 push @_, canon("/","DynaLoader"); # patched by staticperl
53 '