From 7712700b18f5c5f3e390af679fddb2b5afa4a95f Mon Sep 17 00:00:00 2001 From: Lin Jian Date: Tue, 18 Feb 2025 19:11:42 +0800 Subject: [PATCH] wrapQtAppsHook: actually use makeQtWrapper for symlinks Since -f implies -h, -h needs to be checked first. --- .../libraries/qt-5/hooks/wrap-qt-apps-hook.sh | 10 +++++----- .../libraries/qt-6/hooks/wrap-qt-apps-hook.sh | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) 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