for module in ('midori', 'katze'):
try:
if not os.access ('_build_', os.F_OK):
- os.mkdir ('_build_')
+ Utils.check_dir ('_build_')
if not os.access ('_build_/docs', os.F_OK):
- os.mkdir ('_build_/docs')
+ Utils.check_dir ('_build_/docs')
if not os.access ('_build_/docs/api', os.F_OK):
- os.mkdir ('_build_/docs/api')
+ Utils.check_dir ('_build_/docs/api')
subprocess.call (['gtkdoc-scan', '--module=' + module,
'--source-dir=' + module, '--output-dir=_build_/docs/api/' + module,
'--rebuild-sections', '--rebuild-types'])
'--default-includes=%s/%s.h' % (module, module),
'--sgml-mode', '--main-sgml-file=%s.sgml' % module])
if not os.access ('html', os.F_OK):
- os.mkdir ('html')
+ Utils.check_dir ('html')
os.chdir ('html')
subprocess.call (['gtkdoc-mkhtml', module, '../%s.sgml' % module])
Params.pprint ('YELLOW', "Created documentation for %s." % module)
# WAF build script for midori
# This file is licensed under the terms of the expat license, see the file EXPAT.
+import Utils
+
def add_image (bld, category, name):
srcdir = os.getcwd ()
blddir = bld.bdir
- def mkdir (path):
- if not os.access (path, os.F_OK):
- os.mkdir (path)
-
rsvg_convert = bld.env['RSVG_CONVERT']
if rsvg_convert:
- mkdir (blddir + '/icons')
+ Utils.check_dir (blddir + '/icons')
for size in [16, 22, 32, 48]:
format = str (size) + 'x' + str (size)
elif not rsvg_convert:
pass
elif os.access (srcdir + '/icons/scalable/' + name + '.svg', os.F_OK):
- mkdir (blddir + '/icons/' + format)
+ Utils.check_dir (blddir + '/icons/' + format)
command = rsvg_convert + ' -w ' + str(size) + \
' -h ' + str(size) + \
' -o ' + blddir + '/icons/' + format + '/' + name + '.png' + \
VERSION = str (major) + '.' + str (minor) + '.' + str (micro)
try:
- git = subprocess.Popen (['git', 'rev-parse', '--short', 'HEAD'],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- if not git.wait ():
- VERSION = (VERSION + '-' + git.stdout.read ()).strip ()
+ git = Utils.cmd_output (['git', 'rev-parse', '--short', 'HEAD'], silent=True)
+ VERSION = (VERSION + '-' + git).strip ()
except:
pass
# if 'soup-2.4' in conf.env['LIB_WEBKIT']:
webkit_binary = conf.env.get_flat ('LIBPATH_WEBKIT') + '/libwebkit-1.0.so'
try:
- ldd = subprocess.Popen (['ldd', webkit_binary],
- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
- if not ldd.wait ():
+ ldd = Utils.cmd_output (['ldd', webkit_binary], silent=True)
+ if ldd != '':
found = False
- for library in ldd.stdout.read ().split ('\n'):
+ for library in ldd.split ('\n'):
if library[:8] == '\tlibsoup':
found = True
if found:
add_enable_option ('hildon', 'Maemo integration', group)
def build (bld):
- def mkdir (path):
- if not os.access (path, os.F_OK):
- os.mkdir (path)
-
bld.add_subdirs ('katze midori icons')
if option_enabled ('addons'):
if bld.env['RST2HTML']:
# FIXME: Build only if needed
- if not os.access (blddir, os.F_OK):
- os.mkdir (blddir)
- if not os.access (blddir + '/docs', os.F_OK):
- os.mkdir (blddir + '/docs')
- if not os.access (blddir + '/docs/user', os.F_OK):
- os.mkdir (blddir + '/docs/user')
+ Utils.check_dir (blddir)
+ Utils.check_dir (blddir + '/docs')
+ Utils.check_dir (blddir + '/docs/user')
os.chdir (blddir + '/docs/user')
command = bld.env['RST2HTML'] + ' -stg ' + \
'--stylesheet=../../../docs/user/midori.css ' + \
pre.close ()
if bld.env['RSVG_CONVERT']:
- mkdir (blddir + '/data')
+ Utils.check_dir (blddir + '/data')
command = bld.env['RSVG_CONVERT'] + \
' -o ' + blddir + '/data/logo-shade.png ' + \
srcdir + '/data/logo-shade.svg'
Utils.pprint ('RED', "Make sure intltool is installed.")
os.chdir ('..')
elif Options.options.run:
- def mkdir (path):
- if not os.access (path, os.F_OK):
- os.mkdir (path)
-
folder = os.path.dirname (Build.bld.env['waf_config_files'][0])
try:
ext = 'MIDORI_EXTENSION_PATH=' + folder + os.sep + 'extensions'
lang = lang[:-3]
else:
continue
- mkdir (folder + os.sep + 'po' + os.sep + lang)
- mkdir (folder + os.sep + 'po' + os.sep + lang + \
+ Utils.check_dir (folder + os.sep + 'po' + os.sep + lang)
+ Utils.check_dir (folder + os.sep + 'po' + os.sep + lang + \
os.sep + 'LC_MESSAGES')
os.symlink (folder + os.sep + 'po' + os.sep + lang + '.mo',
folder + os.sep + 'po' + os.sep + lang + os.sep + \