diff --git a/icons/icns/make_iconsets.py b/icons/icns/make_iconsets.py index ec353c93b3..2a88daf2f6 100644 --- a/icons/icns/make_iconsets.py +++ b/icons/icns/make_iconsets.py @@ -13,7 +13,7 @@ base = d(a(__file__)) os.chdir(base) imgsrc = j(d(d(base)), 'imgsrc') -sources = {'calibre':j(d(base), 'calibre.png'), 'ebook-edit':j(imgsrc, 'tweak.svg'), 'ebook-viewer':j(imgsrc, 'viewer.svg')} +sources = {'calibre':j(d(base), 'calibre.png'), 'ebook-edit':j(imgsrc, 'tweak.svg'), 'ebook-viewer':j(imgsrc, 'viewer.svg'), 'book':j(imgsrc, 'book.svg')} for name, src in sources.iteritems(): iconset = name + '.iconset' @@ -37,6 +37,9 @@ for name, src in sources.iteritems(): shutil.copy2(iname, iname2x) if sz > 512: os.remove(iname) + for name in (iname, iname2x): + if os.path.exists(name): + subprocess.check_call(['optipng', '-o7', name]) finally: os.chdir('..') diff --git a/setup/installer/osx/app/main.py b/setup/installer/osx/app/main.py index 7e5cc056ed..10d955d768 100644 --- a/setup/installer/osx/app/main.py +++ b/setup/installer/osx/app/main.py @@ -321,8 +321,6 @@ class Py2App(object): c = join(self.build_dir, 'Contents') for x in ('Frameworks', 'MacOS', 'Resources'): os.makedirs(join(c, x)) - for x in ('book.icns',): - shutil.copyfile(join('icons', x), join(self.resources_dir, x)) for x in glob.glob(join('icons', 'icns', '*.iconset')): subprocess.check_call([ 'iconutil', '-c', 'icns', x, '-o', join( @@ -343,6 +341,7 @@ class Py2App(object): env['CALIBRE_LAUNCHED_FROM_BUNDLE']='1' docs = [{'CFBundleTypeName':'E-book', 'CFBundleTypeExtensions':list(BOOK_EXTENSIONS), + 'CFBundleTypeIconFile':'book.icns', 'CFBundleTypeRole':'Viewer', }]