Skip to content

Commit 4fb1133

Browse files
committed
AppImage Builder Docker container
1 parent e2a74ac commit 4fb1133

File tree

8 files changed

+89
-26
lines changed

8 files changed

+89
-26
lines changed

CREDITS.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,13 @@ https://specifications.freedesktop.org/desktop-entry-spec/1.1/apa.html
258258
https://github.com/probonopd/linuxdeployqt
259259
http://output.jsbin.com/qoqukof
260260

261+
## Docker Containers
262+
263+
https://perlmaven.com/dancer-in-docker
264+
https://github.com/AppImage/AppImageKit/wiki/FUSE
265+
https://medium.com/redbubble/running-a-docker-container-as-a-non-root-user-7d2e00f8ee15
266+
https://docs.docker.com/engine/reference/builder/
267+
261268
## Mac
262269

263270
http://leonid.shevtsov.me/en/how-to-create-icns-icons-for-os-x
@@ -266,9 +273,10 @@ http://leonid.shevtsov.me/en/how-to-create-icns-icons-for-os-x
266273

267274
https://superuser.com/questions/188058/which-ports-are-considered-unsafe-on-chrome
268275

269-
## GitHub
276+
## Git and GitHub
270277

271278
https://github.com/github/linguist#overrides
279+
https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-commits-in-git
272280

273281
## Travis CI
274282

doc/PACKAGING.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,35 @@ PEB or any PEB-based application can be easily packed as a 64-bit single-file Li
3030

3131
In both modes of operation, the [AppImage Maker](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/appimage-maker.sh) uses the [linuxdeployqt](https://github.com/probonopd/linuxdeployqt/releases/) tool to detect all Qt dependencies of PEB and build the final image.
3232

33-
[AppImage Maker](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/appimage-maker.sh) script must be started from the ``{PEB_executable_directory}/sdk`` directory.
33+
[AppImage Maker](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/appimage-maker.sh) script must be started from the ``{PEB_executable_directory}/sdk`` directory.
34+
35+
An easy building environment for PEB AppImage executables is the provided [AppImage Builder Docker container](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/Dockerfile).
36+
To build it type the following command from the ``{PEB_executable_directory}/sdk`` directory:
37+
38+
```bash
39+
sudo docker build -t appimage-builder .
40+
```
41+
42+
To start the AppImage Builder container type the following command from the ``{PEB_executable_directory}/sdk`` directory:
43+
44+
```bash
45+
sudo docker container run --rm -it -v $(pwd)/..:/opt --user $(id -u):$(id -g) appimage-builder
46+
```
47+
48+
When [AppImage Builder Docker container](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/Dockerfile) is running, type:
49+
50+
```bash
51+
cd /opt/sdk
52+
```
53+
54+
To start the [AppImage Maker](https://github.com/ddmitov/perl-executing-browser/blob/master/sdk/appimage-maker.sh), type either:
55+
56+
```bash
57+
appimage-maker.sh --no-resources
58+
```
59+
60+
or
61+
62+
```bash
63+
appimage-maker.sh --include-resources
64+
```

sdk/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM ubuntu:14.04
2+
RUN apt-get update && \
3+
apt-get upgrade -y && \
4+
apt-get install -y wget && \
5+
apt-get install -y build-essential && \
6+
apt-get install -y software-properties-common && \
7+
add-apt-repository --yes ppa:ubuntu-sdk-team/ppa && \
8+
apt update -qq && \
9+
apt-get install -y qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev && \
10+
apt-get install -y qt5-default qttools5-dev-tools && \
11+
echo "DONE"

sdk/appimage-maker.sh

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ for i in "$@"
2525
done
2626

2727
if [ $mode == "none" ]; then
28-
printf "\\nappimage-maker --include-resources\\n"
29-
printf "\\nto pack a PEB-based application or\\n"
30-
printf "\\nappimage-maker --no-resources\\n"
31-
printf "\\nto pack only a PEB executable\\n"
28+
printf "appimage-maker --include-resources\\n"
29+
printf " to pack a PEB-based application or\\n"
30+
printf "appimage-maker --no-resources\\n"
31+
printf " to pack only a PEB executable\\n"
3232
exit 1
3333
fi
3434

@@ -59,9 +59,11 @@ if [ $mode == "no-resources" ]; then
5959
mkdir -p "$(pwd)/peb.app/usr/share/metainfo"
6060
cp "$(pwd)/sdk/appimage/peb.appdata.xml" "$(pwd)/peb.app/usr/share/metainfo/peb.appdata.xml"
6161

62-
"$(pwd)/$linuxdeployqt" "$(pwd)/peb.app/peb" -qmake='qmake -qt=qt5' -no-translations -appimage
62+
"$(pwd)/$linuxdeployqt" "--appimage-extract"
63+
"$(pwd)/squashfs-root/AppRun" "$(pwd)/peb.app/peb" -qmake='qmake -qt=qt5' -no-translations -appimage
6364

6465
rm -rf "$(pwd)/peb.app"
66+
rm -rf "$(pwd)/squashfs-root"
6567
fi
6668

6769
if [ $mode == "include-resources" ]; then
@@ -71,37 +73,39 @@ if [ $mode == "include-resources" ]; then
7173
exit 1
7274
fi
7375

74-
package_name="$(basename "$package_desktop_file" .desktop)"
76+
appimage_name="$(basename "$package_desktop_file" .desktop)"
7577

76-
rm -rf "$(pwd)/$package_name.app"
77-
mkdir "$(pwd)/$package_name.app"
78+
rm -rf "$(pwd)/$appimage_name.app"
79+
mkdir "$(pwd)/$appimage_name.app"
7880

79-
cp -f "$(pwd)/peb" "$(pwd)/$package_name.app/$package_name"
80-
cp -f "$package_desktop_file" "$(pwd)/$package_name.app/$package_name.desktop"
81-
cp -r "$(pwd)/resources" "$(pwd)/$package_name.app/resources"
81+
cp -f "$(pwd)/peb" "$(pwd)/$appimage_name.app/$appimage_name"
82+
cp -f "$package_desktop_file" "$(pwd)/$appimage_name.app/$appimage_name.desktop"
83+
cp -r "$(pwd)/resources" "$(pwd)/$appimage_name.app/resources"
8284

8385
if [ -e "$(pwd)/resources/app.png" ]; then
84-
cp -f "$(pwd)/resources/app.png" "$(pwd)/$package_name.app/app.png"
86+
cp -f "$(pwd)/resources/app.png" "$(pwd)/$appimage_name.app/app.png"
8587
fi
8688

87-
if [ -e "$(pwd)/resources/appimage/$package_name.appdata.xml" ]; then
88-
mkdir -p "$(pwd)/$package_name.app/usr/share/metainfo"
89-
cp -f "$(pwd)/resources/appimage/$package_name.appdata.xml" "$(pwd)/$package_name.app/usr/share/metainfo/$package_name.appdata.xml"
89+
if [ -e "$(pwd)/resources/appimage/$appimage_name.appdata.xml" ]; then
90+
mkdir -p "$(pwd)/$appimage_name.app/usr/share/metainfo"
91+
cp -f "$(pwd)/resources/appimage/$appimage_name.appdata.xml" "$(pwd)/$appimage_name.app/usr/share/metainfo/$appimage_name.appdata.xml"
9092
fi
9193

92-
rm -rf "$(pwd)/$package_name.app/resources/appimage"
94+
rm -rf "$(pwd)/$appimage_name.app/resources/appimage"
9395

9496
relocatable_perl="$(pwd)/resources/app/perl/bin/perl"
9597
compactor_script="$(pwd)/sdk/compactor.pl"
9698

9799
if [ -e "$relocatable_perl" ]; then
98100
printf "\\nGoing to compact the relocatable Perl for this copy of Perl Executing Browser.\\n"
99-
"$relocatable_perl" "$compactor_script" "--AppImage"
101+
"$relocatable_perl" "$compactor_script" "--appimage=$appimage_name"
100102
else
101103
printf "\\nRelocatable Perl is not found for this copy of Perl Executing Browser.\\n"
102104
fi
103105

104-
"$(pwd)/$linuxdeployqt" "$(pwd)/$package_name.app/$package_name" -qmake='qmake -qt=qt5' -no-translations -appimage
106+
"$(pwd)/$linuxdeployqt" "--appimage-extract"
107+
"$(pwd)/squashfs-root/AppRun" "$(pwd)/$appimage_name.app/$appimage_name" -qmake='qmake -qt=qt5' -no-translations -appimage
105108

106-
rm -rf "$(pwd)/$package_name.app"
109+
rm -rf "$(pwd)/squashfs-root"
110+
rm -rf "$(pwd)/$appimage_name.app"
107111
fi

sdk/compactor.pl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use File::Spec;
1111
use File::Spec::Functions qw(catdir);
1212
use FindBin qw($Bin);
13+
use Getopt::Long qw(GetOptions);
1314
use lib catdir($Bin, "lib");
1415

1516
# Non-core CPAN modules:
@@ -18,7 +19,13 @@
1819
use File::Copy::Recursive qw(fcopy);
1920
use Module::ScanDeps;
2021

21-
print "\nPerl Distribution Compactor for Perl Executing Browser version 0.1.\n\n";
22+
print "\nPerl Distribution Compactor for Perl Executing Browser\n\n";
23+
24+
# Command-line argument:
25+
my $appimage_name = "";
26+
GetOptions(
27+
"appimage_name=s" => \$appimage_name
28+
);
2229

2330
# Directory paths:
2431
my $root = getcwd;
@@ -30,9 +37,11 @@
3037
my $bin_compacted;
3138
my $lib_compacted;
3239

33-
if ($ARGV[0] and $ARGV[0] =~ /^--AppImage$/) {
34-
$bin_compacted = catdir($root, "peb.app", "resources", "app", "perl", "bin");
35-
$lib_compacted = catdir($root, "peb.app", "resources", "app", "perl", "lib");
40+
if (length($appimage_name) > 0) {
41+
$bin_compacted = catdir(
42+
$root, $appimage_name.".app", "resources", "app", "perl", "bin");
43+
$lib_compacted = catdir(
44+
$root, $appimage_name.".app", "resources", "app", "perl", "lib");
3645
} else {
3746
$bin_compacted = catdir($perl_directory, "bin-compacted");
3847
$lib_compacted = catdir($perl_directory, "lib-compacted");
@@ -87,7 +96,7 @@
8796
}
8897

8998
# Rename Perl directories:
90-
if ($ARGV[0] and $ARGV[0] !~ /^--AppImage$/) {
99+
if (length($appimage_name) == 0) {
91100
rename $bin_original, catdir($perl_directory, "bin-original");
92101
rename $bin_compacted, catdir($perl_directory, "bin");
93102

src/resources/html/error.html

100755100644
File mode changed.

src/resources/icon/camel.icns

100755100644
File mode changed.

src/resources/icon/camel.ico

100755100644
File mode changed.

0 commit comments

Comments
 (0)