--- App-Staticperl/staticperl.sh 2015/10/16 02:43:37 1.63 +++ App-Staticperl/staticperl.sh 2019/06/05 22:16:13 1.67 @@ -71,7 +71,7 @@ # work around ExtUtils::CBuilder and others export CC="$PERL_CC" -export CFLAGS="$PERL_CFLASGS" +export CFLAGS="$PERL_CFLAGS" export LD="$PERL_CC" export LDFLAGS="$PERL_LDFLAGS" unset LIBS @@ -88,7 +88,7 @@ # set version in a way that Makefile.PL can extract VERSION=VERSION; eval \ -$VERSION="1.44" +$VERSION="1.45" fatal() { printf -- "\nFATAL: %s\n\n" "$*" >&2 @@ -148,6 +148,7 @@ } fetch() { +( rcd "$STATICPERL" mkdir -p src @@ -218,7 +219,7 @@ *.gz ) UNCOMPRESS="gzip -d" ;; *.tar ) UNCOMPRESS="cat" ;; * ) - fatal "don't know hot to uncompress $PERL_TAR,\nonly tar, tar.gz, tar.bz2, tar.lzma and tar.xz are supported." + fatal "don't know hot to uncompress $PERLTAR,\nonly tar, tar.gz, tar.bz2, tar.lzma and tar.xz are supported." exit 1 ;; esac @@ -236,6 +237,7 @@ rm "$PERLTAR" fi +) || exit } # similar to GNU-sed -i or perl -pi @@ -272,6 +274,7 @@ } configure() { +( fetch rcd "$STATICPERL/src/perl" @@ -331,6 +334,7 @@ -Dcf_by="$EMAIL" \ $PERL_CONFIGURE \ -Duseperlio \ + -Uversiononly \ -dE || configure_failure sedreplace ' @@ -345,6 +349,7 @@ postconfigure || fatal "postconfigure hook failed" : > staticstamp.configure +) || exit } write_shellscript() { @@ -359,6 +364,7 @@ } build() { +( configure rcd "$STATICPERL/src/perl" @@ -372,6 +378,7 @@ "$MAKE" || fatal "make: error while building perl" postbuild || fatal "postbuild hook failed" +) || exit } _postinstall() { @@ -387,6 +394,7 @@ } install() { +( if ! [ -e "$PERL_PREFIX/staticstamp.install" ]; then build @@ -403,19 +411,26 @@ ln -sf "$PERL_PREFIX" "$STATICPERL/perl" # might get overwritten rm -rf "$PERL_PREFIX" # by this rm -rf + rcd "$STATICPERL/src/perl" + "$MAKE" install || fatal "make install: error while installing" rcd "$PERL_PREFIX" # create a "make install" replacement for CPAN - write_shellscript SP-make-install-make <<'EOF' + write_shellscript SP-make-make <<'end_of_make' +#CAT make-make.sh +end_of_make + + # create a "make install" replacement for CPAN + write_shellscript SP-make-install-make <<'end_of_make_install_make' #CAT make-install-make.sh -EOF +end_of_make_install_make # create a "patch modules" helper - write_shellscript SP-patch-postinstall <<'EOF' + write_shellscript SP-patch-postinstall <<'end_of_patch_postinstall' #CAT patch-postinstall.sh -EOF +end_of_patch_postinstall # immediately use it "$PERL_PREFIX/bin/SP-patch-postinstall" @@ -436,6 +451,7 @@ CPAN::Shell->o (conf => q , "'"$STATICPERL"'/cpan/histfile"); CPAN::Shell->o (conf => q, "'"$STATICPERL"'/cpan/sources"); CPAN::Shell->o (conf => q, "MAP_TARGET=perl"); + CPAN::Shell->o (conf => q, "'"$PERL_PREFIX"'/bin/SP-make-make"); CPAN::Shell->o (conf => q, "'"$PERL_PREFIX"'/bin/SP-make-install-make"); CPAN::Shell->o (conf => q, q); CPAN::Shell->o (conf => q, q); @@ -447,9 +463,11 @@ fi _postinstall +) || exit } import() { +( IMPORT="$1" rcd "$STATICPERL" @@ -470,6 +488,7 @@ fi _postinstall +) || exit } ############################################################################# @@ -480,7 +499,7 @@ verblock < $_) for @ARGV' -- "$@" | tee "$STATICPERL/instcpan.log" if grep -q " -- NOT OK\$" "$STATICPERL/instcpan.log"; then - fatal "failure while installing modules from CPAN ($@)" + fatal "failure while installing modules from CPAN ($*)" fi rm -f "$STATICPERL/instcpan.log" } @@ -502,7 +521,7 @@ verblock <