wrapGAppsHook: add wrapGApp helper

This commit is contained in:
Jan Tojnar 2019-09-10 07:11:53 +02:00
parent 1716d62f63
commit 3c1563f49d
No known key found for this signature in database
GPG key ID: 7FAB2A15F7A607A4
2 changed files with 18 additions and 2 deletions

View file

@ -258,6 +258,16 @@ mkDerivation {
</para>
</listitem>
</varlistentry>
<varlistentry xml:id="ssec-gnome-common-issues-weird-location">
<term>
I need to wrap a binary outside <filename>bin</filename> and <filename>libexec</filename> directories.
</term>
<listitem>
<para>
You can manually trigger the wrapping with <function>wrapGApp</function> in <literal>preFixup</literal> phase. It takes a path to a program as a first argument; the remaining arguments are passed directly to <function xlink:href="#fun-wrapProgram">wrapProgram</function> function.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
</section>

View file

@ -8,6 +8,12 @@ find_gio_modules() {
addEnvHooks "$targetOffset" find_gio_modules
wrapGApp() {
local program="$1"
shift 1
wrapProgram "$program" "${gappsWrapperArgs[@]}" "$@"
}
# Note: $gappsWrapperArgs still gets defined even if $dontWrapGApps is set.
wrapGAppsHook() {
# guard against running multiple times (e.g. due to propagation)
@ -52,7 +58,7 @@ wrapGAppsHook() {
find "${targetDir}" -type f -executable -print0 \
| while IFS= read -r -d '' file; do
echo "Wrapping program '${file}'"
wrapProgram "${file}" "${gappsWrapperArgs[@]}"
wrapGApp "${file}"
done
fi
done
@ -71,7 +77,7 @@ wrapGAppsHook() {
fi
done
echo "Wrapping link: '$linkPath'"
wrapProgram "${linkPath}" "${gappsWrapperArgs[@]}"
wrapGApp "${linkPath}"
done
fi
fi