mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-11-13 12:09:35 +03:00
Add support for png2icns as an alternative to iconutil
png2icns is used when building kitty with nix because iconutil seems to be closed-source. libicns also has an iconutil clone called icnsutil in the source tree but the last release is from 2012, which does not include this utility yet.
This commit is contained in:
parent
97cae0e355
commit
21c7002c68
21
setup.py
21
setup.py
@ -859,10 +859,23 @@ def macos_info_plist() -> bytes:
|
||||
|
||||
def create_macos_app_icon(where: str = 'Resources') -> None:
|
||||
iconset_dir = os.path.abspath(os.path.join('logo', appname + '.iconset'))
|
||||
subprocess.check_call([
|
||||
'iconutil', '-c', 'icns', iconset_dir, '-o',
|
||||
os.path.join(where, appname + '.icns')
|
||||
])
|
||||
icns_dir = os.path.join(where, appname + '.icns')
|
||||
try:
|
||||
subprocess.check_call([
|
||||
'iconutil', '-c', 'icns', iconset_dir, '-o', icns_dir
|
||||
])
|
||||
except FileNotFoundError:
|
||||
print(error('iconutil not found') + ', using png2icns (without retina support) to convert the logo', file=sys.stderr)
|
||||
subprocess.check_call([
|
||||
'png2icns', icns_dir
|
||||
] + [os.path.join(iconset_dir, logo) for logo in [
|
||||
# png2icns does not support retina icons, so only pass the non-retina icons
|
||||
'icon_16x16.png',
|
||||
'icon_32x32.png',
|
||||
'icon_128x128.png',
|
||||
'icon_256x256.png',
|
||||
'icon_512x512.png',
|
||||
]])
|
||||
|
||||
|
||||
def create_minimal_macos_bundle(args: Options, where: str) -> None:
|
||||
|
Loading…
Reference in New Issue
Block a user