Use rsvg instead of imagemagick to render icons
Apparently rsvg-convert is good enough for what we need and it is a dependency of gtk already, unlike imagemagick's convert which even requires rsvg.
This commit is contained in:
parent
1b0fc074e3
commit
212597f416
2 changed files with 9 additions and 8 deletions
|
@ -18,7 +18,9 @@ def add_image (bld, install_files, category, name):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if bld.env ()['CONVERT']:
|
rsvg_convert = bld.env ()['RSVG_CONVERT']
|
||||||
|
|
||||||
|
if rsvg_convert:
|
||||||
mkdir (blddir + '/icons')
|
mkdir (blddir + '/icons')
|
||||||
|
|
||||||
for size in [16, 22, 32, 48]:
|
for size in [16, 22, 32, 48]:
|
||||||
|
@ -26,15 +28,14 @@ def add_image (bld, install_files, category, name):
|
||||||
if os.access (srcdir + '/icons/' + format + '/' + name + '.png', os.F_OK):
|
if os.access (srcdir + '/icons/' + format + '/' + name + '.png', os.F_OK):
|
||||||
_install_files ('DATADIR', 'icons/hicolor/' + format + '/' + category,
|
_install_files ('DATADIR', 'icons/hicolor/' + format + '/' + category,
|
||||||
srcdir + '/icons/' + format + '/' + name + '.png')
|
srcdir + '/icons/' + format + '/' + name + '.png')
|
||||||
elif not bld.env ()['CONVERT']:
|
elif not rsvg_convert:
|
||||||
pass
|
pass
|
||||||
elif os.access (srcdir + '/icons/scalable/' + name + '.svg', os.F_OK):
|
elif os.access (srcdir + '/icons/scalable/' + name + '.svg', os.F_OK):
|
||||||
mkdir (blddir + '/icons/' + format)
|
mkdir (blddir + '/icons/' + format)
|
||||||
convert = subprocess.Popen (['convert',
|
convert = subprocess.Popen ([rsvg_convert,
|
||||||
'-background', 'transparent',
|
'-w', str (size), '-h', str (size),
|
||||||
'-geometry', format, '-extent', format,
|
'-o', blddir + '/icons/' + format + '/' + name + '.png',
|
||||||
srcdir + '/icons/scalable/' + name + '.svg',
|
srcdir + '/icons/scalable/' + name + '.svg'],
|
||||||
blddir + '/icons/' + format + '/' + name + '.png'],
|
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
if not convert.wait ():
|
if not convert.wait ():
|
||||||
_install_files ('DATADIR', 'icons/hicolor/' + format + '/' + category,
|
_install_files ('DATADIR', 'icons/hicolor/' + format + '/' + category,
|
||||||
|
|
2
wscript
2
wscript
|
@ -43,7 +43,7 @@ def configure (conf):
|
||||||
|
|
||||||
conf.check_header ('unistd.h', 'HAVE_UNISTD_H')
|
conf.check_header ('unistd.h', 'HAVE_UNISTD_H')
|
||||||
|
|
||||||
if conf.find_program ('convert', var='CONVERT'):
|
if conf.find_program ('rsvg-convert', var='RSVG_CONVERT'):
|
||||||
icons = 'yes'
|
icons = 'yes'
|
||||||
else:
|
else:
|
||||||
icons = 'no'
|
icons = 'no'
|
||||||
|
|
Loading…
Reference in a new issue