xref: /aosp_15_r20/external/tink/cc/tink_cc_deps.bzl (revision e7b1675dde1b92d52ec075b0a92829627f2c52a5)
1"""Dependencies of C++ Tink."""
2
3load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4
5def tink_cc_deps():
6    """Loads dependencies of C++ Tink."""
7
8    # Basic rules we need to add to bazel.
9    if not native.existing_rule("bazel_skylib"):
10        # Release from 2022-09-01: https://github.com/bazelbuild/bazel-skylib/releases/tag/1.3.0
11        http_archive(
12            name = "bazel_skylib",
13            urls = [
14                "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
15                "https://github.com/bazelbuild/bazel-skylib/releases/download/1.3.0/bazel-skylib-1.3.0.tar.gz",
16            ],
17            sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
18        )
19
20    # -------------------------------------------------------------------------
21    # Protobuf.
22    # -------------------------------------------------------------------------
23    # proto_library, cc_proto_library and java_proto_library rules implicitly
24    # depend respectively on:
25    #   * @com_google_protobuf//:proto
26    #   * @com_google_protobuf//:cc_toolchain
27    #   * @com_google_protobuf//:java_toolchain
28    # This statement defines the @com_google_protobuf repo.
29    if not native.existing_rule("com_google_protobuf"):
30        # Release X.21.9 from 2022-10-26.
31        http_archive(
32            name = "com_google_protobuf",
33            strip_prefix = "protobuf-21.9",
34            urls = ["https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.9.zip"],
35            sha256 = "5babb8571f1cceafe0c18e13ddb3be556e87e12ceea3463d6b0d0064e6cc1ac3",
36        )
37
38    # -------------------------------------------------------------------------
39    # Abseil.
40    # -------------------------------------------------------------------------
41    if not native.existing_rule("com_google_absl"):
42        # Release from 2023-05-04.
43        http_archive(
44            name = "com_google_absl",
45            strip_prefix = "abseil-cpp-20230125.3",
46            url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.3.zip",
47            sha256 = "51d676b6846440210da48899e4df618a357e6e44ecde7106f1e44ea16ae8adc7",
48        )
49
50    # -------------------------------------------------------------------------
51    # BoringSSL.
52    # -------------------------------------------------------------------------
53    if not native.existing_rule("boringssl"):
54        # Commit from 2023-02-15.
55        http_archive(
56            name = "boringssl",
57            strip_prefix = "boringssl-5c22014ca513807ed03c657e8ede076164663979",
58            url = "https://github.com/google/boringssl/archive/5c22014ca513807ed03c657e8ede076164663979.zip",
59            sha256 = "863fc670c456f30923740c1639305132fdfb9d1b25ba385a67ae3862ef12a8af",
60        )
61
62    # -------------------------------------------------------------------------
63    # GoogleTest/GoogleMock.
64    # -------------------------------------------------------------------------
65    if not native.existing_rule("com_google_googletest"):
66        # Release from 2021-06-11.
67        http_archive(
68            name = "com_google_googletest",
69            strip_prefix = "googletest-release-1.11.0",
70            url = "https://github.com/google/googletest/archive/refs/tags/release-1.11.0.tar.gz",
71            sha256 = "b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5",
72        )
73
74    # -------------------------------------------------------------------------
75    # Wycheproof (depends on Rapidjson).
76    # -------------------------------------------------------------------------
77    if not native.existing_rule("rapidjson"):
78        # Release from 2016-08-25 (still the latest release as of 2022-05-05).
79        http_archive(
80            name = "rapidjson",
81            url = "https://github.com/Tencent/rapidjson/archive/v1.1.0.tar.gz",
82            sha256 = "bf7ced29704a1e696fbccf2a2b4ea068e7774fa37f6d7dd4039d0787f8bed98e",
83            strip_prefix = "rapidjson-1.1.0",
84            build_file = "@tink_cc//:third_party/rapidjson.BUILD.bazel",
85        )
86    if not native.existing_rule("wycheproof"):
87        # Commit from 2019-12-17.
88        http_archive(
89            name = "wycheproof",
90            strip_prefix = "wycheproof-d8ed1ba95ac4c551db67f410c06131c3bc00a97c",
91            url = "https://github.com/google/wycheproof/archive/d8ed1ba95ac4c551db67f410c06131c3bc00a97c.zip",
92            sha256 = "eb1d558071acf1aa6d677d7f1cabec2328d1cf8381496c17185bd92b52ce7545",
93        )
94