--- cvsroot/App-Staticperl/patch-postinstall.sh 2012/04/18 12:42:09 1.6 +++ cvsroot/App-Staticperl/patch-postinstall.sh 2014/01/17 18:06:43 1.8 @@ -7,18 +7,22 @@ cache="$STATICPERL/patched/$2" sed="$3" - if "$PERL_PREFIX/bin/perl" -e 'exit ((stat shift)[9] <= (stat shift)[9])' "$path" "$cache"; then - echo "patching $path for a better tomorrrow" + if "$PERL_PREFIX/bin/perl" -e 'exit 0+((stat shift)[7] == (stat shift)[7])' "$path" "$cache" || + "$PERL_PREFIX/bin/perl" -e 'exit 0+((stat shift)[9] <= (stat shift)[9])' "$path" "$cache" + then + if [ -e "$path" ]; then + echo "patching $path for a better tomorrrow" - if ! sed -e "$sed" <"$path" > "$cache~"; then - echo - echo "*** FATAL: error while patching $path" - echo - else - rm -f "$cache" - mv "$cache~" "$cache" - rm -f "$path" - cp "$cache" "$path" + umask 022 + if ! sed -e "$sed" <"$path" > "$cache~"; then + echo + echo "*** FATAL: error while patching $path" + echo + else + rm -f "$path" + mv "$cache~" "$path" + cp "$path" "$cache" + fi fi fi } @@ -45,3 +49,14 @@ /^sub writemain/ a\ push @_, canon("/","DynaLoader"); # patched by staticperl ' + +# ExtUtils::CBuilder always tries to link shared libraries +# even on systems without shared library support. From the same +# source as Module::Build, so no wonder it's broken beyond fixing. +# and since so many dependent modules are even worse, +# we hardwaire to 0 to get their pure-perl versions. +patch ExtUtils/CBuilder/Base.pm extutils_cbuilder_base.pm ' +/^sub have_compiler/ a\ + return 0; # patched by staticperl +' +