Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^2: staticperl ( and Mojolicious )

by basiliscos (Pilgrim)
on May 13, 2014 at 13:36 UTC ( #1085900=note: print w/ replies, xml ) Need Help??


in reply to Re: staticperl ( and Mojolicious )
in thread [solved] PAR and Mojolicious

Thank you, for hinting on PAR::Packer

.

Here is my receipt, how to make Mojolicious::Lite working under PAR::packer. I have taken some ideas from here

  1. You should have the code like the following at the beginning of myapp.pl, before "use Mojolicious::Lite" :

    BEGIN { if(exists $ENV{PAR_TEMP}) { my $dir = $ENV{PAR_TEMP}; chdir $dir; my @substitutions = qw/Mojo Mojolicious/; for(@substitutions){ next if -l; symlink "inc/$_", $_ or die "Can't symlink $_ at $dir: $!"; } print "I'm at at $dir\n"; } }

    NB for Win32 : the directories should be copied instead of just symlink'ed.

  2. Locate the Mojo/entities.txt and Mojolicious/Commands.pm from Mojolicious distribution:

    $ locate entities.txt /home/dmol/development/perl/dev-env.new/perlbrew/perls/perl-5.16.3/lib +/site_perl/5.16.3/Mojo/entities.txt $ locate Commands.pm /home/dmol/development/perl/dev-env.new/perlbrew/perls/perl-5.16.3/lib +/site_perl/5.16.3/Mojolicious/Commands.pm

    (As alternative, you could just point to them somewhere, where Mojolicious disrtibution has being manually unpacked).

  3. Create standalone application via the following command line:

    pp -x -a "/home/dmol/development/perl/dev-env.new/perlbrew/perls/perl- +5.16.3/lib/site_perl/5.16.3/Mojo/entities.txt;Mojo/entities.txt" \ -a "/home/dmol/development/perl/dev-env.new/perlbrew/perls/perl-5.16.3 +/lib/site_perl/5.16.3/Mojolicious/Commands.pm;Mojolicious/Commands.pm +" \ ./myapp.pl

I haven't tried the application with external public and templates dirs, but probably, you should include them into archive (see pp's help), and may be do the same tricks as in p.1

I hope it would be useful for somebody!


Comment on Re^2: staticperl ( and Mojolicious )
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1085900]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-07-06 08:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls