xref: /aosp_15_r20/external/tink/cc/integration/gcpkms/tink_cc_gcpkms_deps.bzl (revision e7b1675dde1b92d52ec075b0a92829627f2c52a5)
1"""Tink C++ Cloud KMS Integration Dependencies."""
2
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
4
5def tink_cc_gcpkms_deps():
6    """Loads dependencies for Tink C++ Cloud KMS."""
7
8    # Google PKI certs for connecting to GCP KMS.
9    if not native.existing_rule("google_root_pem"):
10        http_file(
11            name = "google_root_pem",
12            executable = 0,
13            urls = ["https://pki.goog/roots.pem"],
14            sha256 = "9c9b9685ad319b9747c3fe69b46a61c11a0efabdfa09ca6a8b0c3da421036d27",
15        )
16
17    # gRPC needs io_bazel_rules_go.
18    if not native.existing_rule("io_bazel_rules_go"):
19        http_archive(
20            name = "io_bazel_rules_go",
21            sha256 = "f2dcd210c7095febe54b804bb1cd3a58fe8435a909db2ec04e31542631cf715c",
22            urls = [
23                "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.31.0/rules_go-v0.31.0.zip",
24                "https://github.com/bazelbuild/rules_go/releases/download/v0.31.0/rules_go-v0.31.0.zip",
25            ],
26        )
27
28    # gRPC needs rules_apple, which in turn needs rules_swift and apple_support.
29    if not native.existing_rule("build_bazel_rules_apple"):
30        # Release from 2022-09-16.
31        http_archive(
32            name = "build_bazel_rules_apple",
33            sha256 = "90e3b5e8ff942be134e64a83499974203ea64797fd620eddeb71b3a8e1bff681",
34            url = "https://github.com/bazelbuild/rules_apple/releases/download/1.1.2/rules_apple.1.1.2.tar.gz",
35        )
36    if not native.existing_rule("build_bazel_rules_swift"):
37        # Release from 2022-09-16.
38        http_archive(
39            name = "build_bazel_rules_swift",
40            sha256 = "51efdaf85e04e51174de76ef563f255451d5a5cd24c61ad902feeadafc7046d9",
41            url = "https://github.com/bazelbuild/rules_swift/releases/download/1.2.0/rules_swift.1.2.0.tar.gz",
42        )
43    if not native.existing_rule("build_bazel_apple_support"):
44        # Release from 2022-10-31.
45        http_archive(
46            name = "build_bazel_apple_support",
47            sha256 = "2e3dc4d0000e8c2f5782ea7bb53162f37c485b5d8dc62bb3d7d7fc7c276f0d00",
48            url = "https://github.com/bazelbuild/apple_support/releases/download/1.3.2/apple_support.1.3.2.tar.gz",
49        )
50
51    if not native.existing_rule("com_google_googleapis"):
52        # Matches version embedded in com_github_grpc_grpc from 2022-05-11.
53        http_archive(
54            name = "com_google_googleapis",
55            sha256 = "5bb6b0253ccf64b53d6c7249625a7e3f6c3bc6402abd52d3778bfa48258703a0",
56            strip_prefix = "googleapis-2f9af297c84c55c8b871ba4495e01ade42476c92",
57            url = "https://github.com/googleapis/googleapis/archive/2f9af297c84c55c8b871ba4495e01ade42476c92.tar.gz",
58        )
59
60    if not native.existing_rule("upb"):
61        # Matches version embedded in com_github_grpc_grpc from 2022-05-11.
62        http_archive(
63            name = "upb",
64            sha256 = "d0fe259d650bf9547e75896a1307bfc7034195e4ae89f5139814d295991ba681",
65            strip_prefix = "upb-bef53686ec702607971bd3ea4d4fefd80c6cc6e8",
66            url = "https://github.com/protocolbuffers/upb/archive/bef53686ec702607971bd3ea4d4fefd80c6cc6e8.tar.gz",
67        )
68
69    if not native.existing_rule("envoy_api"):
70        # Matches version embedded in com_github_grpc_grpc from 2022-05-11.
71        http_archive(
72            name = "envoy_api",
73            sha256 = "c5807010b67033330915ca5a20483e30538ae5e689aa14b3631d6284beca4630",
74            strip_prefix = "data-plane-api-9c42588c956220b48eb3099d186487c2f04d32ec",
75            url = "https://github.com/envoyproxy/data-plane-api/archive/9c42588c956220b48eb3099d186487c2f04d32ec.tar.gz",
76        )
77
78    if not native.existing_rule("com_envoyproxy_protoc_gen_validate"):
79        # Matches version embedded in com_github_grpc_grpc from 2022-05-11.
80        http_archive(
81            name = "com_envoyproxy_protoc_gen_validate",
82            strip_prefix = "protoc-gen-validate-4694024279bdac52b77e22dc87808bd0fd732b69",
83            sha256 = "1e490b98005664d149b379a9529a6aa05932b8a11b76b4cd86f3d22d76346f47",
84            urls = [
85                "https://github.com/envoyproxy/protoc-gen-validate/archive/4694024279bdac52b77e22dc87808bd0fd732b69.tar.gz",
86            ],
87            patches = ["@com_github_grpc_grpc//third_party:protoc-gen-validate.patch"],
88            patch_args = ["-p1"],
89        )
90
91    if not native.existing_rule("bazel_gazelle"):
92        # Matches version embedded in com_github_grpc_grpc from 2022-05-11.
93        http_archive(
94            name = "bazel_gazelle",
95            sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
96            urls = [
97                "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
98                "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
99            ],
100        )
101
102    if not native.existing_rule("com_github_grpc_grpc"):
103        # Release from 2022-05-11.
104        http_archive(
105            name = "com_github_grpc_grpc",
106            sha256 = "94b104231a7794ceb99760dd481d581ede05b96adbc0042d1eb783514d4e2680",
107            strip_prefix = "grpc-1.46.1",
108            url = "https://github.com/grpc/grpc/archive/v1.46.1.zip",
109        )
110
111    # Not used by Java Tink, but apparently needed for C++ gRPC library.
112    if not native.existing_rule("io_grpc_grpc_java"):
113        # Release from 2022-04-28.
114        http_archive(
115            name = "io_grpc_grpc_java",
116            sha256 = "c1b80883511ceb1e433fb2d4b2f6d85dca0c62a265a6a3e6695144610d6f65b8",
117            strip_prefix = "grpc-java-1.46.0",
118            url = "https://github.com/grpc/grpc-java/archive/v1.46.0.tar.gz",
119        )
120