From 0cc27920f8a54aa1b658be43b1b1a16ff9de21f0 Mon Sep 17 00:00:00 2001 From: Masood Malekghassemi Date: Fri, 22 Jan 2016 16:32:41 -0800 Subject: [PATCH] Integrate zlib into Python distribution --- PYTHON-MANIFEST.in | 1 + build.yaml | 1 + setup.py | 5 +++-- src/python/grpcio/grpc_core_dependencies.py | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/PYTHON-MANIFEST.in b/PYTHON-MANIFEST.in index 02bd9b52294..52ef1aba5b3 100644 --- a/PYTHON-MANIFEST.in +++ b/PYTHON-MANIFEST.in @@ -3,6 +3,7 @@ graft src/python/grpcio/tests graft src/core graft include/grpc graft third_party/boringssl +graft third_party/zlib include src/python/grpcio/commands.py include src/python/grpcio/grpc_core_dependencies.py include src/python/grpcio/README.rst diff --git a/build.yaml b/build.yaml index c05dde812e0..500ec855ae4 100644 --- a/build.yaml +++ b/build.yaml @@ -2636,3 +2636,4 @@ python_dependencies: - grpc - gpr - boringssl + - z diff --git a/setup.py b/setup.py index 63b56f35327..c54ac221297 100644 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ egg_info.manifest_maker.template = 'PYTHON-MANIFEST.in' PYTHON_STEM = './src/python/grpcio' CORE_INCLUDE = ('./include', '.',) BORINGSSL_INCLUDE = ('./third_party/boringssl/include',) +ZLIB_INCLUDE = ('./third_party/zlib',) # Ensure we're in the proper directory whether or not we're being used by pip. os.chdir(os.path.dirname(os.path.abspath(__file__))) @@ -75,9 +76,9 @@ CYTHON_EXTENSION_PACKAGE_NAMES = () CYTHON_EXTENSION_MODULE_NAMES = ('grpc._cython.cygrpc',) EXTENSION_INCLUDE_DIRECTORIES = ( - (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE) + (PYTHON_STEM,) + CORE_INCLUDE + BORINGSSL_INCLUDE + ZLIB_INCLUDE) -EXTENSION_LIBRARIES = ('z', 'm',) +EXTENSION_LIBRARIES = ('m',) if not "darwin" in sys.platform: EXTENSION_LIBRARIES += ('rt',) diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py index 66a55ef3e58..98ab1ff7f0e 100644 --- a/src/python/grpcio/grpc_core_dependencies.py +++ b/src/python/grpcio/grpc_core_dependencies.py @@ -517,4 +517,19 @@ CORE_SOURCE_FILES = [ 'third_party/boringssl/ssl/t1_enc.c', 'third_party/boringssl/ssl/t1_lib.c', 'third_party/boringssl/ssl/tls_record.c', + 'third_party/zlib/adler32.c', + 'third_party/zlib/compress.c', + 'third_party/zlib/crc32.c', + 'third_party/zlib/deflate.c', + 'third_party/zlib/gzclose.c', + 'third_party/zlib/gzlib.c', + 'third_party/zlib/gzread.c', + 'third_party/zlib/gzwrite.c', + 'third_party/zlib/infback.c', + 'third_party/zlib/inffast.c', + 'third_party/zlib/inflate.c', + 'third_party/zlib/inftrees.c', + 'third_party/zlib/trees.c', + 'third_party/zlib/uncompr.c', + 'third_party/zlib/zutil.c', ]