summary refs log tree commit diff
path: root/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh')
-rw-r--r--pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh b/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh
index 480bcde6c1c29..971b3fb92f9cb 100644
--- a/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh
+++ b/pkgs/build-support/setup-hooks/desktop-to-darwin-bundle.sh
@@ -18,7 +18,7 @@ convertIconTheme() {
     local -r iconName=$3
     local -r theme=${4:-hicolor}
 
-    local -ra iconSizes=(16 32 128 256 512)
+    local -ra iconSizes=(16 32 48 128 256 512)
     local -ra scales=([1]="" [2]="@2")
 
     # Based loosely on the algorithm at:
@@ -31,6 +31,13 @@ convertIconTheme() {
         local scaleSuffix=${scales[$scale]}
         local exactSize=${iconSize}x${iconSize}${scaleSuffix}
 
+        if [[ $exactSize = '48x48@2' ]]; then
+            # macOS does not support a 2x scale variant of 48x48 icons
+            # See: https://en.wikipedia.org/wiki/Apple_Icon_Image_format#Icon_types
+            echo "unsupported"
+            return 0
+        fi
+
         local -a validSizes=(
             ${exactSize}
             $(expr $iconSize + 1)x$(expr $iconSize + 1)${scaleSuffix}
@@ -121,6 +128,8 @@ convertIconTheme() {
                     scalable)
                         synthesizeIcon "${scalableIcon[0]}" "$result" "$iconSize" "$scale" || true
                         ;;
+                    *)
+                        ;;
                 esac
             done
         done