App-Staticperl

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

use ExtUtils::MakeMaker;

WriteMakefile(
    dist	 => {
	             PREOP	=> './build && pod2text bin/staticperl | tee README >$(DISTVNAME)/README; chmod -R u=rwX,go=rX . ;',
	             COMPRESS	=> 'gzip -9v',
	             SUFFIX	=> '.gz',
	            },
    NAME         => "App::Staticperl",
    ABSTRACT     => "perl, libc, 100 modules, all in one standalone 500kb file",
    VERSION_FROM => "bin/staticperl",
    EXE_FILES    => ["bin/staticperl"],
    PM           => {},
    MAN3PODS     => {},
);

README  view on Meta::CPAN


        For static builds, you either have to configure -ldl manually, or
        you cna use the following snippet in your "postinstall" hook which
        patches Net::SSLeay after installation, which happens to work most
        of the time:

           postinstall() {
              # first install it
              instcpan Net::SSLeay
              # then add -ldl for future linking
              chmod u+w "$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
              echo " -ldl" >>"$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
           }

    Pango
        In addition to the "MAN3PODS" problem in Glib, Pango also routes
        around ExtUtils::MakeMaker by compiling its files on its own.
        staticperl tries to patch ExtUtils::MM_Unix to route around Pango.

    Term::ReadLine::Perl
        Also needs Term::ReadLine::readline, or "--usepacklists".

bin/staticperl  view on Meta::CPAN

      case "$PERL_VERSION" in
         *:* )
            # url
            PERLURL="$PERL_VERSION"
            PERLTAR="$(basename "$PERL_VERSION")"
            ;;
         /* )
            # directory
            verbose "copying $PERL_VERSION"
            cp -Rp "$PERL_VERSION/." unpack/.
            chmod -R u+w unpack
            mv unpack perl
            return
            ;;
         * )
            PERLURL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.bz2"
            PERLTAR=perl-$PERL_VERSION.tar.bz2
            ;;
      esac

      if ! [ -e "$PERLTAR" ]; then

bin/staticperl  view on Meta::CPAN

         * )
            fatal "don't know hot to uncompress $PERLTAR,\nonly tar, tar.gz, tar.bz2, tar.lzma and tar.xz are supported."
            exit 1
            ;;
      esac

      <"$PERLTAR" $UNCOMPRESS -d | ( cd unpack && tar xf - ) \
         || fatal "$PERLTAR: error during unpacking"

      if [ -d unpack/*/ ]; then
         chmod -R u+w unpack/*/
         mv unpack/*/ perl
         rmdir -p unpack
      else
         fatal "unpacking $PERLTAR did not result in a single directory, don't know how to handle this"
      fi

      rm "$PERLTAR"
   fi
) || exit
}

bin/staticperl  view on Meta::CPAN

}

write_shellscript() {
   {
      echo "#!/bin/sh"
      echo "STATICPERL=\"$STATICPERL\""
      echo "PERL_PREFIX=\"$PERL_PREFIX\""
      echo "MAKE=\"$MAKE\""
      cat
   } >"$PERL_PREFIX/bin/$1"
   chmod 755 "$PERL_PREFIX/bin/$1"
}

build() {
(
   configure

   rcd "$STATICPERL/src/perl"

   verblock <<EOF
building $STATICPERL/src/perl

bin/staticperl  view on Meta::CPAN

   print "\n"
      if $VERBOSE >= 1;
}

end_of_mkbundle
}

bundle() {
   MKBUNDLE="${MKBUNDLE:=$PERL_PREFIX/bin/SP-mkbundle}"
   catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create"
   chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE"
   CACHE="$STATICPERL/cache"
   mkdir -p "$CACHE"
   "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" --cache "$CACHE" "$@"
}

if [ $# -gt 0 ]; then
   while [ $# -gt 0 ]; do
      mkdir -p "$STATICPERL" || fatal "$STATICPERL: cannot create"
      mkdir -p "$PERL_PREFIX" || fatal "$PERL_PREFIX: cannot create"

bin/staticperl  view on Meta::CPAN

chance.

For static builds, you either have to configure -ldl manually, or you
cna use the following snippet in your C<postinstall> hook which patches
Net::SSLeay after installation, which happens to work most of the time:

   postinstall() {
      # first install it
      instcpan Net::SSLeay
      # then add -ldl for future linking
      chmod u+w "$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
      echo " -ldl" >>"$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
   }

=item Pango

In addition to the C<MAN3PODS> problem in Glib, Pango also routes around
L<ExtUtils::MakeMaker> by compiling its files on its own. F<staticperl>
tries to patch L<ExtUtils::MM_Unix> to route around Pango.

=item Term::ReadLine::Perl

build  view on Meta::CPAN

      IFS=
      while read -r line; do
         if [ "${line###CAT }" != "$line" ]; then
            cat "${line###CAT }"
         else
            printf -- "%s\n" "$line"
         fi
      done
   ) <staticperl.sh >bin/staticperl~
then
   chmod 755 bin/staticperl~
   if cmp -s bin/staticperl~ bin/staticperl; then
      rm bin/staticperl~
      echo unchanged
   else
      mv bin/staticperl~ bin/staticperl
      echo changed
   fi
fi

staticperl.pod  view on Meta::CPAN

chance.

For static builds, you either have to configure -ldl manually, or you
cna use the following snippet in your C<postinstall> hook which patches
Net::SSLeay after installation, which happens to work most of the time:

   postinstall() {
      # first install it
      instcpan Net::SSLeay
      # then add -ldl for future linking
      chmod u+w "$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
      echo " -ldl" >>"$PERL_PREFIX"/lib/auto/Net/SSLeay/extralibs.ld
   }

=item Pango

In addition to the C<MAN3PODS> problem in Glib, Pango also routes around
L<ExtUtils::MakeMaker> by compiling its files on its own. F<staticperl>
tries to patch L<ExtUtils::MM_Unix> to route around Pango.

=item Term::ReadLine::Perl

staticperl.sh  view on Meta::CPAN

      case "$PERL_VERSION" in
         *:* )
            # url
            PERLURL="$PERL_VERSION"
            PERLTAR="$(basename "$PERL_VERSION")"
            ;;
         /* )
            # directory
            verbose "copying $PERL_VERSION"
            cp -Rp "$PERL_VERSION/." unpack/.
            chmod -R u+w unpack
            mv unpack perl
            return
            ;;
         * )
            PERLURL="$CPAN/src/5.0/perl-$PERL_VERSION.tar.bz2"
            PERLTAR=perl-$PERL_VERSION.tar.bz2
            ;;
      esac

      if ! [ -e "$PERLTAR" ]; then

staticperl.sh  view on Meta::CPAN

         * )
            fatal "don't know hot to uncompress $PERLTAR,\nonly tar, tar.gz, tar.bz2, tar.lzma and tar.xz are supported."
            exit 1
            ;;
      esac

      <"$PERLTAR" $UNCOMPRESS -d | ( cd unpack && tar xf - ) \
         || fatal "$PERLTAR: error during unpacking"

      if [ -d unpack/*/ ]; then
         chmod -R u+w unpack/*/
         mv unpack/*/ perl
         rmdir -p unpack
      else
         fatal "unpacking $PERLTAR did not result in a single directory, don't know how to handle this"
      fi

      rm "$PERLTAR"
   fi
) || exit
}

staticperl.sh  view on Meta::CPAN

}

write_shellscript() {
   {
      echo "#!/bin/sh"
      echo "STATICPERL=\"$STATICPERL\""
      echo "PERL_PREFIX=\"$PERL_PREFIX\""
      echo "MAKE=\"$MAKE\""
      cat
   } >"$PERL_PREFIX/bin/$1"
   chmod 755 "$PERL_PREFIX/bin/$1"
}

build() {
(
   configure

   rcd "$STATICPERL/src/perl"

   verblock <<EOF
building $STATICPERL/src/perl

staticperl.sh  view on Meta::CPAN

      echo "#!$PERL_PREFIX/bin/perl"
      cat
   } <<'end_of_mkbundle'
#CAT mkbundle
end_of_mkbundle
}

bundle() {
   MKBUNDLE="${MKBUNDLE:=$PERL_PREFIX/bin/SP-mkbundle}"
   catmkbundle >"$MKBUNDLE~" || fatal "$MKBUNDLE~: cannot create"
   chmod 755 "$MKBUNDLE~" && mv "$MKBUNDLE~" "$MKBUNDLE"
   CACHE="$STATICPERL/cache"
   mkdir -p "$CACHE"
   "$PERL_PREFIX/bin/perl" -- "$MKBUNDLE" --cache "$CACHE" "$@"
}

if [ $# -gt 0 ]; then
   while [ $# -gt 0 ]; do
      mkdir -p "$STATICPERL" || fatal "$STATICPERL: cannot create"
      mkdir -p "$PERL_PREFIX" || fatal "$PERL_PREFIX: cannot create"



( run in 0.455 second using v1.01-cache-2.11-cpan-496ff517765 )