| Index: third_party/protobuf/python/setup.py
|
| diff --git a/third_party/protobuf/python/setup.py b/third_party/protobuf/python/setup.py
|
| index 8c97439f2ecf27c6d3657fd93569dde58fc0d462..53e8b4a5fa22770546b5a324f5943bf7be98d902 100755
|
| --- a/third_party/protobuf/python/setup.py
|
| +++ b/third_party/protobuf/python/setup.py
|
| @@ -7,7 +7,7 @@
|
| from ez_setup import use_setuptools
|
| use_setuptools()
|
|
|
| -from setuptools import setup
|
| +from setuptools import setup, Extension
|
| from distutils.spawn import find_executable
|
| import sys
|
| import os
|
| @@ -20,6 +20,10 @@ if os.path.exists("../src/protoc"):
|
| protoc = "../src/protoc"
|
| elif os.path.exists("../src/protoc.exe"):
|
| protoc = "../src/protoc.exe"
|
| +elif os.path.exists("../vsprojects/Debug/protoc.exe"):
|
| + protoc = "../vsprojects/Debug/protoc.exe"
|
| +elif os.path.exists("../vsprojects/Release/protoc.exe"):
|
| + protoc = "../vsprojects/Release/protoc.exe"
|
| else:
|
| protoc = find_executable("protoc")
|
|
|
| @@ -56,6 +60,7 @@ def MakeTestSuite():
|
| del sys.modules['google']
|
|
|
| generate_proto("../src/google/protobuf/unittest.proto")
|
| + generate_proto("../src/google/protobuf/unittest_custom_options.proto")
|
| generate_proto("../src/google/protobuf/unittest_import.proto")
|
| generate_proto("../src/google/protobuf/unittest_mset.proto")
|
| generate_proto("../src/google/protobuf/unittest_no_generic_services.proto")
|
| @@ -90,33 +95,55 @@ if __name__ == '__main__':
|
| for (dirpath, dirnames, filenames) in os.walk("."):
|
| for filename in filenames:
|
| filepath = os.path.join(dirpath, filename)
|
| - if filepath.endswith("_pb2.py") or filepath.endswith(".pyc"):
|
| + if filepath.endswith("_pb2.py") or filepath.endswith(".pyc") or \
|
| + filepath.endswith(".so") or filepath.endswith(".o"):
|
| os.remove(filepath)
|
| else:
|
| # Generate necessary .proto file if it doesn't exist.
|
| # TODO(kenton): Maybe we should hook this into a distutils command?
|
| generate_proto("../src/google/protobuf/descriptor.proto")
|
| + generate_proto("../src/google/protobuf/compiler/plugin.proto")
|
| +
|
| + ext_module_list = []
|
| +
|
| + # C++ implementation extension
|
| + if os.getenv("PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION", "python") == "cpp":
|
| + print "Using EXPERIMENTAL C++ Implmenetation."
|
| + ext_module_list.append(Extension(
|
| + "google.protobuf.internal._net_proto2___python",
|
| + [ "google/protobuf/pyext/python_descriptor.cc",
|
| + "google/protobuf/pyext/python_protobuf.cc",
|
| + "google/protobuf/pyext/python-proto2.cc" ],
|
| + include_dirs = [ "../src", ".", ],
|
| + libraries = [ "protobuf" ],
|
| + runtime_library_dirs = [ "../src/.libs" ],
|
| + library_dirs = [ "../src/.libs" ]))
|
|
|
| setup(name = 'protobuf',
|
| - version = '2.3.1-pre',
|
| + version = '2.4.0-pre',
|
| packages = [ 'google' ],
|
| namespace_packages = [ 'google' ],
|
| test_suite = 'setup.MakeTestSuite',
|
| # Must list modules explicitly so that we don't install tests.
|
| py_modules = [
|
| + 'google.protobuf.internal.api_implementation',
|
| 'google.protobuf.internal.containers',
|
| + 'google.protobuf.internal.cpp_message',
|
| 'google.protobuf.internal.decoder',
|
| 'google.protobuf.internal.encoder',
|
| 'google.protobuf.internal.message_listener',
|
| + 'google.protobuf.internal.python_message',
|
| 'google.protobuf.internal.type_checkers',
|
| 'google.protobuf.internal.wire_format',
|
| 'google.protobuf.descriptor',
|
| 'google.protobuf.descriptor_pb2',
|
| + 'google.protobuf.compiler.plugin_pb2',
|
| 'google.protobuf.message',
|
| 'google.protobuf.reflection',
|
| 'google.protobuf.service',
|
| 'google.protobuf.service_reflection',
|
| 'google.protobuf.text_format' ],
|
| + ext_modules = ext_module_list,
|
| url = 'http://code.google.com/p/protobuf/',
|
| maintainer = maintainer_email,
|
| maintainer_email = 'protobuf@googlegroups.com',
|
|
|