diff options
author | qsr <qsr@chromium.org> | 2014-08-25 08:34:43 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-25 15:35:27 +0000 |
commit | 13a54e1254fcf512fa72991b604f21d503498a24 (patch) | |
tree | 459fc2bd2eae4c2abfaf8651b2cf9bacc72733bd /third_party | |
parent | 1533986744d9dd0be2da71aba776957bf6766429 (diff) | |
download | chromium_src-13a54e1254fcf512fa72991b604f21d503498a24.zip chromium_src-13a54e1254fcf512fa72991b604f21d503498a24.tar.gz chromium_src-13a54e1254fcf512fa72991b604f21d503498a24.tar.bz2 |
Revert "Core mojo API for python."
This reverts commit 94c1ddb7dfdafaec4a5045cdf2067a7ade6ea6ad.
The CL is making bots fail in a non consistent way.
BUG=None
TBR=pauljensen@chromium.org
NOTRY=TRUE
Review URL: https://codereview.chromium.org/506593002
Cr-Commit-Position: refs/heads/master@{#291684}
Diffstat (limited to 'third_party')
-rw-r--r-- | third_party/cython/cp_python_binary_modules.py | 42 | ||||
-rw-r--r-- | third_party/cython/cython_compiler.gypi | 71 | ||||
-rw-r--r-- | third_party/cython/python_export.h | 13 | ||||
-rw-r--r-- | third_party/cython/python_flags.py | 53 | ||||
-rw-r--r-- | third_party/cython/python_module.gypi | 58 | ||||
-rw-r--r-- | third_party/cython/rules.gni | 84 |
6 files changed, 0 insertions, 321 deletions
diff --git a/third_party/cython/cp_python_binary_modules.py b/third_party/cython/cp_python_binary_modules.py deleted file mode 100644 index dd38e64..0000000 --- a/third_party/cython/cp_python_binary_modules.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2014 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. - -import argparse -import os -import shutil -import sys - -def touch(fname): - if os.path.exists(fname): - os.utime(fname, None) - else: - open(fname, 'a').close() - -def main(): - """Command line utility to copy python binary modules to the correct package - hierarchy. - """ - parser = argparse.ArgumentParser( - description='Copy python binary modules to the correct package ' - 'hierarchy.') - parser.add_argument('timestamp', help='The timetsamp file.') - parser.add_argument('lib_dir', help='The directory containing the modules') - parser.add_argument('destination_dir', - help='The destination directory of the module') - parser.add_argument('mappings', nargs='+', - help='The mapping from module to library.') - opts = parser.parse_args() - - if not os.path.exists(opts.destination_dir): - os.makedirs(opts.destination_dir) - - for mapping in opts.mappings: - [module, library] = mapping.split('=') - shutil.copy(os.path.join(opts.lib_dir, library), - os.path.join(opts.destination_dir, module)) - - touch(opts.timestamp) - -if __name__ == '__main__': - main() diff --git a/third_party/cython/cython_compiler.gypi b/third_party/cython/cython_compiler.gypi deleted file mode 100644 index 39d8318..0000000 --- a/third_party/cython/cython_compiler.gypi +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2014 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. - -{ - 'variables': { - 'python_flags': '<(DEPTH)/third_party/cython/python_flags.py', - }, - 'conditions': [ - ['OS=="mac"', { - 'variables': { - 'module_prefix': '', - 'module_suffix': '.so', - }, - }, { - 'variables': { - 'module_prefix': '<(SHARED_LIB_PREFIX)', - 'module_suffix': '<(SHARED_LIB_SUFFIX)', - }, - }], - ], - 'type': 'loadable_module', - 'rules': [ - { - 'rule_name': '<(_target_name)_cython_compiler', - 'extension': 'pyx', - 'variables': { - 'cython_compiler': '<(DEPTH)/third_party/cython/src/cython.py', - }, - 'inputs': [ - '<(cython_compiler)', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/cython/<(python_base_module)/<(RULE_INPUT_ROOT).cc', - ], - 'action': [ - 'python', '<(cython_compiler)', - '--cplus', - '-I<(DEPTH)', - '-o', '<@(_outputs)', - '<(RULE_INPUT_PATH)', - ], - 'message': 'Generating C++ source from <(RULE_INPUT_PATH)', - 'process_outputs_as_sources': 1, - } - ], - 'include_dirs': [ - '<!@(python <(python_flags) --includes)', - '<(DEPTH)', - ], - 'libraries': [ - '<!@(python <(python_flags) --libraries)', - ], - 'cflags': [ - '-Wno-unused-function', - ], - 'xcode_settings': { - 'WARNING_CFLAGS': [ '-Wno-unused-function' ], - }, - 'library_dirs': [ - '<!@(python <(python_flags) --library_dirs)', - ], - 'direct_dependent_settings': { - 'variables': { - 'python_binary_modules': [ - '<(python_cython_module)<(module_suffix)=<(module_prefix)<(_target_name)<(module_suffix)', - ], - }, - }, - 'hard_dependency': 1, -} diff --git a/third_party/cython/python_export.h b/third_party/cython/python_export.h deleted file mode 100644 index e943399..0000000 --- a/third_party/cython/python_export.h +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2014 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. - -#if defined(PyMODINIT_FUNC) -#undef PyMODINIT_FUNC -#endif - -#if defined(WIN32) -#define PyMODINIT_FUNC extern "C" __declspec(dllexport) void -#else -#define PyMODINIT_FUNC extern "C" __attribute__((visibility("default"))) void -#endif diff --git a/third_party/cython/python_flags.py b/third_party/cython/python_flags.py deleted file mode 100644 index 03c4ad7..0000000 --- a/third_party/cython/python_flags.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2014 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. - -import argparse -import os -import sys - -from distutils import sysconfig -from distutils.command import build_ext -from distutils.dist import Distribution -from distutils.extension import Extension - -def main(): - """Command line utility to retrieve compilation options for python modules' - """ - parser = argparse.ArgumentParser( - description='Retrieves compilation options for python modules.') - parser.add_argument('--gn', - help='Returns all values in a format suitable for gn', - action='store_true') - parser.add_argument('--libraries', help='Returns libraries', - action='store_true') - parser.add_argument('--includes', help='Returns includes', - action='store_true') - parser.add_argument('--library_dirs', help='Returns library_dirs', - action='store_true') - opts = parser.parse_args() - - ext = Extension('Dummy', []) - b = build_ext.build_ext(Distribution()) - b.initialize_options() - b.finalize_options() - result = [] - if opts.libraries: - libraries = b.get_libraries(ext) - if sys.platform == 'darwin': - libraries += [ '-lpython%s' % sys.version[:3] ] - result = result + libraries - if opts.includes: - result = result + b.include_dirs - if opts.library_dirs: - if sys.platform == 'darwin': - result.append('%s/lib' % sysconfig.get_config_vars('prefix')[0]) - - if opts.gn: - for x in result: - print x - else: - print ''.join(['"%s"' % x for x in result]) - -if __name__ == '__main__': - main() diff --git a/third_party/cython/python_module.gypi b/third_party/cython/python_module.gypi deleted file mode 100644 index aeb5c6a..0000000 --- a/third_party/cython/python_module.gypi +++ /dev/null @@ -1,58 +0,0 @@ -# Copyright 2014 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. - -{ - 'variables': { - 'python_binary_modules%': [], - 'python_module_destination': '<(PRODUCT_DIR)/python/<(python_base_module)', - 'cp': '<(DEPTH)/third_party/cython/cp_python_binary_modules.py', - 'timestamp': '<(SHARED_INTERMEDIATE_DIR)/<(_target_name)_py_module.stamp', - }, - 'rules': [ - { - 'rule_name': '<(_target_name)_cp_python', - 'extension': 'py', - 'inputs': [ - '<(DEPTH)/build/cp.py', - ], - 'outputs': [ - '<(python_module_destination)/<(RULE_INPUT_NAME)', - ], - 'action': [ - 'python', - '<@(_inputs)', - '<(RULE_INPUT_PATH)', - '<@(_outputs)', - ], - 'message': 'Moving <(RULE_INPUT_PATH) to its destination', - } - ], - 'actions': [ - { - 'action_name': '(_target_name)_move_to_python_modules', - 'inputs': [ - '<(cp)', - ], - 'outputs': [ - '<(timestamp)', - ], - 'action': [ - 'python', - '<(cp)', - '<(timestamp)', - '<(PRODUCT_DIR)', - '<(python_module_destination)', - '>@(python_binary_modules)', - ], - }, - ], - 'direct_dependent_settings': { - 'variables': { - 'python_module_timestamps': [ - '<(timestamp)', - ], - }, - }, - 'hard_dependency': 1, -} diff --git a/third_party/cython/rules.gni b/third_party/cython/rules.gni deleted file mode 100644 index 22a56c3..0000000 --- a/third_party/cython/rules.gni +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 2014 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. - -template("python_binary_module") { - # Only available on linux for now. - assert(is_linux) - assert(defined(invoker.sources)) - assert(defined(invoker.python_base_module)) - - cython_root = "//third_party/cython" - cython_script = "$cython_root/src/cython.py" - cython_output = "${target_out_dir}/${target_name}.cc" - - generator_target_name = target_name + "_cython_compiler" - shared_library_name = target_name + "_shared_library" - config_name = target_name + "_python_config" - - if (is_linux) { - shared_library_prefix = "lib" - shared_library_suffix = ".so" - python_module_suffix = ".so" - } - - target_visibility = [ - ":$generator_target_name", - ":$shared_library_name", - ":$target_name", - ] - - action(generator_target_name) { - visibility = target_visibility - script = cython_script - sources = invoker.sources - outputs = [ cython_output ] - args = [ - "--cplus", - "-I", rebase_path("//", root_build_dir), - "-o", rebase_path(cython_output, root_build_dir), - ] + rebase_path(sources, root_build_dir) - } - - config(config_name) { - visibility = target_visibility - python_flags = "//third_party/cython/python_flags.py" - include_dirs = exec_script(python_flags, - [ "--gn", "--includes" ], - "list lines") - libs = exec_script(python_flags, - [ "--gn", "--libraries" ], - "list lines") - lib_dirs = exec_script(python_flags, - [ "--gn", "--library_dirs" ], - "list lines") - } - - shared_library(shared_library_name) { - visibility = target_visibility - deps = [ - ":$generator_target_name", - ] - if (defined(invoker.deps)) { - deps += invoker.deps - } - if (defined(invoker.datadeps)) { - datadeps = invoker.datadeps - } - sources = [ cython_output ] - configs += [ ":$config_name" ] - } - - copy(target_name) { - python_base_module = invoker.python_base_module - sources = [ - "$root_out_dir/${shared_library_prefix}${shared_library_name}${shared_library_suffix}" - ] - outputs = [ - "$root_out_dir/python/$python_base_module/${target_name}${python_module_suffix}" - ] - deps = [ - ":$shared_library_name" - ] - } -} |