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.""" |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 5 | 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 | |
Ian Sturdy | 3a8c0d6 | 2018-03-07 12:11:21 -0800 | [diff] [blame] | 60 | native.bind( |
| 61 | name = "grpc_cpp_plugin", |
| 62 | actual = "@com_github_grpc_grpc//:grpc_cpp_plugin" |
| 63 | ) |
| 64 | |
| 65 | native.bind( |
| 66 | name = "grpc++_codegen_proto", |
| 67 | actual = "@com_github_grpc_grpc//:grpc++_codegen_proto" |
| 68 | ) |
| 69 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 70 | if "boringssl" not in native.existing_rules(): |
| 71 | native.http_archive( |
| 72 | name = "boringssl", |
| 73 | # on the master-with-bazel branch |
| 74 | url = "https://boringssl.googlesource.com/boringssl/+archive/886e7d75368e3f4fab3f4d0d3584e4abfc557755.tar.gz", |
| 75 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 76 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 77 | if "com_github_madler_zlib" not in native.existing_rules(): |
| 78 | native.new_http_archive( |
| 79 | name = "com_github_madler_zlib", |
| 80 | build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD", |
| 81 | strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f", |
| 82 | url = "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz", |
| 83 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 84 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 85 | if "com_google_protobuf" not in native.existing_rules(): |
| 86 | native.http_archive( |
| 87 | name = "com_google_protobuf", |
Mehrdad Afshari | 8a2c601 | 2018-04-19 01:41:26 -0400 | [diff] [blame] | 88 | strip_prefix = "protobuf-b5fbb742af122b565925987e65c08957739976a7", |
| 89 | url = "https://github.com/google/protobuf/archive/b5fbb742af122b565925987e65c08957739976a7.tar.gz", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 90 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 91 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 92 | if "com_github_google_googletest" not in native.existing_rules(): |
| 93 | native.new_http_archive( |
| 94 | name = "com_github_google_googletest", |
| 95 | build_file = "@com_github_grpc_grpc//third_party:gtest.BUILD", |
| 96 | strip_prefix = "googletest-ec44c6c1675c25b9827aacd08c02433cccde7780", |
| 97 | url = "https://github.com/google/googletest/archive/ec44c6c1675c25b9827aacd08c02433cccde7780.tar.gz", |
| 98 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 99 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 100 | if "com_github_gflags_gflags" not in native.existing_rules(): |
| 101 | native.http_archive( |
| 102 | name = "com_github_gflags_gflags", |
| 103 | strip_prefix = "gflags-30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e", |
| 104 | url = "https://github.com/gflags/gflags/archive/30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e.tar.gz", |
| 105 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 106 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 107 | if "com_github_google_benchmark" not in native.existing_rules(): |
| 108 | native.new_http_archive( |
| 109 | name = "com_github_google_benchmark", |
| 110 | build_file = "@com_github_grpc_grpc//third_party:benchmark.BUILD", |
| 111 | strip_prefix = "benchmark-5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8", |
| 112 | url = "https://github.com/google/benchmark/archive/5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8.tar.gz", |
| 113 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 114 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 115 | if "com_github_cares_cares" not in native.existing_rules(): |
| 116 | native.new_http_archive( |
| 117 | name = "com_github_cares_cares", |
| 118 | build_file = "@com_github_grpc_grpc//third_party:cares/cares.BUILD", |
| 119 | strip_prefix = "c-ares-3be1924221e1326df520f8498d704a5c4c8d0cce", |
| 120 | url = "https://github.com/c-ares/c-ares/archive/3be1924221e1326df520f8498d704a5c4c8d0cce.tar.gz", |
| 121 | ) |
Ning Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 122 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 123 | if "com_google_absl" not in native.existing_rules(): |
| 124 | native.http_archive( |
| 125 | name = "com_google_absl", |
| 126 | strip_prefix = "abseil-cpp-cc4bed2d74f7c8717e31f9579214ab52a9c9c610", |
| 127 | url = "https://github.com/abseil/abseil-cpp/archive/cc4bed2d74f7c8717e31f9579214ab52a9c9c610.tar.gz", |
| 128 | ) |
| 129 | |
| 130 | if "com_github_bazelbuild_bazeltoolchains" not in native.existing_rules(): |
| 131 | native.http_archive( |
| 132 | name = "com_github_bazelbuild_bazeltoolchains", |
Adele Zhou | bc690e0 | 2018-04-10 10:39:01 -0700 | [diff] [blame] | 133 | strip_prefix = "bazel-toolchains-44200e0c026d86c53470d107b3697a3e46469c43", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 134 | urls = [ |
Adele Zhou | bc690e0 | 2018-04-10 10:39:01 -0700 | [diff] [blame] | 135 | "https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/44200e0c026d86c53470d107b3697a3e46469c43.tar.gz", |
| 136 | "https://github.com/bazelbuild/bazel-toolchains/archive/44200e0c026d86c53470d107b3697a3e46469c43.tar.gz", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 137 | ], |
Adele Zhou | bc690e0 | 2018-04-10 10:39:01 -0700 | [diff] [blame] | 138 | sha256 = "699b55a6916c687f4b7dc092dbbf5f64672cde0dc965f79717735ec4e5416556", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 139 | ) |
Alex Polcyn | aa56034 | 2018-02-12 23:13:13 +0000 | [diff] [blame] | 140 | |
| 141 | # TODO: move some dependencies from "grpc_deps" here? |
| 142 | def grpc_test_only_deps(): |
| 143 | """Internal, not intended for use by packages that are consuming grpc. |
| 144 | Loads dependencies that are only needed to run grpc library's tests.""" |
| 145 | native.bind( |
| 146 | name = "twisted", |
| 147 | actual = "@com_github_twisted_twisted//:twisted", |
| 148 | ) |
| 149 | |
| 150 | native.bind( |
| 151 | name = "yaml", |
| 152 | actual = "@com_github_yaml_pyyaml//:yaml", |
| 153 | ) |
| 154 | |
| 155 | if "com_github_twisted_twisted" not in native.existing_rules(): |
| 156 | native.new_http_archive( |
| 157 | name = "com_github_twisted_twisted", |
| 158 | strip_prefix = "twisted-twisted-17.5.0", |
| 159 | url = "https://github.com/twisted/twisted/archive/twisted-17.5.0.zip", |
| 160 | build_file = "@com_github_grpc_grpc//third_party:twisted.BUILD", |
| 161 | ) |
| 162 | |
| 163 | if "com_github_yaml_pyyaml" not in native.existing_rules(): |
| 164 | native.new_http_archive( |
| 165 | name = "com_github_yaml_pyyaml", |
| 166 | strip_prefix = "pyyaml-3.12", |
| 167 | url = "https://github.com/yaml/pyyaml/archive/3.12.zip", |
| 168 | build_file = "@com_github_grpc_grpc//third_party:yaml.BUILD", |
| 169 | ) |
| 170 | |
| 171 | if "com_github_twisted_incremental" not in native.existing_rules(): |
| 172 | native.new_http_archive( |
| 173 | name = "com_github_twisted_incremental", |
| 174 | strip_prefix = "incremental-incremental-17.5.0", |
| 175 | url = "https://github.com/twisted/incremental/archive/incremental-17.5.0.zip", |
| 176 | build_file = "@com_github_grpc_grpc//third_party:incremental.BUILD", |
| 177 | ) |
| 178 | |
| 179 | if "com_github_zopefoundation_zope_interface" not in native.existing_rules(): |
| 180 | native.new_http_archive( |
| 181 | name = "com_github_zopefoundation_zope_interface", |
| 182 | strip_prefix = "zope.interface-4.4.3", |
| 183 | url = "https://github.com/zopefoundation/zope.interface/archive/4.4.3.zip", |
| 184 | build_file = "@com_github_grpc_grpc//third_party:zope_interface.BUILD", |
| 185 | ) |
| 186 | |
| 187 | if "com_github_twisted_constantly" not in native.existing_rules(): |
| 188 | native.new_http_archive( |
| 189 | name = "com_github_twisted_constantly", |
| 190 | strip_prefix = "constantly-15.1.0", |
| 191 | url = "https://github.com/twisted/constantly/archive/15.1.0.zip", |
| 192 | build_file = "@com_github_grpc_grpc//third_party:constantly.BUILD", |
| 193 | ) |