|
| 1 | +# Perl Executing Browser - AppImage Support |
| 2 | + |
| 3 | +## PEB AppImage Maker |
| 4 | + |
| 5 | +PEB or any PEB-based application can be easily packed as a 64-bit single-file Linux [AppImage](https://appimage.org/) executable by the [PEB AppImage Maker](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/appimage-maker.sh) script, which has two modes of operation: |
| 6 | + |
| 7 | +* packing a Perl application together with a PEB executable, Qt libraries and a relocatable Perl distribution: |
| 8 | + |
| 9 | + ```bash |
| 10 | + ./appimage-maker.sh --include-resources |
| 11 | + ``` |
| 12 | + |
| 13 | + In this case, the PEB AppImage Maker invokes the [Perl Distribution Compactor](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/compactor.pl), which finds all dependencies of all Perl scripts in the ``{PEB_executable_directory}/resources/app`` directory and copies only the necessary Perl modules. |
| 14 | + |
| 15 | + 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. |
| 16 | + |
| 17 | +* packing only a PEB executable and its Qt libraries: |
| 18 | + |
| 19 | + ```bash |
| 20 | + ./appimage-maker.sh --no-resources |
| 21 | + ``` |
| 22 | + |
| 23 | + In this case, a PEB executable from an AppImage will try to find its application files and folders in the directory of the AppImage. |
| 24 | + |
| 25 | +In both modes of operation, the PEB AppImage uses the [linuxdeployqt](https://github.com/probonopd/linuxdeployqt/releases/) tool to detect all Qt dependencies of PEB and build the final image. |
| 26 | + |
| 27 | +The PEB AppImage Maker script must be started from the ``{PEB_executable_directory}/sdk`` directory. |
| 28 | + |
| 29 | +## PEB AppImage Configuration Files |
| 30 | + |
| 31 | +``{PEB_executable_directory}/resources/app/appimage/{application_name}.desktop`` |
| 32 | +``{PEB_executable_directory}/resources/app/appimage/{application_name}.appdata.xml`` |
| 33 | + |
| 34 | +``{PEB_executable_directory}/resources/app/{application_name}.desktop`` |
| 35 | +is mandatory for any PEB-based application which will be packed by the PEB AppImage Maker. |
| 36 | +A minimal example of а ``.desktop`` file is available [here](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/peb-demo.desktop). |
| 37 | +``Icon=app`` in the ``.desktop`` file must not be changed for the proper display of the application icon. |
| 38 | +All registered categories in a ``.desktop`` file are available [here](https://standards.freedesktop.org/menu-spec/latest/apa.html). |
| 39 | +Any ``.desktop`` file can be validated using the ``desktop-file-validate`` tool from the ``desktop-file-utils`` package in all major Linux distributions. |
| 40 | + |
| 41 | +The [AppStream Generator](http://output.jsbin.com/qoqukof) of [probonopd](https://github.com/probonopd) is the recommended tool for generating AppStream ``.appdata.xml`` files for PEB-based applications. An example AppStream file is available [here](https://github.com/ddmitov/perl-executing-browser/blob/master/resources/app/peb-demo.appdata.xml). An AppStream file is not mandatory, but is highly recommended. |
| 42 | + |
| 43 | +Both PEB AppImage configuration files are put on their places in the AppImage directory tree structure by the [PEB AppImage Maker](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/appimage-maker.sh) script. |
| 44 | + |
| 45 | +## PEB AppImage Builder Docker Container |
| 46 | + |
| 47 | +An easy building environment for PEB AppImage executables is the [PEB AppImage Builder Docker Container](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/Dockerfile). |
| 48 | +To build it, type the following command in the PEB project root directory (the directory of the README.md): |
| 49 | + |
| 50 | +```bash |
| 51 | +sudo docker build -t peb-appimage-builder . |
| 52 | +``` |
| 53 | + |
| 54 | +To start the PEB AppImage Builder Docker Container, type the following command in the PEB project root directory: |
| 55 | + |
| 56 | +```bash |
| 57 | +sudo docker container run --rm -it -v $(pwd):/opt --user $(id -u):$(id -g) peb-appimage-builder |
| 58 | +``` |
| 59 | + |
| 60 | +When PEB AppImage Builder Docker Container is running, type: |
| 61 | + |
| 62 | +```bash |
| 63 | +cd /opt/sdk |
| 64 | +``` |
| 65 | + |
| 66 | +To start the PEB AppImage Maker, type either: |
| 67 | + |
| 68 | +```bash |
| 69 | +./appimage-maker.sh --no-resources |
| 70 | +``` |
| 71 | + |
| 72 | +or |
| 73 | + |
| 74 | +```bash |
| 75 | +./appimage-maker.sh --include-resources |
| 76 | +``` |
| 77 | + |
| 78 | +To stop the PEB AppImage Builder Docker Container when AppImage building is complete: |
| 79 | +<kbd>Ctrl</kbd> + <kbd>D</kbd> |
| 80 | + |
| 81 | +## AppImageHub |
| 82 | + |
| 83 | +Perl Executing Browser is also listed at the [AppImageHub](https://appimage.github.io/perl-executing-browser/). |
| 84 | +Any authors of PEB-based Linux applications are encouraged to list their AppImage executables in the same manner. |
0 commit comments