[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75
kevino at webkit.org
kevino at webkit.org
Thu Oct 29 20:45:42 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit f1c154b9a1c8d2244c00124c656e16c31a7ebdbd
Author: kevino at webkit.org <kevino at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Oct 15 21:27:02 2009 +0000
Reviewed by Kevin Ollivier.
Add Mac package building scripts for wx.
https://bugs.webkit.org/show_bug.cgi?id=30405
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49654 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 0f6b868..18a1219 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-15 Robin Dunn <robin at alldunn.com>
+
+ Reviewed by Kevin Ollivier.
+
+ Add Mac package building scripts for wx.
+
+ https://bugs.webkit.org/show_bug.cgi?id=30405
+
+ * wx/build/build_utils.py:
+ * wx/build/settings.py:
+ * wx/packaging/build-mac-installer.py: Added.
+
2009-10-15 Zan Dobersek <zandobersek at gmail.com>
Reviewed by Gustavo Noronha.
diff --git a/WebKitTools/wx/build/build_utils.py b/WebKitTools/wx/build/build_utils.py
index 0a795a8..85c20c6 100644
--- a/WebKitTools/wx/build/build_utils.py
+++ b/WebKitTools/wx/build/build_utils.py
@@ -27,13 +27,12 @@ import commands
import glob
import os
import platform
+import re
import shutil
import sys
import urllib
import urlparse
-import Logs
-
def get_output(command):
"""
Windows-compatible function for getting output from a command.
@@ -110,6 +109,7 @@ def update_wx_deps(conf, wk_root, msvc_version='msvc2008'):
"""
Download and update tools needed to build the wx port.
"""
+ import Logs
Logs.info('Ensuring wxWebKit dependencies are up-to-date.')
wklibs_dir = os.path.join(wk_root, 'WebKitLibraries')
@@ -154,3 +154,23 @@ def flattenSources(sources):
flat_sources.extend(group)
return flat_sources
+
+def git_branch_name():
+ try:
+ branches = commands.getoutput("git branch --no-color")
+ match = re.search('^\* (.*)', branches, re.MULTILINE)
+ if match:
+ return ".%s" % match.group(1)
+ except:
+ pass
+
+ return ""
+
+def get_config(wk_root):
+ config_file = os.path.join(wk_root, 'WebKitBuild', 'Configuration')
+ config = 'Debug'
+
+ if os.path.exists(config_file):
+ config = open(config_file).read()
+
+ return config
diff --git a/WebKitTools/wx/build/settings.py b/WebKitTools/wx/build/settings.py
index 0d53413..0bababc 100644
--- a/WebKitTools/wx/build/settings.py
+++ b/WebKitTools/wx/build/settings.py
@@ -140,21 +140,8 @@ webcore_dirs = [
'xml'
]
-config_file = os.path.join(wk_root, 'WebKitBuild', 'Configuration')
-config = 'Debug'
-
-if os.path.exists(config_file):
- config = open(config_file).read()
-
-config_dir = config
-
-try:
- branches = commands.getoutput("git branch --no-color")
- match = re.search('^\* (.*)', branches, re.MULTILINE)
- if match:
- config_dir += ".%s" % match.group(1)
-except:
- pass
+config = get_config(wk_root)
+config_dir = config + git_branch_name()
output_dir = os.path.join(wk_root, 'WebKitBuild', config_dir)
diff --git a/WebKitTools/wx/packaging/build-mac-installer.py b/WebKitTools/wx/packaging/build-mac-installer.py
new file mode 100644
index 0000000..c007e8e
--- /dev/null
+++ b/WebKitTools/wx/packaging/build-mac-installer.py
@@ -0,0 +1,167 @@
+#!/usr/bin/env python
+
+# Copyright (C) 2009 Kevin Ollivier All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# Script for building Mac .pkg installer
+
+import commands
+import distutils.sysconfig
+import glob
+import optparse
+import os
+import shutil
+import string
+import sys
+import tempfile
+
+script_dir = os.path.abspath(os.path.dirname(__file__))
+sys.path.append(os.path.abspath(os.path.join(script_dir, "..", "build")))
+
+from build_utils import *
+
+import wx
+
+wxwk_root = os.path.abspath(os.path.join(script_dir, "..", "..", ".."))
+wxwebkit_dir = os.path.abspath(os.path.join(wxwk_root, "WebKitBuild", get_config(wxwk_root) + git_branch_name()))
+
+wx_version = wx.__version__[:5]
+py_version = sys.version[:3]
+
+wxwk_version = ""
+
+if os.system("git info") == 0:
+ info = commands.getoutput("git-svn info ../..")
+else:
+ info = commands.getoutput("svn info")
+
+for line in info.split("\n"):
+ print line
+ if line.startswith("Revision: "):
+ wxwk_version = line.replace("Revision: ", "").strip()
+
+platform = "osx"
+
+pkgname = "wxWebKit-%s-wx%s-py%s" % (platform, wx_version[:3], py_version)
+
+tempdir = "/tmp/%s" % (pkgname)
+
+if os.path.exists(tempdir):
+ shutil.rmtree(tempdir)
+ os.makedirs(tempdir)
+
+installroot = os.path.join(tempdir, "install-root")
+installapps = os.path.join(tempdir, "install-apps")
+
+sp_root = distutils.sysconfig.get_python_lib()
+wx_root = sp_root
+if sys.platform.startswith("darwin"):
+ wx_root = "/usr/local/lib/wxPython-unicode-%s" % wx.__version__
+ sp_root = "%s/lib/python%s/site-packages" % (wx_root, py_version)
+sitepackages = "%s/wx-%s-mac-unicode/wx" % (sp_root, wx_version[:3])
+prefix = sitepackages
+
+def mac_update_dependencies(dylib, prefix):
+ """
+ Copies any non-system dependencies into the bundle, and
+ updates the install name path to the new path in the bundle.
+ """
+ global wx_root
+ system_prefixes = ["/usr/lib", "/System/Library", wx_root]
+
+ output = commands.getoutput("otool -L %s" % dylib).strip()
+ for line in output.split("\n"):
+ filename = line.split("(")[0].strip()
+ if os.path.exists(filename):
+ print "checking dll %s" % filename
+ copy = True
+ for sys_prefix in system_prefixes:
+ if filename.startswith(sys_prefix):
+ copy = False
+
+ if copy:
+ copydir = os.path.dirname(dylib)
+
+ filedir, basename = os.path.split(filename)
+ dest_filename = os.path.join(prefix, basename)
+ copyname = os.path.join(copydir, basename)
+ if not os.path.exists(copyname):
+ shutil.copy(filename, copydir)
+ os.system("install_name_tool -id %s %s" % (dest_filename, copyname))
+
+ os.system("install_name_tool -change %s %s %s" % (filename, dest_filename, dylib))
+
+def exitIfError(cmd):
+ print cmd
+ retval = os.system(cmd)
+ if retval != 0:
+ if os.path.exists(tempdir):
+ shutil.rmtree(tempdir)
+ sys.exit(1)
+
+wxroot = installroot + prefix
+wxpythonroot = installroot + sitepackages
+
+try:
+ if not os.path.exists(wxroot):
+ os.makedirs(wxroot)
+
+ if not os.path.exists(wxpythonroot):
+ os.makedirs(wxpythonroot)
+
+ for wildcard in ["*.py", "*.so", "*.dylib"]:
+ files = glob.glob(os.path.join(wxwebkit_dir, wildcard))
+ for afile in files:
+ shutil.copy(afile, wxpythonroot)
+
+ if sys.platform.startswith("darwin"):
+ dylib_path = os.path.join(wxpythonroot, "libwxwebkit.dylib")
+ os.system("install_name_tool -id %s %s" % (os.path.join(prefix, "libwxwebkit.dylib"), dylib_path))
+ mac_update_dependencies(dylib_path, prefix)
+ mac_update_dependencies(os.path.join(wxpythonroot, "_webview.so"), prefix)
+
+ demodir = installroot + "/Applications/wxWebKit/Demos"
+ if not os.path.exists(demodir):
+ os.makedirs(demodir)
+
+ shutil.copy(os.path.join(wxwk_root, "WebKit", "wx", "bindings", "python", "samples", "simple.py"), demodir)
+
+ if os.path.exists(pkgname + ".pkg"):
+ shutil.rmtree(pkgname + ".pkg")
+
+ pkg_args = ['--title ' + pkgname,
+ '--out %s.pkg' % pkgname,
+ '--version ' + wxwk_version.strip(),
+ '--id org.wxwebkit.wxwebkit',
+ '--domain system',
+ '--root-volume-only',
+ '--root ' + installroot,
+ '--resources %s/mac/resources' % script_dir,
+ '--verbose'
+ ]
+
+ packagemaker = "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
+ exitIfError(packagemaker + " %s" % (string.join(pkg_args, " ")))
+finally:
+ if os.path.exists(tempdir):
+ shutil.rmtree(tempdir)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list