-
Notifications
You must be signed in to change notification settings - Fork 0
/
linuxdeploy-plugin-gtk3.sh
executable file
·69 lines (59 loc) · 1.56 KB
/
linuxdeploy-plugin-gtk3.sh
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#! /bin/bash
# abort on all errors
set -e
script=$(readlink -f "$0")
show_usage() {
echo "Usage: $script --appdir <path to AppDir>"
echo
echo "Bundles resources for applications that use Gtk 2 or 3 into an AppDir"
}
APPDIR=
while [ "$1" != "" ]; do
case "$1" in
--plugin-api-version)
echo "0"
exit 0
;;
--appdir)
APPDIR="$2"
shift
shift
;;
--help)
show_usage
exit 0
;;
*)
echo "Invalid argument: $1"
echo
show_usage
exit 1
;;
esac
done
if [ "$APPDIR" == "" ]; then
show_usage
exit 1
fi
mkdir -p "$APPDIR"
echo "Compiling GLib schemas"
glib-compile-schemas "$APPDIR/usr/share/glib-2.0/schemas"
HOOKSDIR="$APPDIR/apprun-hooks"
HOOKFILE="$HOOKSDIR/linuxdeploy-plugin-gtk3.sh"
mkdir -p "$HOOKSDIR"
cat > "$HOOKFILE" <<\EOF
export APPDIR="${APPDIR:-"$(dirname "$(realpath "$0")")"}"
export PATH="${APPDIR}"/usr/bin/:"${PATH}"
export LD_LIBRARY_PATH="${APPDIR}"/usr/lib/:"${LD_LIBRARY_PATH}"
export GSETTINGS_SCHEMA_DIR="${APPDIR}/usr/share/glib-2.0/schemas"
EOF
echo "Excluding libraries"
rm -vf $APPDIR/usr/lib/libatk-1.0.so.0
rm -vf $APPDIR/usr/lib/libatk-bridge-2.0.so.0
rm -vf $APPDIR/usr/lib/libcairo.so.2
rm -vf $APPDIR/usr/lib/libcairo-gobject.so.2
rm -vf $APPDIR/usr/lib/libdbus-1.so.3
rm -vf $APPDIR/usr/lib/libepoxy.so.0
rm -vf $APPDIR/usr/lib/libgdk-3.so.0
rm -vf $APPDIR/usr/lib/libgmodule-2.0.so.0
rm -vf $APPDIR/usr/lib/libgtk-3.so.0