Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: staticperl ( and Mojolicious )

by wjw (Curate)
on May 12, 2014 at 19:37 UTC ( #1085822=note: print w/replies, xml ) Need Help??

in reply to [solved] PAR and Mojolicious

Not sure if this is what you are after or not, but PAR::Packer seems like it might be worth looking at.

...Hope there is something there for you...

...the majority is always wrong, and always the last to know about it...
Insanity: Doing the same thing over and over again and expecting different results...

Replies are listed 'Best First'.
Re^2: staticperl ( and Mojolicious )
by basiliscos (Pilgrim) on May 13, 2014 at 13:36 UTC

    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, 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/ from Mojolicious distribution:

      $ locate entities.txt /home/dmol/development/perl/ +/site_perl/5.16.3/Mojo/entities.txt $ locate /home/dmol/development/perl/ +/site_perl/5.16.3/Mojolicious/

      (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/ +5.16.3/lib/site_perl/5.16.3/Mojo/entities.txt;Mojo/entities.txt" \ -a "/home/dmol/development/perl/ +/lib/site_perl/5.16.3/Mojolicious/;Mojolicious/ +" \ ./

    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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1085822]
[1nickt]: choroba Understood. I'm wondering about the logic in a cpanfile. If the perl doesn't support threads, it's easy: require MCE. If the perl does support threads, as you say the user has a choice, so require both? Or, assume that irrespective of the choide
[1nickt]: ... choice, the threaded-perl user *probably* wants to use threads, therefore only require threads and leave MCE out, allowing the user to manually install if desired?
[choroba]: just require any of MCE and threads. Not sure if that's possible in the cpanfile, but should be possible early in the Makefile
[1nickt]: The app expects threads as default anyway, right?
[choroba]: that's true
[1nickt]: expects threads *to be* the default
[1nickt]: I think cpanfile can handle the logic. testing now.

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (14)
As of 2017-10-18 13:24 GMT
Find Nodes?
    Voting Booth?
    My fridge is mostly full of:

    Results (244 votes). Check out past polls.