2015-07-29 12:14:50 +01:00
|
|
|
gappsWrapperArgs=()
|
|
|
|
|
2015-07-30 11:33:52 +01:00
|
|
|
find_gio_modules() {
|
|
|
|
if [ -d "$1"/lib/gio/modules ] && [ -n "$(ls -A $1/lib/gio/modules)" ] ; then
|
|
|
|
gappsWrapperArgs+=(--prefix GIO_EXTRA_MODULES : "$1/lib/gio/modules")
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
envHooks+=(find_gio_modules)
|
|
|
|
|
2015-11-09 14:38:26 +00:00
|
|
|
# Note: $gappsWrapperArgs still gets defined even if $dontWrapGApps is set.
|
2015-07-29 12:14:50 +01:00
|
|
|
wrapGAppsHook() {
|
2015-11-09 14:38:26 +00:00
|
|
|
# guard against running multiple times (e.g. due to propagation)
|
2016-03-17 19:57:46 +00:00
|
|
|
[ -z "$wrapGAppsHookHasRun" ] || return 0
|
2015-11-09 14:38:26 +00:00
|
|
|
wrapGAppsHookHasRun=1
|
2015-11-09 14:18:13 +00:00
|
|
|
|
2015-07-29 12:14:50 +01:00
|
|
|
if [ -n "$GDK_PIXBUF_MODULE_FILE" ]; then
|
|
|
|
gappsWrapperArgs+=(--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE")
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$XDG_ICON_DIRS" ]; then
|
|
|
|
gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS")
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -n "$GSETTINGS_SCHEMAS_PATH" ]; then
|
|
|
|
gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH")
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -d "$prefix/share" ]; then
|
2015-08-12 04:37:36 +01:00
|
|
|
gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$prefix/share")
|
2015-07-29 12:14:50 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
for v in $wrapPrefixVariables GST_PLUGIN_SYSTEM_PATH_1_0 GI_TYPELIB_PATH GRL_PLUGIN_PATH; do
|
|
|
|
eval local dummy="\$$v"
|
|
|
|
gappsWrapperArgs+=(--prefix $v : "$dummy")
|
|
|
|
done
|
|
|
|
|
2017-04-16 03:50:13 +01:00
|
|
|
if [[ -z "$dontWrapGApps" ]]; then
|
|
|
|
targetDirs=( "${prefix}/bin" "${prefix}/libexec" )
|
|
|
|
for targetDir in "${targetDirs[@]}"; do
|
|
|
|
if [[ -d "${targetDir}" ]]; then
|
2017-07-30 03:15:26 +01:00
|
|
|
find -L "${targetDir}" -type f -executable -print0 \
|
2017-04-16 03:50:13 +01:00
|
|
|
| while IFS= read -r -d '' file; do
|
|
|
|
echo "Wrapping program ${file}"
|
|
|
|
wrapProgram "${file}" "${gappsWrapperArgs[@]}"
|
|
|
|
done
|
|
|
|
fi
|
2015-11-09 14:38:26 +00:00
|
|
|
done
|
|
|
|
fi
|
2015-07-29 12:14:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fixupOutputHooks+=(wrapGAppsHook)
|