Skip to content

Commit edbc547

Browse files
committed
documentation update
1 parent eb68d71 commit edbc547

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Inspired by [NW.js](http://nwjs.io/) and [Electron](http://electron.atom.io/), P
1818
* [Compile-time Requirements](#compile-time-requirements)
1919
* [Compile-time Variables](#compile-time-variables)
2020
* [Runtime Requirements](#runtime-requirements)
21+
* [Preparing a Perl Distribution for PEB](#preparing-a-perl-distribution-for-peb)
2122
* [Supported Perl Script Types](#supported-perl-script-types)
2223
* [Non-interactive Perl Scripts](#non-interactive-perl-scripts)
2324
* [Interactive Perl Scripts](#interactive-perl-scripts)
@@ -153,6 +154,11 @@ The following compile-time variable can tighten further the security of PEB.
153154

154155
PEB can also use any Perl on PATH.
155156

157+
## Preparing a Perl Distribution for PEB
158+
Sometimes it is important to minimize the size of the relocatable (or portable) Perl distribution used for a PEB-based application. ``{PEB_binary_directory}/sdk/compactor.pl`` script is one solution to this problem. It scans all Perl scripts in the ``{PEB_binary_directory}/resources/app`` directory, finds all their dependencies and copies them in a new ``{PEB_binary_directory}/perl/lib`` folder; a new ``{PEB_binary_directory}/perl/bin`` is also created. The original ``bin`` and ``lib`` folders are saved as ``{PEB_binary_directory}/perl/bin-original`` and ``{PEB_binary_directory}/perl/lib-original`` respectively. ``bin-original`` and ``lib-original`` directories should be manually archived or removed.
159+
``compactor.pl`` should be started using ``{PEB_binary_directory}/compactor.sh`` on a Linux and Mac machines and ``{PEB_binary_directory}/compactor.cmd`` on a Windows machine to ensure that only the Perl distribution used by PEB is going to start ``compactor.pl``. This is necessary to avoid dependency mismatches with any other Perl on PATH.
160+
``compactor.pl`` relies on ``Module::ScanDeps`` and ``File::Copy::Recursive`` CPAN modules, which are located in the ``{PEB_binary_directory}/sdk/lib`` folder.
161+
156162
## Supported Perl Script Types
157163
PEB recognizes four main types of local Perl scripts and does not impose execution timeouts on them:
158164
* [**non-interactive scripts**](#non-interactive-perl-scripts)

compactor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if [ -e "$relocatable_perl" ]; then
77
$relocatable_perl ./sdk/compactor.pl
88
else
99
printf "\nRelocatable Perl is not found for this copy of Perl Executing Browser.\n"
10-
fi
10+
fi

sdk/compactor.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
#! ././perl/bin/perl
12

23
use strict;
34
use warnings;
45
use 5.010;
56

6-
# Core modules:
77
use Config;
88
use Cwd qw (getcwd);
99
use File::Basename qw (basename);

0 commit comments

Comments
 (0)