App-Staticperl
view release on metacpan or search on metacpan
bin/staticperl view on Meta::CPAN
for unicode character ranges in regexes) is implemented in the
C<"utf8_heavy.pl"> library:
-Mutf8_heavy.pl
Many Unicode properties in turn are defined in separate modules,
such as C<"unicore/Heavy.pl"> and more specific data tables such as
C<"unicore/To/Digit.pl"> or C<"unicore/lib/Perl/Word.pl">. These tables
are big (7MB uncompressed, although F<staticperl> contains special
handling for those files), so including them only on demand in your
application might pay off.
To simply include the whole unicode database, use:
--incglob '/unicore/**.pl'
=item AnyEvent
AnyEvent needs a backend implementation that it will load in a delayed
fashion. The L<AnyEvent::Impl::Perl> backend is the default choice
for AnyEvent if it can't find anything else, and is usually a safe
fallback. If you plan to use e.g. L<EV> (L<POE>...), then you need to
include the L<AnyEvent::Impl::EV> (L<AnyEvent::Impl::POE>...) backend as
well.
If you want to handle IRIs or IDNs (L<AnyEvent::Util> punycode and idn
functions), you also need to include C<"AnyEvent/Util/idna.pl"> and
C<"AnyEvent/Util/uts46data.pl">.
Or you can use C<--usepacklists> and specify C<-MAnyEvent> to include
everything.
=item Cairo
See Glib, same problem, same solution.
=item Carp
Carp had (in older versions of perl) a dependency on L<Carp::Heavy>. As of
perl 5.12.2 (maybe earlier), this dependency no longer exists.
=item Config
The F<perl -V> switch (as well as many modules) needs L<Config>, which in
turn might need L<"Config_heavy.pl">. Including the latter gives you
both.
=item Glib
Glib literally requires Glib to be installed already to build - it tries
to fake this by running Glib out of the build directory before being
built. F<staticperl> tries to work around this by forcing C<MAN1PODS> and
C<MAN3PODS> to be empty via the C<PERL_MM_OPT> environment variable.
=item Gtk2
See Pango, same problems, same solution.
=item Net::SSLeay
This module hasn't been significantly updated since OpenSSL is called
OpenSSL, and fails to properly link against dependent libraries, most
commonly, it forgets to specify -ldl when linking.
On GNU/Linux systems this usually goes undetected, as perl usually links
against -ldl itself and OpenSSL just happens to pick it up that way, by
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
Also needs L<Term::ReadLine::readline>, or C<--usepacklists>.
=item URI
URI implements schemes as separate modules - the generic URL scheme is
implemented in L<URI::_generic>, HTTP is implemented in L<URI::http>. If
you need to use any of these schemes, you should include these manually,
or use C<--usepacklists>.
=back
=head2 RECIPES
=over 4
=item Just link everything in
To link just about everything installed in the perl library into a new
perl, try this (the first time this runs it will take a long time, as a
lot of files need to be parsed):
staticperl mkperl -v --strip ppi --incglob '*'
If you don't mind the extra megabytes, this can be a very effective way of
creating bundles without having to worry about forgetting any modules.
You get even more useful variants of this method by first selecting
everything, and then excluding stuff you are reasonable sure not to need -
L<bigperl|http://staticperl.schmorp.de/bigperl.html> uses this approach.
=item Getting rid of netdb functions
The perl core has lots of netdb functions (C<getnetbyname>, C<getgrent>
( run in 1.773 second using v1.01-cache-2.11-cpan-39bf76dae61 )