New package: py-grpcio-tools; add new version of py-grpcio (#27907)

This commit is contained in:
iarspider 2021-12-11 22:35:07 +01:00 committed by GitHub
parent 9875a0e228
commit dc88538e80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,60 @@
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyGrpcioTools(PythonPackage):
"""Protobuf code generator for gRPC"""
homepage = "https://grpc.io/"
pypi = "grpcio-tools/grpcio-tools-1.42.0.tar.gz"
version('1.42.0', sha256='d0a0daa82eb2c2fb8e12b82a458d1b7c5516fe1135551da92b1a02e2cba93422')
version('1.39.0', sha256='39dfe7415bc0d3860fdb8dd90607594b046b88b57dbe64284efa4820f951c805')
depends_on('python@3.6:', type=('build', 'run'))
depends_on('py-setuptools', type='build')
depends_on('py-protobuf@3.5.0.post1:3', type=('build', 'run'))
depends_on('py-grpcio@1.42.0:', type=('build', 'run'), when='@1.42.0:')
depends_on('py-grpcio@1.39.0:', type=('build', 'run'), when='@1.39.0:1.41')
depends_on('py-cython@0.23:', type='build')
depends_on('openssl')
depends_on('zlib')
depends_on('c-ares')
depends_on('re2+shared')
def setup_build_environment(self, env):
env.set('GRPC_PYTHON_BUILD_WITH_CYTHON', True)
env.set('GRPC_PYTHON_BUILD_SYSTEM_OPENSSL', True)
env.set('GRPC_PYTHON_BUILD_SYSTEM_ZLIB', True)
env.set('GRPC_PYTHON_BUILD_SYSTEM_CARES', True)
env.set('GRPC_PYTHON_BUILD_SYSTEM_RE2', True)
# https://github.com/grpc/grpc/pull/24449
env.set('GRPC_BUILD_WITH_BORING_SSL_ASM', '')
env.set('GRPC_PYTHON_BUILD_EXT_COMPILER_JOBS', str(make_jobs))
for dep in self.spec.dependencies(deptype='link'):
query = self.spec[dep.name]
env.prepend_path('LIBRARY_PATH', query.libs.directories[0])
env.prepend_path('CPATH', query.headers.directories[0])
def patch(self):
if self.spec.satisfies('%fj'):
filter_file("-std=gnu99", "", "setup.py")
# use the spack packages
filter_file(r'(\s+SSL_INCLUDE = ).*',
r"\1('{0}',)".format(self.spec['openssl'].prefix.include),
'setup.py')
filter_file(r'(\s+ZLIB_INCLUDE = ).*',
r"\1('{0}',)".format(self.spec['zlib'].prefix.include),
'setup.py')
filter_file(r'(\s+CARES_INCLUDE = ).*',
r"\1('{0}',)".format(self.spec['c-ares'].prefix.include),
'setup.py')
filter_file(r'(\s+RE2_INCLUDE = ).*',
r"\1('{0}',)".format(self.spec['re2'].prefix.include),
'setup.py')

View file

@ -12,6 +12,7 @@ class PyGrpcio(PythonPackage):
homepage = "https://grpc.io/"
pypi = "grpcio/grpcio-1.32.0.tar.gz"
version('1.42.0', sha256='4a8f2c7490fe3696e0cdd566e2f099fb91b51bc75446125175c55581c2f7bc11')
version('1.39.0', sha256='57974361a459d6fe04c9ae0af1845974606612249f467bbd2062d963cb90f407')
version('1.38.1', sha256='1f79d8a24261e3c12ec3a6c25945ff799ae09874fd24815bc17c2dc37715ef6c')
version('1.38.0', sha256='abbf9c8c3df4d5233d5888c6cfa85c1bb68a6923749bd4dd1abc6e1e93986f17')