blob: 47d33085a2ea5711f0c0881b0229c4dc97707575 [file] [log] [blame]
Alexander Polcyn54a70402017-11-29 17:06:16 -08001"""Load dependencies needed to compile and test the grpc library as a 3rd-party consumer."""
Ning Ren174e02a2017-11-20 15:24:21 -08002
Alexander Polcyn54a70402017-11-29 17:06:16 -08003def grpc_deps():
4 """Loads dependencies need to compile and test the grpc library."""
Ning Ren174e02a2017-11-20 15:24:21 -08005 native.bind(
6 name = "libssl",
7 actual = "@boringssl//:ssl",
8 )
9
10 native.bind(
11 name = "zlib",
12 actual = "@com_github_madler_zlib//:z",
13 )
14
15 native.bind(
16 name = "protobuf",
17 actual = "@com_google_protobuf//:protobuf",
18 )
19
20 native.bind(
21 name = "protobuf_clib",
22 actual = "@com_google_protobuf//:protoc_lib",
23 )
24
25 native.bind(
26 name = "protobuf_headers",
27 actual = "@com_google_protobuf//:protobuf_headers",
28 )
29
30 native.bind(
31 name = "protocol_compiler",
32 actual = "@com_google_protobuf//:protoc",
33 )
34
35 native.bind(
36 name = "cares",
37 actual = "@com_github_cares_cares//:ares",
38 )
39
40 native.bind(
41 name = "gtest",
42 actual = "@com_github_google_googletest//:gtest",
43 )
44
45 native.bind(
46 name = "gmock",
47 actual = "@com_github_google_googletest//:gmock",
48 )
49
50 native.bind(
51 name = "benchmark",
52 actual = "@com_github_google_benchmark//:benchmark",
53 )
54
55 native.bind(
56 name = "gflags",
57 actual = "@com_github_gflags_gflags//:gflags",
58 )
59
Alexander Polcyn54a70402017-11-29 17:06:16 -080060 if "boringssl" not in native.existing_rules():
61 native.http_archive(
62 name = "boringssl",
63 # on the master-with-bazel branch
64 url = "https://boringssl.googlesource.com/boringssl/+archive/886e7d75368e3f4fab3f4d0d3584e4abfc557755.tar.gz",
65 )
Ning Ren174e02a2017-11-20 15:24:21 -080066
Alexander Polcyn54a70402017-11-29 17:06:16 -080067 if "com_github_madler_zlib" not in native.existing_rules():
68 native.new_http_archive(
69 name = "com_github_madler_zlib",
70 build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD",
71 strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f",
72 url = "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz",
73 )
Ning Ren174e02a2017-11-20 15:24:21 -080074
Alexander Polcyn54a70402017-11-29 17:06:16 -080075 if "com_google_protobuf" not in native.existing_rules():
76 native.http_archive(
77 name = "com_google_protobuf",
78 strip_prefix = "protobuf-2761122b810fe8861004ae785cc3ab39f384d342",
79 url = "https://github.com/google/protobuf/archive/2761122b810fe8861004ae785cc3ab39f384d342.tar.gz",
80 )
Ning Ren174e02a2017-11-20 15:24:21 -080081
Alexander Polcyn54a70402017-11-29 17:06:16 -080082 if "com_github_google_googletest" not in native.existing_rules():
83 native.new_http_archive(
84 name = "com_github_google_googletest",
85 build_file = "@com_github_grpc_grpc//third_party:gtest.BUILD",
86 strip_prefix = "googletest-ec44c6c1675c25b9827aacd08c02433cccde7780",
87 url = "https://github.com/google/googletest/archive/ec44c6c1675c25b9827aacd08c02433cccde7780.tar.gz",
88 )
Ning Ren174e02a2017-11-20 15:24:21 -080089
Alexander Polcyn54a70402017-11-29 17:06:16 -080090 if "com_github_gflags_gflags" not in native.existing_rules():
91 native.http_archive(
92 name = "com_github_gflags_gflags",
93 strip_prefix = "gflags-30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e",
94 url = "https://github.com/gflags/gflags/archive/30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e.tar.gz",
95 )
Ning Ren174e02a2017-11-20 15:24:21 -080096
Alexander Polcyn54a70402017-11-29 17:06:16 -080097 if "com_github_google_benchmark" not in native.existing_rules():
98 native.new_http_archive(
99 name = "com_github_google_benchmark",
100 build_file = "@com_github_grpc_grpc//third_party:benchmark.BUILD",
101 strip_prefix = "benchmark-5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8",
102 url = "https://github.com/google/benchmark/archive/5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8.tar.gz",
103 )
Ning Ren174e02a2017-11-20 15:24:21 -0800104
Alexander Polcyn54a70402017-11-29 17:06:16 -0800105 if "com_github_cares_cares" not in native.existing_rules():
106 native.new_http_archive(
107 name = "com_github_cares_cares",
108 build_file = "@com_github_grpc_grpc//third_party:cares/cares.BUILD",
109 strip_prefix = "c-ares-3be1924221e1326df520f8498d704a5c4c8d0cce",
110 url = "https://github.com/c-ares/c-ares/archive/3be1924221e1326df520f8498d704a5c4c8d0cce.tar.gz",
111 )
Ning Ren174e02a2017-11-20 15:24:21 -0800112
Alexander Polcyn54a70402017-11-29 17:06:16 -0800113 if "com_google_absl" not in native.existing_rules():
114 native.http_archive(
115 name = "com_google_absl",
116 strip_prefix = "abseil-cpp-cc4bed2d74f7c8717e31f9579214ab52a9c9c610",
117 url = "https://github.com/abseil/abseil-cpp/archive/cc4bed2d74f7c8717e31f9579214ab52a9c9c610.tar.gz",
118 )
119
120 if "com_github_bazelbuild_bazeltoolchains" not in native.existing_rules():
121 native.http_archive(
122 name = "com_github_bazelbuild_bazeltoolchains",
Adele Zhou23833222018-02-05 14:17:57 -0800123 strip_prefix = "bazel-toolchains-f3b09700fae5d7b6e659d7cefe0dcc6e8498504c",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800124 urls = [
Adele Zhou23833222018-02-05 14:17:57 -0800125 "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/f3b09700fae5d7b6e659d7cefe0dcc6e8498504c.tar.gz",
126 "https://github.com/bazelbuild/bazel-toolchains/archive/f3b09700fae5d7b6e659d7cefe0dcc6e8498504c.tar.gz",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800127 ],
Adele Zhou23833222018-02-05 14:17:57 -0800128 sha256 = "ed829b5eea8af1f405f4cc3d6ecfc3b1365bb7843171036030a31b5127002311",
Alexander Polcyn54a70402017-11-29 17:06:16 -0800129 )