File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2+ #
3+ # Converts an svg logo into the various image resources required by
4+ # the various platforms deployments.
5+ #
6+ # On debian-based systems you need these deps:
7+ # apt-get install xmlstarlet python3-cairosvg icnsutils
28
39if [ $# != 1 ]
410then
@@ -52,7 +58,23 @@ cp "$tmpdir/256.png" "$tmpdir/Riot.iconset/icon_256x256.png"
5258cp " $tmpdir /512.png" " $tmpdir /Riot.iconset/icon_256x256@2x.png"
5359cp " $tmpdir /512.png" " $tmpdir /Riot.iconset/icon_512x512.png"
5460cp " $tmpdir /1024.png" " $tmpdir /Riot.iconset/icon_512x512@2x.png"
55- iconutil -c icns -o electron_app/build/icon.icns " $tmpdir /Riot.iconset"
61+
62+ if [ -x " $( command -v iconutil) " ]; then
63+ # available on macos
64+ iconutil -c icns -o electron_app/build/icon.icns " $tmpdir /Riot.iconset"
65+ elif [ -x " $( command -v png2icns) " ]; then
66+ # available on linux
67+ # png2icns is more finicky about its input than iconutil
68+ # 1. it doesn't support a 64x64 (aka 32x32@2x)
69+ # 2. it doesn't like duplicates (128x128@2x == 256x256)
70+ rm " $tmpdir /Riot.iconset/icon_128x128@2x.png"
71+ rm " $tmpdir /Riot.iconset/icon_256x256@2x.png"
72+ rm " $tmpdir /Riot.iconset/icon_16x16@2x.png"
73+ rm " $tmpdir /Riot.iconset/icon_32x32@2x.png"
74+ png2icns electron_app/build/icon.icns " $tmpdir " /Riot.iconset/* png
75+ else
76+ echo " WARNING: Unsupported platform. Skipping icns build"
77+ fi
5678
5779cp " $tmpdir /36.png" " res/vector-icons/android-chrome-36x36.png"
5880cp " $tmpdir /48.png" " res/vector-icons/android-chrome-48x48.png"
You can’t perform that action at this time.
0 commit comments