wrap-gapps-hook: also wrap symlinks to executables

Some programs store the executable in a different place and link it
from the `bin` directory. For example, Polari links `$out/bin/polari`
to `$out/share/polari/org.gnome.Polari`. `wrapGAppsHook` did not follow
symlinks so it was not able to wrap Polari, making it unable to access
GObject introspection definitions required for running the program.

I made the wrapping script follow symlinks to fix this corner case.
This commit is contained in:
Jan Tojnar 2017-07-30 04:15:26 +02:00
parent d4ef5ac0e9
commit 0a142d3112
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -39,7 +39,7 @@ wrapGAppsHook() {
targetDirs=( "${prefix}/bin" "${prefix}/libexec" )
for targetDir in "${targetDirs[@]}"; do
if [[ -d "${targetDir}" ]]; then
find "${targetDir}" -type f -executable -print0 \
find -L "${targetDir}" -type f -executable -print0 \
| while IFS= read -r -d '' file; do
echo "Wrapping program ${file}"
wrapProgram "${file}" "${gappsWrapperArgs[@]}"