Skip to content

Commit 20dc706

Browse files
authored
Merge pull request #8550 from abeluck/develop
Make scripts/make-icons.sh work on linux
2 parents 674b8c3 + d395fdc commit 20dc706

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

scripts/make-icons.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
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

39
if [ $# != 1 ]
410
then
@@ -52,7 +58,23 @@ cp "$tmpdir/256.png" "$tmpdir/Riot.iconset/icon_256x256.png"
5258
cp "$tmpdir/512.png" "$tmpdir/Riot.iconset/[email protected]"
5359
cp "$tmpdir/512.png" "$tmpdir/Riot.iconset/icon_512x512.png"
5460
cp "$tmpdir/1024.png" "$tmpdir/Riot.iconset/[email protected]"
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/[email protected]"
71+
rm "$tmpdir/Riot.iconset/[email protected]"
72+
rm "$tmpdir/Riot.iconset/[email protected]"
73+
rm "$tmpdir/Riot.iconset/[email protected]"
74+
png2icns electron_app/build/icon.icns "$tmpdir"/Riot.iconset/*png
75+
else
76+
echo "WARNING: Unsupported platform. Skipping icns build"
77+
fi
5678

5779
cp "$tmpdir/36.png" "res/vector-icons/android-chrome-36x36.png"
5880
cp "$tmpdir/48.png" "res/vector-icons/android-chrome-48x48.png"

0 commit comments

Comments
 (0)