-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathAppRun
More file actions
executable file
·66 lines (55 loc) · 2.16 KB
/
AppRun
File metadata and controls
executable file
·66 lines (55 loc) · 2.16 KB
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
#!/bin/bash
APPDIR="$(dirname "$(readlink -f "${0}")")"
export PATH="${APPDIR}/usr/bin:${PATH}"
export GST_PLUGIN_SCANNER="${APPDIR}/usr/lib/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
export GST_PLUGIN_PATH="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH="${APPDIR}/usr/lib/gstreamer-1.0"
export GST_PLUGIN_SYSTEM_PATH_1_0="${APPDIR}/usr/lib/gstreamer-1.0"
export LD_LIBRARY_PATH="${APPDIR}/usr/lib/:${APPDIR}/usr/lib/nss:${LD_LIBRARY_PATH}"
export QT_QPA_PLATFORM="xcb"
# Set Qt WebEngine resources path for V8 snapshot files
# The resources are copied to usr/libexec/ during build
export QTWEBENGINE_RESOURCES_PATH="${APPDIR}/usr/libexec"
# Set up pcsc-lite environment
export PCSC_DRIVERS_DIR="${APPDIR}/usr/lib/pcsc/drivers"
export PCSCLITE_CONFIG_DIR="${APPDIR}/etc/reader.conf.d"
# Start pcscd
# warning: needs to be same as ipcdir in ci/Dockerfile
# https://salsa.debian.org/rousseau/PCSC/-/blob/master/meson.options?ref_type=heads#L36
PCSCD_RUN_DIR="/tmp/pcscd/run"
PCSCD_PIDFILE="/tmp/pcscd/pcscd.pid"
mkdir -p "$(dirname "$PCSCD_PIDFILE")"
# Kill any orphan pcscd from previous runs using saved PID
if [ -f "$PCSCD_PIDFILE" ]; then
OLD_PID=$(cat "$PCSCD_PIDFILE" 2>/dev/null)
if [ -n "$OLD_PID" ] && kill -0 "$OLD_PID" 2>/dev/null; then
echo "Killing orphan pcscd process $OLD_PID"
kill -9 "$OLD_PID" 2>/dev/null || true
sleep 0.2
fi
rm -f "$PCSCD_PIDFILE"
fi
# kill any pcscd processes by name as fallback
pkill -9 pcscd 2>/dev/null || true
sleep 0.1
rm -rf "${PCSCD_RUN_DIR}"
mkdir -p "${PCSCD_RUN_DIR}"
cleanup_pcscd() {
if [ -n "$PCSCD_PID" ] && kill -0 "$PCSCD_PID" 2>/dev/null; then
echo "Killing pcscd process $PCSCD_PID"
kill "$PCSCD_PID" 2>/dev/null
wait "$PCSCD_PID" 2>/dev/null
fi
rm -f "$PCSCD_PIDFILE"
}
trap cleanup_pcscd EXIT TERM INT
echo "starting pcscd with ${APPDIR}/usr/bin/pcscd --foreground --auto-exit &"
"${APPDIR}/usr/bin/pcscd" --foreground --auto-exit &
PCSCD_PID=$!
echo "$PCSCD_PID" >"$PCSCD_PIDFILE"
DEFAULT_LANG=en_US.UTF-8
if [[ "$LANG" == "C.UTF-8" ]]; then
export LANG=$DEFAULT_LANG
fi
exec "${APPDIR}/usr/bin/nim_status_client" "$@"