2024-03-27 11:20:25 -07:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2025-04-05 17:51:58 -07:00
|
|
|
if [ -z "$APPDIR" ]; then
|
2026-01-29 07:33:08 -08:00
|
|
|
export APPDIR="$(dirname -- "$(readlink -f -- "${0}")")"
|
2025-04-10 03:27:36 -07:00
|
|
|
echo "Running without type2-runtime. AppDir is $APPDIR"
|
2025-04-05 17:51:58 -07:00
|
|
|
fi
|
2024-03-27 11:20:25 -07:00
|
|
|
|
2024-05-06 18:32:32 -07:00
|
|
|
|
2026-02-09 15:15:11 -08:00
|
|
|
## Minimum runtime paths. See: #13527, #13603 and #15807
|
2025-08-01 06:54:38 -07:00
|
|
|
export PATH="${APPDIR}/usr/bin/:$PATH"
|
2025-04-12 15:20:29 -07:00
|
|
|
unset LD_PRELOAD
|
2026-02-09 15:15:11 -08:00
|
|
|
for lib in "${APPDIR}"/usr/lib*/*.so* "${APPDIR}"/usr/lib/*linux-gnu/*.so*; do
|
|
|
|
|
case "$lib" in
|
|
|
|
|
*" "*)
|
|
|
|
|
#LD does not support spaces in LD_PRELOAD
|
|
|
|
|
break
|
|
|
|
|
;;
|
|
|
|
|
*libbabl*|*libgegl*|*libgimp*)
|
|
|
|
|
export LD_PRELOAD="$LD_PRELOAD${LD_PRELOAD:+:}$lib"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
done
|
2025-04-07 05:23:02 -07:00
|
|
|
unset LD_LIBRARY_PATH
|
2025-09-27 15:52:25 -07:00
|
|
|
export XDG_DATA_DIRS="${APPDIR}/usr/share/:$XDG_DATA_DIRS"
|
2024-08-31 06:58:01 -07:00
|
|
|
|
2024-03-27 11:20:25 -07:00
|
|
|
|
2025-04-05 17:51:58 -07:00
|
|
|
## Other needed runtime paths (added by 3_dist-gimp-goappimage.sh)
|
2025-12-11 06:02:21 -08:00
|
|
|
### We need to run on APPDIR due to the bundled LD linux interpreter so
|
|
|
|
|
### relative file paths on CLI are converted to absolute (OWD). See: #13636
|
|
|
|
|
export OWD="$PWD"
|
2025-04-05 17:51:58 -07:00
|
|
|
cd "$APPDIR"
|
2025-12-11 06:02:21 -08:00
|
|
|
i="$#"
|
|
|
|
|
while [ "$i" -gt 0 ]; do
|
|
|
|
|
arg=$1
|
|
|
|
|
# if arg does NOT start with slash or dash, then test for existence from $OWD
|
|
|
|
|
if [ "$arg" = "${arg#/}" -a "$arg" = "${arg#-}" -a -e "$OWD/$arg" ] ; then
|
|
|
|
|
arg="$OWD/$arg"
|
|
|
|
|
fi
|
|
|
|
|
set -- "$@" "$arg"
|
|
|
|
|
shift
|
|
|
|
|
i=$(($i-1))
|
|
|
|
|
done
|