summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2013-05-13 12:04:20 +0200
committerPierre Rossi <pierre.rossi@digia.com>2013-05-13 16:41:02 +0200
commitef8f8ee022accb65a2c785e98e40c0bdac354251 (patch)
treedef725c6e5121759986ce1da8ba597a5a7a42ce4
parentddb80d42aae01ce47b1acdcb3e480ab711ca0334 (diff)
Re-introduce use of the dop level dir
This reverts commit 0e7244d61e01ab4f2e3532d274115903eae7a3d7 with a few improvements. We now need to patch the shipped version of gyp in tools/gyp.
-rwxr-xr-xbuild/gyp_blinq7
-rw-r--r--patches/0001-GYP-Fix-build-with-toplevel-dir.patch32
2 files changed, 37 insertions, 2 deletions
diff --git a/build/gyp_blinq b/build/gyp_blinq
index b5620a821..c2b4cd453 100755
--- a/build/gyp_blinq
+++ b/build/gyp_blinq
@@ -94,8 +94,11 @@ if __name__ == '__main__':
args.extend(['-D', 'webkit_src_dir=' + chrome_src + '/third_party/WebKit'])
# the top_level source directory is the first common ancestor of our module and the chromium source tree for the build to be sane.
- # toplevel= os.path.commonprefix([root_dir, chrome_src])
- # args.extend(["--toplevel-dir=" + toplevel])
+ # commonprefix works on a character basis, so it might return a phony common prefix (not the common parent directory we expect),
+ toplevel= os.path.commonprefix([root_dir, chrome_src])
+ if not os.path.exists(toplevel):
+ toplevel = os.path.join(toplevel, os.pardir)
+ args.extend(["--toplevel-dir=" + toplevel])
# Chromium specific Hack: for Chromium to build, the depth has to be set to the chromium src dir.
args.extend(["--depth=" + chrome_src])
args.extend(['-D', 'chromium_src_dir=' + chrome_src])
diff --git a/patches/0001-GYP-Fix-build-with-toplevel-dir.patch b/patches/0001-GYP-Fix-build-with-toplevel-dir.patch
new file mode 100644
index 000000000..6980f9558
--- /dev/null
+++ b/patches/0001-GYP-Fix-build-with-toplevel-dir.patch
@@ -0,0 +1,32 @@
+From 5f2e25825375c613c3cd249f874d7a295de2fefd Mon Sep 17 00:00:00 2001
+From: Pierre Rossi <pierre.rossi@digia.com>
+Date: Mon, 13 May 2013 16:25:46 +0200
+Subject: [GYP] Fix build with toplevel-dir
+
+---
+ pylib/gyp/generator/ninja.py | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
+index 619ac39..e10038a 100644
+--- a/pylib/gyp/generator/ninja.py
++++ b/pylib/gyp/generator/ninja.py
+@@ -1309,9 +1309,13 @@ def CalculateVariables(default_variables, params):
+ default_variables.setdefault('SHARED_LIB_SUFFIX', '.so')
+ default_variables.setdefault('SHARED_LIB_DIR',
+ os.path.join('$!PRODUCT_DIR', 'lib'))
++ # Take into account the fact that toplevel_dir might not be equal to depth
++ toplevel_offset = ''
++ if 'options' in params:
++ options = params['options']
++ toplevel_offset = os.path.relpath(options.depth, options.toplevel_dir)
+ default_variables.setdefault('LIB_DIR',
+- os.path.join('$!PRODUCT_DIR', 'obj'))
+-
++ os.path.join('$!PRODUCT_DIR', 'obj', toplevel_offset))
+
+ def OpenOutput(path, mode='w'):
+ """Open |path| for writing, creating directories if necessary."""
+--
+1.8.2.1
+