1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh -x
# Default repack script (used if a special script for target product is missed)
# It will run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"
PRODUCT="$3"
PKG="$4"
. $(dirname $0)/common.sh
# detect requires by libs (skip Full AppImage bundle)
if [ ! -f "$BUILDROOT$PRODUCTDIR/.bundle.yml" ] ; then
add_libs_requires
fi
# FIXME: hack for nonstandart name
pd="$(echo $BUILDROOT/opt/*)"
[ -d "$pd" ] && PRODUCTDIR="/opt/$(basename "$pd")"
if [ -f "$BUILDROOT$PRODUCTDIR/$PRODUCT" ] ; then
add_bin_exec_command
fi
if [ -f $BUILDROOT/usr/share/applications/*.desktop ] ; then
EXEC="$(cat $BUILDROOT/usr/share/applications/*.desktop | grep "^Exec=" | head -n1 | sed -e 's|Exec=||' -e 's| .*||')"
if [ "/usr/bin/$(basename "$EXEC")" = "/usr/bin/$PRODUCT" ] || [ "$EXEC" = "$PRODUCTDIR/$PRODUCT" ] ; then
if [ -x $BUILDROOT/usr/bin/$PRODUCT ] ; then
fix_desktop_file "$EXEC"
fi
fi
fi
# TODO: add product dir detection
if [ -f "$BUILDROOT$PRODUCTDIR/v8_context_snapshot.bin" ] ; then
echo "electron based application detected, adding requires for it ..."
add_electron_deps
fix_chrome_sandbox
fi