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
Copy file name to clipboardExpand all lines: doc/CONSTANTS.md
+40-39Lines changed: 40 additions & 39 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,74 +10,75 @@ A typical ``{PEB_executable_directory}`` looks like this:
10
10
```bash
11
11
.
12
12
├── {PEB_executable}
13
-
├── perl
14
-
│ ├── bin
15
-
│ │ └── {perl_interpreter}
16
-
│ └── lib
17
-
│ └── {perl_modules}
18
13
└── resources
19
14
├── app
20
15
│ └── index.html
21
-
├── app.png
22
16
├── data
23
17
│ └── {application_data}
24
-
└── logs
25
-
└── {application_logs}
18
+
├── perl
19
+
│ ├── bin
20
+
│ │ └── {perl_interpreter}
21
+
│ └── lib
22
+
│ └── {perl_modules}
23
+
└── app.png
26
24
```
27
25
28
-
***Perl Directory:**
29
-
The Perl directory, if present, must contain the ``bin`` and ``lib`` subdirectories.
30
-
The ``bin`` subdirectory must contain the Perl interpreter.
31
-
The ``lib`` subdirectory must contain all Perl modules used by PEB Perl applications.
32
-
33
-
***Perl Interpreter:**
34
-
Relocatable Perl interpreter, if present, must be located in the ``{PEB_executable_directory}/perl/bin`` folder.
35
-
The Perl interpreter must be named ``perl`` on Linux and Mac machines and ``wperl.exe`` on Windows machines.
36
-
If a relocatable Perl interpreter is not found, PEB will use the first Perl interpreter on PATH.
37
-
38
-
***Perl Modules Directory:**
39
-
All Perl modules found in the ``{PEB_executable_directory}/perl/lib`` folder are accessible via the ``PERL5LIB`` environment variable for all Perl applications executed by PEB.
40
-
41
26
***Resources Directory:**
42
27
The resources directory must contain the ``app`` subdirectory with all necessary application files.
43
-
``data`` subdirectory and the application icon file ``app.png`` are optional.
28
+
``data`` and ``perl`` subdirectories, as well as the application icon file ``app.png`` are optional.
29
+
44
30
The resources directory path must be: ``{PEB_executable_directory}/resources``
45
31
46
32
***Application Directory:**
47
33
All Perl application files must be located within this folder.
48
-
The application directory path must be: ``{PEB_executable_directory}/resources/app``
49
34
PEB application directory is labeled as ``{PEB_app_directory}`` within this documentation.
50
35
By default the working directory of all Perl scripts run by PEB is the application directory.
51
36
37
+
The application directory path must be: ``{PEB_executable_directory}/resources/app``
38
+
52
39
PEB application directory pathname is compatible with the [Electron](http://electron.atom.io/) framework.
53
40
[Epigraphista](https://github.com/ddmitov/epigraphista) is an application which is runnable by both PEB and [Electron](http://electron.atom.io/).
If both files are present, ``index.html`` takes precedence.
61
-
If ``index.html`` is missing, ``local-server.json`` is used if available.
62
-
If both entry files are missing, an error message is displayed.
63
-
64
-
<aname="icon"></a>
65
-
***Icon:**
66
-
A PEB-based application may have its own icon and the pathname must be:
67
-
``{PEB_executable_directory}/resources/app.png``
68
-
69
-
If this file is found during application startup, it is used as the icon of the application and all dialog boxes.
70
-
If this file is not found, the default icon embedded in the resources of the browser binary is used.
47
+
If both files are present, ``index.html`` takes precedence.
48
+
If ``index.html`` is missing, ``local-server.json`` is used if available.
49
+
If both entry files are missing, an error message is displayed.
71
50
72
51
***Data Directory:**
73
52
Data directory may contain any writable files used or produced by a PEB-based application.
53
+
Perl scripts can access this folder using the environment variable ``PEB_DATA_DIR``:
54
+
74
55
The data directory path must be: ``{PEB_executable_directory}/resources/data``
75
-
Perl scripts can access this folder using the environment variable ``PEB_DATA_DIR``:
76
56
77
57
```perl
78
58
my$data_directory = $ENV{'PEB_DATA_DIR'};
79
59
```
80
60
61
+
* **Perl Directory:**
62
+
The Perl directory, if present, must contain the ``bin``and``lib`` subdirectories.
63
+
The ``bin`` subdirectory must contain the Perl interpreter.
64
+
The ``lib`` subdirectory must contain all Perl modules used by PEB Perl applications.
65
+
66
+
* **Perl Interpreter:**
67
+
Relocatable Perl interpreter, if present, must be located in the ``{PEB_executable_directory}/resources/perl/bin`` folder.
68
+
The Perl interpreter must be named ``perl`` on Linux and Mac machines and``wperl.exe`` on Windows machines.
69
+
If a relocatable Perl interpreter is not found, PEB will use the first Perl interpreter on PATH.
70
+
71
+
* **Perl Modules Directory:**
72
+
All Perl modules found in the ``{PEB_executable_directory}/resources/perl/lib`` folder are accessible via the ``PERL5LIB`` environment variable for all Perl applications executed by PEB.
73
+
74
+
<a name="icon"></a>
75
+
* **Icon:**
76
+
A PEB-based application may have its own icon and the pathname must be:
77
+
``{PEB_executable_directory}/resources/app.png``
78
+
79
+
If this file is found during application startup, it is used as the icon of the application and all dialog boxes.
80
+
If this file is not found, the default icon embedded in the resources of the browser binary is used.
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 in the ``{PEB_executable_directory}/resources/app`` directory and copies them in a new ``{PEB_executable_directory}/perl/lib`` folder, a new ``{PEB_executable_directory}/perl/bin`` is also created. Any unnecessary modules are left behind and the original ``bin`` and ``lib`` folders are saved as ``bin-original`` and ``lib-original``.
5
+
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 in the ``{PEB_executable_directory}/resources/app`` directory and copies them in a new ``{PEB_executable_directory}/resources/app/perl/lib`` folder, a new ``{PEB_executable_directory}/resources/app/perl/bin`` is also created. 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 ensure that only the relocatable Perl distribution of PEB is used. This is necessary to avoid dependency mismatches with any other Perl on PATH.
0 commit comments