summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-22 21:06:42 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-22 21:06:42 +0000
commit79ed8458e8e8e2cb9ddea43436f01cf12ad92d52 (patch)
tree58724e5a1808dc5a4aada0fa670e8962fcc83dfb /build
parent2e55fe913d07b59f967ebe3193e56b6cf69bddec (diff)
downloadchromium_src-79ed8458e8e8e2cb9ddea43436f01cf12ad92d52.zip
chromium_src-79ed8458e8e8e2cb9ddea43436f01cf12ad92d52.tar.gz
chromium_src-79ed8458e8e8e2cb9ddea43436f01cf12ad92d52.tar.bz2
Linux: move use_system_harfbuzz logic out of the main file.
BUG=226860 Review URL: https://codereview.chromium.org/13732002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195590 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r--build/linux/unbundle/README28
-rw-r--r--build/linux/unbundle/harfbuzz.gyp28
-rwxr-xr-xbuild/linux/unbundle/replace_gyp_files.py42
3 files changed, 98 insertions, 0 deletions
diff --git a/build/linux/unbundle/README b/build/linux/unbundle/README
new file mode 100644
index 0000000..7027b9a
--- /dev/null
+++ b/build/linux/unbundle/README
@@ -0,0 +1,28 @@
+This directory contains files that make it possible to use system libraries.
+
+For more info please read the following:
+
+ - https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries
+ - https://wiki.gentoo.org/wiki/Why_not_bundle_dependencies
+ - http://www.debian.org/doc/debian-policy/ch-source.html#s-embeddedfiles
+
+For more Chromium-specific context please read
+http://spot.livejournal.com/312320.html .
+
+This directory is provided in the source tree to follow above guidelines.
+It is a compromise solution which takes into account Chromium developers
+who want to avoid the perceived burden of more conditional code in gyp,
+and expectations of Open Source community, where using system-provided
+libraries is the norm.
+
+Usage:
+
+replace_gyp_files.py <gyp-flags>
+
+For example: replace_gyp_files.py -Duse_system_harfbuzz=1
+
+The script ignores flags other than -D for convenience. This makes it possible
+to have a variable e.g. ${myconf} with all the options, and execute:
+
+build/linux/unbundle/replace_gyp_files.py ${myconf}
+build/gyp_chromium ${myconf}
diff --git a/build/linux/unbundle/harfbuzz.gyp b/build/linux/unbundle/harfbuzz.gyp
new file mode 100644
index 0000000..456dd38
--- /dev/null
+++ b/build/linux/unbundle/harfbuzz.gyp
@@ -0,0 +1,28 @@
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+ 'targets': [
+ {
+ 'target_name': 'harfbuzz-ng',
+ 'type': 'none',
+ 'cflags': [
+ '<!@(pkg-config --cflags harfbuzz)',
+ ],
+ 'direct_dependent_settings': {
+ 'cflags': [
+ '<!@(pkg-config --cflags harfbuzz)',
+ ],
+ },
+ 'link_settings': {
+ 'ldflags': [
+ '<!@(pkg-config --libs-only-L --libs-only-other harfbuzz)',
+ ],
+ 'libraries': [
+ '<!@(pkg-config --libs-only-l harfbuzz)',
+ ],
+ },
+ },
+ ],
+}
diff --git a/build/linux/unbundle/replace_gyp_files.py b/build/linux/unbundle/replace_gyp_files.py
new file mode 100755
index 0000000..bf29458
--- /dev/null
+++ b/build/linux/unbundle/replace_gyp_files.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env python
+# Copyright 2013 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Replaces gyp files in tree with files from here that
+make the build use system libraries.
+"""
+
+
+import os.path
+import shutil
+import sys
+
+
+REPLACEMENTS = {
+ 'use_system_harfbuzz': 'third_party/harfbuzz-ng/harfbuzz.gyp',
+}
+
+
+def DoMain(argv):
+ my_dirname = os.path.dirname(__file__)
+ source_tree_root = os.path.abspath(
+ os.path.join(my_dirname, '..', '..', '..'))
+
+ for flag, path in REPLACEMENTS.items():
+ # Accept arguments in gyp command-line syntax, and ignore other
+ # parameters, so that the caller can re-use command-line for this
+ # script and gyp.
+ if '-D%s=1' % flag not in argv:
+ continue
+
+ # Copy the gyp file from directory of this script to target path.
+ shutil.copyfile(os.path.join(my_dirname, os.path.basename(path)),
+ os.path.join(source_tree_root, path))
+
+ return 0
+
+
+if __name__ == '__main__':
+ sys.exit(DoMain(sys.argv))