Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 1 | """Load dependencies needed to compile and test the grpc library as a 3rd-party consumer.""" |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 2 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 3 | def grpc_deps(): |
| 4 | """Loads dependencies need to compile and test the grpc library.""" |
David Garcia Quintas | 483b4b7 | 2018-05-31 16:45:03 -0700 | [diff] [blame] | 5 | |
| 6 | native.bind( |
| 7 | name = "nanopb", |
David Garcia Quintas | 00e045d | 2018-06-01 15:44:03 -0700 | [diff] [blame] | 8 | actual = "@com_github_nanopb_nanopb//:nanopb", |
David Garcia Quintas | 483b4b7 | 2018-05-31 16:45:03 -0700 | [diff] [blame] | 9 | ) |
| 10 | |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 11 | native.bind( |
Vizerai | 41e4ced | 2018-04-13 18:19:21 -0700 | [diff] [blame] | 12 | name = "absl-base", |
| 13 | actual = "@com_google_absl//absl/base", |
| 14 | ) |
| 15 | |
| 16 | native.bind( |
| 17 | name = "absl-time", |
| 18 | actual = "@com_google_absl//absl/time:time", |
| 19 | ) |
| 20 | |
| 21 | native.bind( |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 22 | name = "libssl", |
| 23 | actual = "@boringssl//:ssl", |
| 24 | ) |
| 25 | |
| 26 | native.bind( |
| 27 | name = "zlib", |
| 28 | actual = "@com_github_madler_zlib//:z", |
| 29 | ) |
| 30 | |
| 31 | native.bind( |
| 32 | name = "protobuf", |
| 33 | actual = "@com_google_protobuf//:protobuf", |
| 34 | ) |
| 35 | |
| 36 | native.bind( |
| 37 | name = "protobuf_clib", |
| 38 | actual = "@com_google_protobuf//:protoc_lib", |
| 39 | ) |
| 40 | |
| 41 | native.bind( |
| 42 | name = "protobuf_headers", |
| 43 | actual = "@com_google_protobuf//:protobuf_headers", |
| 44 | ) |
| 45 | |
| 46 | native.bind( |
| 47 | name = "protocol_compiler", |
| 48 | actual = "@com_google_protobuf//:protoc", |
| 49 | ) |
| 50 | |
| 51 | native.bind( |
| 52 | name = "cares", |
| 53 | actual = "@com_github_cares_cares//:ares", |
| 54 | ) |
| 55 | |
| 56 | native.bind( |
| 57 | name = "gtest", |
| 58 | actual = "@com_github_google_googletest//:gtest", |
| 59 | ) |
| 60 | |
| 61 | native.bind( |
| 62 | name = "gmock", |
| 63 | actual = "@com_github_google_googletest//:gmock", |
| 64 | ) |
| 65 | |
| 66 | native.bind( |
| 67 | name = "benchmark", |
| 68 | actual = "@com_github_google_benchmark//:benchmark", |
| 69 | ) |
| 70 | |
| 71 | native.bind( |
| 72 | name = "gflags", |
| 73 | actual = "@com_github_gflags_gflags//:gflags", |
| 74 | ) |
| 75 | |
Ian Sturdy | 3a8c0d6 | 2018-03-07 12:11:21 -0800 | [diff] [blame] | 76 | native.bind( |
| 77 | name = "grpc_cpp_plugin", |
David Garcia Quintas | 483b4b7 | 2018-05-31 16:45:03 -0700 | [diff] [blame] | 78 | actual = "@com_github_grpc_grpc//:grpc_cpp_plugin", |
Ian Sturdy | 3a8c0d6 | 2018-03-07 12:11:21 -0800 | [diff] [blame] | 79 | ) |
| 80 | |
| 81 | native.bind( |
| 82 | name = "grpc++_codegen_proto", |
David Garcia Quintas | 483b4b7 | 2018-05-31 16:45:03 -0700 | [diff] [blame] | 83 | actual = "@com_github_grpc_grpc//:grpc++_codegen_proto", |
Ian Sturdy | 3a8c0d6 | 2018-03-07 12:11:21 -0800 | [diff] [blame] | 84 | ) |
| 85 | |
Vizerai | 41e4ced | 2018-04-13 18:19:21 -0700 | [diff] [blame] | 86 | native.bind( |
| 87 | name = "opencensus-trace", |
| 88 | actual = "@io_opencensus_cpp//opencensus/trace:trace" |
| 89 | ) |
| 90 | |
| 91 | native.bind( |
| 92 | name = "opencensus-stats", |
| 93 | actual = "@io_opencensus_cpp//opencensus/stats:stats" |
| 94 | ) |
| 95 | |
| 96 | native.bind( |
| 97 | name = "opencensus-stats-test", |
| 98 | actual = "@io_opencensus_cpp//opencensus/stats:test_utils" |
| 99 | ) |
| 100 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 101 | if "boringssl" not in native.existing_rules(): |
| 102 | native.http_archive( |
| 103 | name = "boringssl", |
Jan Tattermusch | 7f0a4ba | 2018-05-07 20:05:23 +0200 | [diff] [blame] | 104 | # on the chromium-stable-with-bazel branch |
| 105 | url = "https://boringssl.googlesource.com/boringssl/+archive/dcd3e6e6ecddf059adb48fca45bc7346a108bdd9.tar.gz", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 106 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 107 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 108 | if "com_github_madler_zlib" not in native.existing_rules(): |
| 109 | native.new_http_archive( |
| 110 | name = "com_github_madler_zlib", |
| 111 | build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD", |
| 112 | strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f", |
| 113 | url = "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz", |
| 114 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 115 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 116 | if "com_google_protobuf" not in native.existing_rules(): |
| 117 | native.http_archive( |
| 118 | name = "com_google_protobuf", |
Mehrdad Afshari | 8a2c601 | 2018-04-19 01:41:26 -0400 | [diff] [blame] | 119 | strip_prefix = "protobuf-b5fbb742af122b565925987e65c08957739976a7", |
| 120 | url = "https://github.com/google/protobuf/archive/b5fbb742af122b565925987e65c08957739976a7.tar.gz", |
David Garcia Quintas | 00e045d | 2018-06-01 15:44:03 -0700 | [diff] [blame] | 121 | ) |
| 122 | |
| 123 | if "com_github_nanopb_nanopb" not in native.existing_rules(): |
| 124 | native.new_http_archive( |
| 125 | name = "com_github_nanopb_nanopb", |
| 126 | build_file = "@com_github_grpc_grpc//third_party:nanopb.BUILD", |
| 127 | strip_prefix = "nanopb-f8ac463766281625ad710900479130c7fcb4d63b", |
| 128 | url = "https://github.com/nanopb/nanopb/archive/f8ac463766281625ad710900479130c7fcb4d63b.tar.gz", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 129 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 130 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 131 | if "com_github_google_googletest" not in native.existing_rules(): |
| 132 | native.new_http_archive( |
| 133 | name = "com_github_google_googletest", |
| 134 | build_file = "@com_github_grpc_grpc//third_party:gtest.BUILD", |
| 135 | strip_prefix = "googletest-ec44c6c1675c25b9827aacd08c02433cccde7780", |
| 136 | url = "https://github.com/google/googletest/archive/ec44c6c1675c25b9827aacd08c02433cccde7780.tar.gz", |
| 137 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 138 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 139 | if "com_github_gflags_gflags" not in native.existing_rules(): |
| 140 | native.http_archive( |
| 141 | name = "com_github_gflags_gflags", |
| 142 | strip_prefix = "gflags-30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e", |
| 143 | url = "https://github.com/gflags/gflags/archive/30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e.tar.gz", |
| 144 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 145 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 146 | if "com_github_google_benchmark" not in native.existing_rules(): |
| 147 | native.new_http_archive( |
| 148 | name = "com_github_google_benchmark", |
| 149 | build_file = "@com_github_grpc_grpc//third_party:benchmark.BUILD", |
Vizerai | 41e4ced | 2018-04-13 18:19:21 -0700 | [diff] [blame] | 150 | strip_prefix = "benchmark-9913418d323e64a0111ca0da81388260c2bbe1e9", |
| 151 | url = "https://github.com/google/benchmark/archive/9913418d323e64a0111ca0da81388260c2bbe1e9.tar.gz", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 152 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 153 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 154 | if "com_github_cares_cares" not in native.existing_rules(): |
| 155 | native.new_http_archive( |
| 156 | name = "com_github_cares_cares", |
| 157 | build_file = "@com_github_grpc_grpc//third_party:cares/cares.BUILD", |
| 158 | strip_prefix = "c-ares-3be1924221e1326df520f8498d704a5c4c8d0cce", |
| 159 | url = "https://github.com/c-ares/c-ares/archive/3be1924221e1326df520f8498d704a5c4c8d0cce.tar.gz", |
| 160 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 161 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 162 | if "com_google_absl" not in native.existing_rules(): |
| 163 | native.http_archive( |
| 164 | name = "com_google_absl", |
Vizerai | 41e4ced | 2018-04-13 18:19:21 -0700 | [diff] [blame] | 165 | strip_prefix = "abseil-cpp-cd95e71df6eaf8f2a282b1da556c2cf1c9b09207", |
| 166 | url = "https://github.com/abseil/abseil-cpp/archive/cd95e71df6eaf8f2a282b1da556c2cf1c9b09207.tar.gz", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 167 | ) |
| 168 | |
| 169 | if "com_github_bazelbuild_bazeltoolchains" not in native.existing_rules(): |
| 170 | native.http_archive( |
| 171 | name = "com_github_bazelbuild_bazeltoolchains", |
Adele Zhou | 304ff8f | 2018-05-25 15:50:45 -0700 | [diff] [blame] | 172 | strip_prefix = "bazel-toolchains-4653c01284d8a4a536f8f9bb47b7d10f94c549e7", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 173 | urls = [ |
Adele Zhou | 304ff8f | 2018-05-25 15:50:45 -0700 | [diff] [blame] | 174 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/4653c01284d8a4a536f8f9bb47b7d10f94c549e7.tar.gz", |
| 175 | "https://github.com/bazelbuild/bazel-toolchains/archive/4653c01284d8a4a536f8f9bb47b7d10f94c549e7.tar.gz", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 176 | ], |
Adele Zhou | 304ff8f | 2018-05-25 15:50:45 -0700 | [diff] [blame] | 177 | sha256 = "1c4a532b396c698e6467a1548554571cb85fa091e472b05e398ebc836c315d77", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 178 | ) |
Alex Polcyn | aa56034 | 2018-02-12 23:13:13 +0000 | [diff] [blame] | 179 | |
Vizerai | 41e4ced | 2018-04-13 18:19:21 -0700 | [diff] [blame] | 180 | if "io_opencensus_cpp" not in native.existing_rules(): |
| 181 | native.http_archive( |
| 182 | name = "io_opencensus_cpp", |
| 183 | strip_prefix = "opencensus-cpp-fdf0f308b1631bb4a942e32ba5d22536a6170274", |
| 184 | url = "https://github.com/census-instrumentation/opencensus-cpp/archive/fdf0f308b1631bb4a942e32ba5d22536a6170274.tar.gz", |
| 185 | ) |
| 186 | |
| 187 | |
Alex Polcyn | aa56034 | 2018-02-12 23:13:13 +0000 | [diff] [blame] | 188 | # TODO: move some dependencies from "grpc_deps" here? |
| 189 | def grpc_test_only_deps(): |
| 190 | """Internal, not intended for use by packages that are consuming grpc. |
| 191 | Loads dependencies that are only needed to run grpc library's tests.""" |
| 192 | native.bind( |
| 193 | name = "twisted", |
| 194 | actual = "@com_github_twisted_twisted//:twisted", |
| 195 | ) |
| 196 | |
| 197 | native.bind( |
| 198 | name = "yaml", |
| 199 | actual = "@com_github_yaml_pyyaml//:yaml", |
| 200 | ) |
| 201 | |
| 202 | if "com_github_twisted_twisted" not in native.existing_rules(): |
| 203 | native.new_http_archive( |
| 204 | name = "com_github_twisted_twisted", |
| 205 | strip_prefix = "twisted-twisted-17.5.0", |
| 206 | url = "https://github.com/twisted/twisted/archive/twisted-17.5.0.zip", |
| 207 | build_file = "@com_github_grpc_grpc//third_party:twisted.BUILD", |
| 208 | ) |
| 209 | |
| 210 | if "com_github_yaml_pyyaml" not in native.existing_rules(): |
| 211 | native.new_http_archive( |
| 212 | name = "com_github_yaml_pyyaml", |
| 213 | strip_prefix = "pyyaml-3.12", |
| 214 | url = "https://github.com/yaml/pyyaml/archive/3.12.zip", |
| 215 | build_file = "@com_github_grpc_grpc//third_party:yaml.BUILD", |
| 216 | ) |
| 217 | |
| 218 | if "com_github_twisted_incremental" not in native.existing_rules(): |
| 219 | native.new_http_archive( |
| 220 | name = "com_github_twisted_incremental", |
| 221 | strip_prefix = "incremental-incremental-17.5.0", |
| 222 | url = "https://github.com/twisted/incremental/archive/incremental-17.5.0.zip", |
| 223 | build_file = "@com_github_grpc_grpc//third_party:incremental.BUILD", |
| 224 | ) |
| 225 | |
| 226 | if "com_github_zopefoundation_zope_interface" not in native.existing_rules(): |
| 227 | native.new_http_archive( |
| 228 | name = "com_github_zopefoundation_zope_interface", |
| 229 | strip_prefix = "zope.interface-4.4.3", |
| 230 | url = "https://github.com/zopefoundation/zope.interface/archive/4.4.3.zip", |
| 231 | build_file = "@com_github_grpc_grpc//third_party:zope_interface.BUILD", |
| 232 | ) |
| 233 | |
| 234 | if "com_github_twisted_constantly" not in native.existing_rules(): |
| 235 | native.new_http_archive( |
| 236 | name = "com_github_twisted_constantly", |
| 237 | strip_prefix = "constantly-15.1.0", |
| 238 | url = "https://github.com/twisted/constantly/archive/15.1.0.zip", |
| 239 | build_file = "@com_github_grpc_grpc//third_party:constantly.BUILD", |
| 240 | ) |