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 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 60 | 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 Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 66 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 67 | 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 Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 74 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 75 | 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 Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 81 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 82 | 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 Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 89 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 90 | 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 Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 96 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 97 | 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 Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 104 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 105 | 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 Ren | 174e02a | 2017-11-20 15:24:21 -0800 | [diff] [blame] | 112 | |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 113 | 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 Zhou | 2383322 | 2018-02-05 14:17:57 -0800 | [diff] [blame] | 123 | strip_prefix = "bazel-toolchains-f3b09700fae5d7b6e659d7cefe0dcc6e8498504c", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 124 | urls = [ |
Adele Zhou | 2383322 | 2018-02-05 14:17:57 -0800 | [diff] [blame] | 125 | "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 Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 127 | ], |
Adele Zhou | 2383322 | 2018-02-05 14:17:57 -0800 | [diff] [blame] | 128 | sha256 = "ed829b5eea8af1f405f4cc3d6ecfc3b1365bb7843171036030a31b5127002311", |
Alexander Polcyn | 54a7040 | 2017-11-29 17:06:16 -0800 | [diff] [blame] | 129 | ) |