You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimizing the size of a relocatable (or portable) Perl distribution used by a PEB-based application is vital for reducing the size of its distribution package. [Perl Distribution Compactor](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/compactor.pl) is one solution for this problem. It finds all dependencies of all Perl scripts run by PEB and copies them in a new ``{PEB_executable_directory}/resources/app/perl/lib`` folder. Any unnecessary modules are left behind and the original ``bin`` and ``lib`` folders are saved as ``bin-original`` and ``lib-original``.
6
6
7
7
Perl Distribution Compactor must be started from the ``{PEB_executable_directory}/sdk/lib`` folder using [compactor.sh](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/compactor.sh) on a Linux machine or [compactor.cmd](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/compactor.cmd) on a Windows machine to make sure that only a relocatable Perl distribution is used.
8
8
9
9
Perl Distribution Compactor depends on [Module::ScanDeps](https://metacpan.org/pod/Module::ScanDeps) and [File::Copy::Recursive](https://metacpan.org/pod/File::Copy::Recursive) CPAN modules, which are included in the ``{PEB_executable_directory}/sdk/lib`` directory.
10
10
11
11
## AppImage Support
12
+
12
13
PEB or any PEB-based application can be easily packed as a 64-bit single-file Linux [AppImage](https://appimage.org/) executable by the [AppImage Maker](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/appimage-maker.sh) script, which has two modes of operation:
13
14
14
15
* packing a Perl application together with a PEB executable, its Qt libraries and a relocatable Perl distribution:
The only Linux and Macintosh compile-time requirement of PEB is a Qt development bundle version 5.2 or any later version.
6
6
7
7
Compiling Windows binaries of PEB is subject to the following restrictions:
@@ -13,6 +13,7 @@ Compiling Windows binaries of PEB is subject to the following restrictions:
13
13
* Windows builds of PEB do no support [interactive Perl Scripts](SETTINGS.md#interactive-perl-scripts) with STDIN event loops.
14
14
15
15
Compiled and tested successfully using:
16
+
16
17
*[Qt 5.2.0](http://download.qt.io/archive/qt/5.2/5.2.0/) on 32-bit Debian 7 and 32-bit Windows XP
17
18
*[Qt 5.2.1](http://download.qt.io/archive/qt/5.2/5.2.1/) on 64-bit Ubuntu 14.04 and 64-bit OS X 10.9.1, i5
18
19
*[Qt 5.3.0](http://download.qt.io/archive/qt/5.3/5.3.0/) on 64-bit Lubuntu 14.10
@@ -31,6 +32,7 @@ make
31
32
Please note that PEB builds using the ``QtWebKit`` web engine are single-process applications consuming less memory than PEB builds using the ``QtWebEngine`` which are multiprocess applications.
32
33
33
34
## Compile-Time Settings
35
+
34
36
All compile-time settings require editing the ``src/peb.pro`` project file according to the following instructions.
35
37
36
38
* Updated QtWebKit
@@ -69,6 +71,7 @@ All compile-time settings require editing the ``src/peb.pro`` project file accor
69
71
To make automatically a bundled binary (peb.app) use the [dmg-maker.sh](sdk/dmg-maker.sh) script by Valcho Nedelchev.
70
72
71
73
## Runtime Requirements
74
+
72
75
* Qt 5 libraries.
73
76
74
77
The ``ldd`` Linux command can show all dependencies of a PEB executable.
The executable binary file of the browser, ``peb``, ``peb.app``, ``peb.dmg`` or ``peb.exe`` by default, can be renamed with no restrictions or additional adjustments. It can take the name of the PEB-based application it is going to run. If log files are wanted, they will take the name of the executable file without the filename extension, whatever the name may be.
6
6
7
7
## HTML Page API
@@ -57,6 +57,7 @@ The ``pebSettings`` JavaScript object may have the following properties:
57
57
``String`` displayed in a JavaScript Confirm popup box when the close button is pressed, but unsaved data in local HTML forms is detected. If no ``closeConfirmation`` object property is found, PEB exits immediately.
58
58
59
59
## Perl Scripts API
60
+
60
61
Every Perl script run by PEB has a JavaScript settings object with an arbitrary name and fixed object properties. The name of the JavaScript settings object with a ``.script`` extension forms settings pseudo filename used to start the Perl script.
61
62
62
63
There are three methods to start a local Perl script:
@@ -132,6 +133,7 @@ A JavaScript settings object for a Perl script run by PEB has the following prop
132
133
```
133
134
134
135
## Interactive Perl Scripts
136
+
135
137
Each PEB interactive Perl script must have its own event loop waiting constantly for new data on STDIN for a bidirectional connection with PEB. Many interactive scripts can be started simultaneously in one browser window. One script may be started in many instances, provided that it has a JavaScript settings object with an unique name.
136
138
137
139
Please note that interactive Perl scripts are not supported by the Windows builds of PEB.
@@ -200,6 +202,7 @@ The [index.htm](https://github.com/ddmitov/perl-executing-browser/blob/master/re
200
202
The [interactive.pl](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/perl/interactive.pl) script of the demo package is an example of a Perl interactive script for PEB.
201
203
202
204
## Starting Local Server
205
+
203
206
A [Mojolicious](http://mojolicious.org/) application or other local Perl server can be started by PEB provided that
204
207
a ``{PEB_app_directory}/local-server.json`` file is found instead of ``{PEB_app_directory}/index.html``
205
208
with the following structure:
@@ -234,17 +237,15 @@ with the following structure:
234
237
Privileged ports below or equal to port 1024 are not allowed.
235
238
The following Google Chrome unsafe ports used by various services are also not allowed:
236
239
237
-
```
238
-
2049 - nfs
239
-
3659 - apple-sasl / PasswordServer
240
-
4045 - lockd
241
-
6000 - X11
242
-
6665 - Alternate IRC [Apple addition]
243
-
6666 - Alternate IRC [Apple addition]
244
-
6667 - Standard IRC [Apple addition]
245
-
6668 - Alternate IRC [Apple addition]
246
-
6669 - Alternate IRC [Apple addition]
247
-
```
240
+
2049 - nfs
241
+
3659 - apple-sasl / PasswordServer
242
+
4045 - lockd
243
+
6000 - X11
244
+
6665 - Alternate IRC [Apple addition]
245
+
6666 - Alternate IRC [Apple addition]
246
+
6667 - Standard IRC [Apple addition]
247
+
6668 - Alternate IRC [Apple addition]
248
+
6669 - Alternate IRC [Apple addition]
248
249
249
250
***command-line-arguments**
250
251
``Array`` holding all command-line arguments that have to be passed to a local Perl server
@@ -255,6 +256,7 @@ The ``#PORT#`` keyword within the command-line arguments is substituted with the
255
256
``shutdown_command`` is not needed if the local server uses a WebSocket connection to detect when PEB is disconnected and shut down on its own - see the [Tabula](https://github.com/ddmitov/tabula) application for an example.
256
257
257
258
## Selecting Files and Folders
259
+
258
260
Selecting files or folders with their full paths is performed by clicking a link to a pseudo filename composed of the name of a JavaScript settings object for the wanted dialog and a ``.dialog`` extension.
259
261
260
262
A JavaScript settings object for a filesystem dialog has only two object properties:
0 commit comments