Check for unistd.h in waf, update cache on (un)install only

This commit is contained in:
Christian Dywan 2008-06-01 15:16:40 +02:00
parent 8495ffa571
commit 4e5afd5041

29
wscript
View file

@ -39,6 +39,8 @@ def configure (conf):
conf.check_pkg ('libxml-2.0', destvar='LIBXML', vnum='2.6', mandatory=True) conf.check_pkg ('libxml-2.0', destvar='LIBXML', vnum='2.6', mandatory=True)
conf.check_pkg ('libsexy', destvar='LIBSEXY', vnum='0.1', mandatory=True) conf.check_pkg ('libsexy', destvar='LIBSEXY', vnum='0.1', mandatory=True)
conf.check_header ('unistd.h', 'HAVE_UNISTD_H')
if conf.find_program ('convert', var='CONVERT'): if conf.find_program ('convert', var='CONVERT'):
icons = 'yes' icons = 'yes'
else: else:
@ -85,16 +87,17 @@ def build (bld):
install_files ('DATADIR', 'applications', 'midori.desktop') install_files ('DATADIR', 'applications', 'midori.desktop')
def shutdown (): def shutdown ():
dir = Common.path_install ('DATADIR', 'icons/hicolor') if Params.g_commands['install'] or Params.g_commands['uninstall']:
icon_cache_updated = False dir = Common.path_install ('DATADIR', 'icons/hicolor')
if not Params.g_options.destdir: icon_cache_updated = False
# update the pixmap cache directory if not Params.g_options.destdir:
try: # update the pixmap cache directory
subprocess.call (['gtk-update-icon-cache', '-q', '-f', '-t', dir]) try:
Params.pprint ('YELLOW', "Updated Gtk icon cache.") subprocess.call (['gtk-update-icon-cache', '-q', '-f', '-t', dir])
icon_cache_updated = True Params.pprint ('YELLOW', "Updated Gtk icon cache.")
except: icon_cache_updated = True
Params.pprint ('RED', "Failed to update icon cache.") except:
if not icon_cache_updated: Params.pprint ('RED', "Failed to update icon cache.")
Params.pprint ('YELLOW', "Icon cache not updated. After install, run this:") if not icon_cache_updated:
Params.pprint ('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir) Params.pprint ('YELLOW', "Icon cache not updated. After install, run this:")
Params.pprint ('YELLOW', "gtk-update-icon-cache -q -f -t %s" % dir)