diff --git a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh index 413368268aa2..42b685e7f792 100644 --- a/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh +++ b/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh @@ -87,16 +87,16 @@ wrapQtAppsHook() { do isELF "$file" || isMachO "$file" || continue - if [ -f "$file" ] - then - echo "wrapping $file" - wrapQtApp "$file" - elif [ -h "$file" ] + if [ -h "$file" ] then target="$(readlink -e "$file")" echo "wrapping $file -> $target" rm "$file" makeQtWrapper "$target" "$file" + elif [ -f "$file" ] + then + echo "wrapping $file" + wrapQtApp "$file" fi done done diff --git a/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh b/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh index 39b8635e264d..b510d1b51405 100644 --- a/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh +++ b/pkgs/development/libraries/qt-6/hooks/wrap-qt-apps-hook.sh @@ -81,14 +81,14 @@ if [[ -z "${__nix_wrapQtAppsHook-}" ]]; then [ -d "$targetDir" ] || continue find "$targetDir" ! -type d -executable -print0 | while IFS= read -r -d '' file; do - if [ -f "$file" ]; then - echo "wrapping $file" - wrapQtApp "$file" - elif [ -h "$file" ]; then + if [ -h "$file" ]; then target="$(readlink -e "$file")" echo "wrapping $file -> $target" rm "$file" makeQtWrapper "$target" "$file" + elif [ -f "$file" ]; then + echo "wrapping $file" + wrapQtApp "$file" fi done done