Skip to content

Commit 3f926a3

Browse files
committed
better AppImage support
1 parent 2adebf2 commit 3f926a3

File tree

5 files changed

+28
-19
lines changed

5 files changed

+28
-19
lines changed

CREDITS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ https://stackoverflow.com/questions/4181703/how-to-concatenate-string-variables-
217217
https://stackoverflow.com/questions/638975/how-do-i-tell-if-a-regular-file-does-not-exist-in-bash
218218
https://stackoverflow.com/questions/10319652/check-if-a-file-is-executable
219219
https://stackoverflow.com/questions/10376206/what-is-the-preferred-bash-shebang
220+
https://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash
220221

221222
https://unix.stackexchange.com/questions/312280/split-string-by-delimiter-and-get-n-th-element
222223
https://unix.stackexchange.com/questions/12453/how-to-determine-linux-kernel-architecture

doc/SETTINGS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Perl scripts running for a long time should have ``$|=1;`` among their first lin
108108
## Interactive Perl Scripts
109109
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 a unique name. Interactive scripts must also have the ``scriptExitCommand`` object property. The ``scriptExitConfirmation`` object property is not mandatory, but highly recommended for a quick shutdown of PEB.
110110

111-
Please note that interactive Perl scripts are not supported by all Windows builds of PEB.
111+
Please note that interactive Perl scripts are not supported on any Windows build of PEB.
112112

113113
Please also note that if a PEB instance crashes, it will leave its interactive scripts as zombie processes and they will start consuming large amounts of memory! Exhaustive stability testing has to be done when interactive scripts are selected for use with PEB! Even during normal operation interactive scripts use more memory than non-interactive scripts and their use should be carefully considered.
114114

sdk/appimage-maker.sh

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,29 @@ else
2424
fi
2525

2626
cp ./sdk/peb.desktop ./peb.app/peb.desktop
27-
cp ./resources/app.png ./peb.app/peb.png
27+
cp ./sdk/camel.png ./peb.app/peb.png
2828
mkdir -p ./peb.app/usr/share
2929
cp ./sdk/metainfo ./peb.app/usr/share/metainfo
3030

31-
cp -rf ./resources ./peb.app/resources
32-
33-
relocatable_perl="$(pwd)/perl/bin/perl"
34-
compactor_script="$(pwd)/sdk/compactor.pl"
35-
36-
if [ -e "$relocatable_perl" ]; then
37-
printf "\\nGoing to compact the relocatable Perl for this copy of Perl Executing Browser.\\n"
38-
"$relocatable_perl" "$compactor_script" "--AppImage"
39-
else
40-
printf "\\nRelocatable Perl is not found for this copy of Perl Executing Browser.\\n"
41-
fi
31+
for i in "$@"
32+
do
33+
case $i in
34+
--include-resources)
35+
cp -rf ./resources ./peb.app/resources
36+
cp ./resources/app.png ./peb.app/peb.png
37+
38+
relocatable_perl="$(pwd)/perl/bin/perl"
39+
compactor_script="$(pwd)/sdk/compactor.pl"
40+
41+
if [ -e "$relocatable_perl" ]; then
42+
printf "\\nGoing to compact the relocatable Perl for this copy of Perl Executing Browser.\\n"
43+
"$relocatable_perl" "$compactor_script" "--AppImage"
44+
else
45+
printf "\\nRelocatable Perl is not found for this copy of Perl Executing Browser.\\n"
46+
fi
47+
;;
48+
esac
49+
done
4250

4351
linuxdeployqt="linuxdeployqt-continuous-$(arch).AppImage"
4452

sdk/camel.png

552 Bytes
Loading

src/main.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ int main(int argc, char **argv)
132132
QString perlDirectory = browserDirectory + "/perl";
133133

134134
#ifdef Q_OS_LINUX
135-
// Embedded in an AppImage 'perl' directory
136-
// takes precedence over external 'perl' directory:
137-
if (QDir(appImageDirectory + "/perl").exists()) {
135+
// External 'perl' directory, if any,
136+
// takes precedence over embedded in an AppImage 'perl' directory:
137+
if (appImageDirectory.length() > 0) {
138138
perlDirectory = appImageDirectory + "/perl";
139139
}
140140
#endif
@@ -180,9 +180,9 @@ int main(int argc, char **argv)
180180
QString resourcesDirectory = browserDirectory + "/resources";
181181

182182
#ifdef Q_OS_LINUX
183-
// Embedded in an AppImage 'resources' directory
184-
// takes precedence over external 'resources' directory:
185-
if (QDir(appImageDirectory + "/resources").exists()) {
183+
// External 'resources' directory, if any,
184+
// takes precedence over embedded in an AppImage 'resources' directory:
185+
if (appImageDirectory.length() > 0) {
186186
resourcesDirectory = appImageDirectory + "/resources";
187187
}
188188
#endif

0 commit comments

Comments
 (0)