protobuf: add new versions (#36711)

This commit is contained in:
Adam J. Stewart 2023-04-11 23:47:42 -05:00 committed by GitHub
parent f4658a520c
commit d79423fe9e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 21 deletions

View file

@ -137,6 +137,9 @@ class Paraview(CMakePackage, CudaPackage, ROCmPackage):
msg="Use paraview@5.9.0 with %xl_r. Earlier versions are not able to build with xl.",
)
# Newer abseil-cpp requires C++14, but paraview uses C++11 by default
conflicts("^abseil-cpp@2023:")
# We only support one single Architecture
for _arch, _other_arch in itertools.permutations(CudaPackage.cuda_arch_values, 2):
conflicts(

View file

@ -3,8 +3,6 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
import spack.util.web
from spack.package import *
@ -16,7 +14,9 @@ class Protobuf(CMakePackage):
url = "https://github.com/protocolbuffers/protobuf/archive/v3.18.0.tar.gz"
maintainers("hyoklee")
version("3.22.2", sha256="2118051b4fb3814d59d258533a4e35452934b1ddb41230261c9543384cbb4dfc")
version("3.21.12", sha256="930c2c3b5ecc6c9c12615cf5ad93f1cd6e12d0aba862b572e076259970ac3a53")
version("3.21.9", sha256="1add10f9bd92775b91f326da259f243881e904dd509367d5031d4c782ba82810")
version("3.21.7", sha256="ce2fbea3c78147a41b2a922485d283137845303e5e1b6cbd7ece94b96ade7031")
version("3.21.5", sha256="d7d204a59fd0d2d2387bd362c2155289d5060f32122c4d1d922041b61191d522")
version("3.21.4", sha256="85d42d4485f36f8cec3e475a3b9e841d7d78523cd775de3a86dba77081f4ca25")
@ -78,6 +78,8 @@ class Protobuf(CMakePackage):
values=("Debug", "Release", "RelWithDebInfo"),
)
# https://github.com/protocolbuffers/protobuf/issues/11828#issuecomment-1433557509
depends_on("abseil-cpp@20230125:", when="@3.22:")
depends_on("zlib")
conflicts("%gcc@:4.6", when="@3.6.0:") # Requires c++11
@ -113,12 +115,22 @@ def fetch_remote_versions(self, *args, **kwargs):
def cmake_args(self):
args = [
"-DBUILD_SHARED_LIBS=%s" % int("+shared" in self.spec),
"-Dprotobuf_BUILD_TESTS:BOOL=OFF",
"-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON",
self.define_from_variant("BUILD_SHARED_LIBS", "shared"),
self.define("protobuf_BUILD_TESTS", False),
self.define("CMAKE_POSITION_INDEPENDENT_CODE", True),
]
if sys.platform == "darwin":
args.extend(["-DCMAKE_MACOSX_RPATH=ON"])
if self.spec.satisfies("@3.22:"):
args.extend(
[
self.define("protobuf_ABSL_PROVIDER", "package"),
self.define("CMAKE_CXX_STANDARD", 14),
]
)
if self.spec.satisfies("platform=darwin"):
args.append(self.define("CMAKE_MACOSX_RPATH", True))
return args
@property

View file

@ -19,13 +19,12 @@ class PyProtobuf(PythonPackage):
variant("cpp", default=True, description="Enable the cpp implementation")
# Newer versions seem to require bazel to build?
# https://github.com/protocolbuffers/protobuf/tree/main/python
version("4.21.9", sha256="61f21493d96d2a77f9ca84fefa105872550ab5ef71d21c458eb80edcf4885a99")
version("4.21.7", sha256="71d9dba03ed3432c878a801e2ea51e034b0ea01cf3a4344fb60166cb5f6c8757")
version("4.21.5", sha256="eb1106e87e095628e96884a877a51cdb90087106ee693925ec0a300468a9be3a")
version(
"3.20.1",
sha256="adc31566d027f45efe3f44eeb5b1f329da43891634d61c75a5944e9be6dd42c9",
preferred=True,
)
version("3.20.1", sha256="adc31566d027f45efe3f44eeb5b1f329da43891634d61c75a5944e9be6dd42c9")
version("3.20.0", sha256="71b2c3d1cd26ed1ec7c8196834143258b2ad7f444efff26fdc366c6f5e752702")
version("3.19.4", sha256="9df0c10adf3e83015ced42a9a7bd64e13d06c4cf45c340d2c63020ea04499d0a")
version("3.19.3", sha256="d975a6314fbf5c524d4981e24294739216b5fb81ef3c14b86fb4b045d6690907")
@ -60,10 +59,8 @@ class PyProtobuf(PythonPackage):
version("3.3.0", sha256="1cbcee2c45773f57cb6de7ee0eceb97f92b9b69c0178305509b162c0160c1f04")
version("3.0.0", sha256="ecc40bc30f1183b418fe0ec0c90bc3b53fa1707c4205ee278c6b90479e5b6ff5")
depends_on("python@3.5:", when="@3.18:", type=("build", "run"))
depends_on("python@3.7:", when="@3.20:", type=("build", "run"))
depends_on("py-setuptools", type=("build", "run"))
depends_on("py-six@1.9:", when="@3:", type=("build", "run"))
depends_on("py-six@1.9:", when="@3.0:3.17", type=("build", "run"))
# Setup dependencies for protobuf to use the same minor version as py-protobuf
# Handle mapping the 4.x release to the protobuf 3.x releases
@ -88,9 +85,3 @@ def setup_build_environment(self, env):
@when("+cpp")
def install_options(self, spec, prefix):
return ["--cpp_implementation"]
@run_after("install")
def fix_import_error(self):
if str(self.spec["python"].version.up_to(1)) == "2":
touch = which("touch")
touch(join_path(python_platlib, "google", "__init__.py"))