From 4c718b625f844368f08e4910cc9b8b90d839962a Mon Sep 17 00:00:00 2001 From: nessi Date: Wed, 25 Mar 2026 07:16:45 +0100 Subject: [PATCH] refractor: generate missing MacOS specific icns --- desktop-client/package.json | 4 +-- desktop-client/scripts/gen-icns.sh | 33 +++++++++++++++++++ .../src-tauri/tauri.macos.conf.json | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 desktop-client/scripts/gen-icns.sh diff --git a/desktop-client/package.json b/desktop-client/package.json index bd0b55c..8ca38f9 100644 --- a/desktop-client/package.json +++ b/desktop-client/package.json @@ -11,8 +11,8 @@ "helper:windows-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-pc-windows-msvc", "helper:macos-arm64": "bash ./scripts/build-tunnel-helper.sh aarch64-apple-darwin", "helper:macos-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-apple-darwin", - "tauri:build:macos-arm64": "tauri build --target aarch64-apple-darwin --config src-tauri/tauri.macos.conf.json", - "tauri:build:macos-x64": "tauri build --target x86_64-apple-darwin --config src-tauri/tauri.macos.conf.json", + "tauri:build:macos-arm64": "bash ./scripts/gen-icns.sh && tauri build --target aarch64-apple-darwin --config src-tauri/tauri.macos.conf.json", + "tauri:build:macos-x64": "bash ./scripts/gen-icns.sh && tauri build --target x86_64-apple-darwin --config src-tauri/tauri.macos.conf.json", "tauri:build:windows-x64:linux": "chmod +x ./scripts/cargo-xwin ./scripts/clang-cl && PATH=\"$PWD/scripts:$PATH\" XWIN_ARCH=x86_64 tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --config src-tauri/tauri.windows.conf.json" }, "dependencies": { diff --git a/desktop-client/scripts/gen-icns.sh b/desktop-client/scripts/gen-icns.sh new file mode 100644 index 0000000..b462be0 --- /dev/null +++ b/desktop-client/scripts/gen-icns.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +set -eu + +ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)" +ICONS_DIR="${ROOT_DIR}/src-tauri/icons" +ICONSET="${ICONS_DIR}/icon.iconset" +SOURCE="${ICONS_DIR}/icon.png" +OUTPUT="${ICONS_DIR}/icon.icns" + +if [ -f "${OUTPUT}" ]; then + echo "icon.icns already exists, skipping generation." + exit 0 +fi + +echo "Generating ${OUTPUT} from ${SOURCE}..." + +mkdir -p "${ICONSET}" + +sips -z 16 16 "${SOURCE}" --out "${ICONSET}/icon_16x16.png" +sips -z 32 32 "${SOURCE}" --out "${ICONSET}/icon_16x16@2x.png" +sips -z 32 32 "${SOURCE}" --out "${ICONSET}/icon_32x32.png" +sips -z 64 64 "${SOURCE}" --out "${ICONSET}/icon_32x32@2x.png" +sips -z 128 128 "${SOURCE}" --out "${ICONSET}/icon_128x128.png" +sips -z 256 256 "${SOURCE}" --out "${ICONSET}/icon_128x128@2x.png" +sips -z 256 256 "${SOURCE}" --out "${ICONSET}/icon_256x256.png" +sips -z 512 512 "${SOURCE}" --out "${ICONSET}/icon_256x256@2x.png" +sips -z 512 512 "${SOURCE}" --out "${ICONSET}/icon_512x512.png" +sips -z 1024 1024 "${SOURCE}" --out "${ICONSET}/icon_512x512@2x.png" + +iconutil -c icns "${ICONSET}" -o "${OUTPUT}" +rm -rf "${ICONSET}" + +echo "Generated ${OUTPUT}" diff --git a/desktop-client/src-tauri/tauri.macos.conf.json b/desktop-client/src-tauri/tauri.macos.conf.json index 87fc0ce..22175a1 100644 --- a/desktop-client/src-tauri/tauri.macos.conf.json +++ b/desktop-client/src-tauri/tauri.macos.conf.json @@ -12,4 +12,4 @@ "minimumSystemVersion": "11.0" } } -} +} \ No newline at end of file