def build_webkit(cfg): wxdir = get_wxdir() assert isdir(wxdir) assert cfg in ('debug', 'release', 'curl') webkit_scripts = abspath(WEBKITDIR + '/WebKitTools/Scripts') assert isdir(webkit_scripts), "not a directory: " + webkit_scripts # passing things through to cygwin will mangle backslashes, so fix them # here. webkit_scripts = cygfix(webkit_scripts) wxdir = cygfix(wxdir) libdir = os.path.join(abspath(WEBKITDIR), 'WebKitLibraries/msvc2008/win/lib') incdir = os.path.join(abspath(WEBKITDIR), 'WebKitLibraries/msvc2008/win/include') icudir = _setup_icu() os.environ['WEBKIT_ICU_REPLACEMENT'] = os.path.join(thisdir, icudir) os.environ['WEBKIT_CURL_REPLACEMENT'] = abspath( os.path.join(curl.dirname, 'lib', 'libcurl%s.lib' % curl_pfix)) os.environ['WEBKIT_JPEG_REPLACEMENT'] = abspath(os.path.join(jpeg.dirname)) with _cygwin_env(): cygwin('cd %s && ./set-webkit-configuration --%s' % (webkit_scripts, cfg)) cygprefix = 'cd %s && PATH="%s:$PATH" WXWIN=%s' % ( webkit_scripts, '/cygdrive/c/python26', wxdir) wkopts = 'wxgc' if WEBKIT_USE_GC else '' with timed('building webkit'): build_scripts_py = os.path.join(abspath(WEBKITDIR), 'WebKitTools/wx/build') assert os.path.isdir(build_scripts_py), build_scripts_py env = dict(os.environ) env.update(PYTHONPATH=cygfix(build_scripts_py), PATH=';'.join([r'c:\python26', os.environ['PATH']])) def run_cygwin(s): cygwin(cygprefix + ' ' + s + (' --wx %s' % wkopts), env=env) if '--test' in sys.argv: run_cygwin('./run-webkit-tests --wx') elif '--clean' in sys.argv: run_cygwin('./build-webkit --wx --clean') else: run_cygwin('./build-webkit --wx wxpython')
def build_webkit(cfg): wxdir = get_wxdir() assert isdir(wxdir) assert cfg in ('debug', 'release', 'curl') webkit_scripts = abspath(WEBKITDIR + '/WebKitTools/Scripts') assert isdir(webkit_scripts), "not a directory: " + webkit_scripts # passing things through to cygwin will mangle backslashes, so fix them # here. webkit_scripts = cygfix(webkit_scripts) wxdir = cygfix(wxdir) libdir = os.path.join(abspath(WEBKITDIR), 'WebKitLibraries/msvc2008/win/lib') incdir = os.path.join(abspath(WEBKITDIR), 'WebKitLibraries/msvc2008/win/include') icudir = _setup_icu() os.environ['WEBKIT_ICU_REPLACEMENT'] = os.path.join(thisdir, icudir) os.environ['WEBKIT_CURL_REPLACEMENT'] = abspath(os.path.join(curl.dirname, 'lib', 'libcurl%s.lib' % curl_pfix)) os.environ['WEBKIT_JPEG_REPLACEMENT'] = abspath(os.path.join(jpeg.dirname)) with _cygwin_env(): cygwin('cd %s && ./set-webkit-configuration --%s' % (webkit_scripts, cfg)) cygprefix = 'cd %s && PATH="%s:$PATH" WXWIN=%s' % (webkit_scripts, '/cygdrive/c/python26', wxdir) wkopts = 'wxgc' if WEBKIT_USE_GC else '' with timed('building webkit'): build_scripts_py = os.path.join(abspath(WEBKITDIR), 'WebKitTools/wx/build') assert os.path.isdir(build_scripts_py), build_scripts_py env=dict(os.environ) env.update(PYTHONPATH=cygfix(build_scripts_py), PATH=';'.join([r'c:\python26',os.environ['PATH']])) def run_cygwin(s): cygwin(cygprefix + ' ' + s + (' --wx %s' % wkopts), env=env) if '--test' in sys.argv: run_cygwin('./run-webkit-tests --wx') elif '--clean' in sys.argv: run_cygwin('./build-webkit --wx --clean') else: run_cygwin('./build-webkit --wx wxpython')
def main(): force_bakefile = False if '--force-bakefile' in sys.argv: sys.argv.remove('--force-bakefile') force_bakefile = True funcs = dict(clean=clean, rebuild=lambda: (clean(), build(force_bakefile)), checkout=checkout, update=update, build=build, all=lambda: all(force_bakefile)) if not len(sys.argv) == 2 or sys.argv[1] not in funcs: print >> sys.stderr, 'python build_wx.py [--DEBUG] [--force-bakefile] [checkout|update|build|rebuild|all|clean]' return 1 funcname = sys.argv[1] with timed(funcname): funcs[funcname]()
def checkout(): if isdir(WEBKITDIR): inform('skipping checkout, %s already exists' % WEBKITDIR) else: inform('cloning WebKit') makedirs(WEBKITDIR) with cd(WEBKITDIR): git.run(['init']) # turn off auto CRLF conversion, so that cygwin bash # doesn't complain about line endings git.run(['config', 'core.autocrlf', 'false']) # Add our remote source git.run(['remote', 'add', WEBKIT_GIT_REMOTE, WEBKIT_GIT_REPO]) git.run(['fetch', WEBKIT_GIT_REMOTE, '--depth', '1']) # checkout a local tracking branch of the remote branch we're interested in with timed(): git.run(['checkout', '-b', WEBKIT_GIT_BRANCH, WEBKIT_GIT_REMOTE + '/' + WEBKIT_GIT_BRANCH])
def main(): force_bakefile = False if '--force-bakefile' in sys.argv: sys.argv.remove('--force-bakefile') force_bakefile = True funcs = dict(clean = clean, rebuild = lambda: (clean(), build(force_bakefile)), checkout = checkout, update = update, build = build, all = lambda: all(force_bakefile)) if not len(sys.argv) == 2 or sys.argv[1] not in funcs: print >> sys.stderr, 'python build_wx.py [--DEBUG] [--force-bakefile] [checkout|update|build|rebuild|all|clean]' return 1 funcname = sys.argv[1] with timed(funcname): funcs[funcname]()
def checkout(): if isdir(WEBKITDIR): inform('skipping checkout, %s already exists' % WEBKITDIR) else: inform('cloning WebKit') makedirs(WEBKITDIR) with cd(WEBKITDIR): git.run(['init']) # turn off auto CRLF conversion, so that cygwin bash # doesn't complain about line endings git.run(['config', 'core.autocrlf', 'false']) # Add our remote source git.run(['remote', 'add', WEBKIT_GIT_REMOTE, WEBKIT_GIT_REPO]) git.run(['fetch', WEBKIT_GIT_REMOTE, '--depth', '1']) # checkout a local tracking branch of the remote branch we're interested in with timed(): git.run([ 'checkout', '-b', WEBKIT_GIT_BRANCH, WEBKIT_GIT_REMOTE + '/' + WEBKIT_GIT_BRANCH ])