Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 1 | # Copyright 2020 The Bazel Authors. All rights reserved. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http:#www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | """List the distribution dependencies we need to build Bazel.""" |
| 15 | |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame^] | 16 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 17 | |
| 18 | def dist_http_archive(name, **kwargs): |
| 19 | """Wraps http_archive but takes sha and urls from DIST_DEPS. |
| 20 | |
| 21 | dist_http_archive wraps an http_archive invocation, but looks up relevant |
| 22 | information from DIST_DEPS so the user does not have to specify it. It |
| 23 | always strips sha256 and urls from kwargs. |
| 24 | |
| 25 | Args: |
| 26 | name: repo name |
| 27 | **kwargs: see http_archive for allowed args. |
| 28 | """ |
| 29 | info = DIST_DEPS[name] |
| 30 | if "patches" not in kwargs: |
| 31 | kwargs["patches"] = info.get("patches") |
| 32 | if "strip_prefix" not in kwargs: |
| 33 | kwargs["strip_prefix"] = info.get("strip_prefix") |
| 34 | http_archive( |
| 35 | name = name, |
| 36 | sha256 = info["sha256"], |
| 37 | urls = info["urls"], |
| 38 | **kwargs |
| 39 | ) |
| 40 | |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 41 | DIST_DEPS = { |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame^] | 42 | ######################################## |
| 43 | # |
| 44 | # Runtime language dependencies |
| 45 | # |
| 46 | ######################################## |
| 47 | # Keep in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/cc_configure.WORKSPACE. |
| 48 | # Keep in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. |
| 49 | # Note: This is not in sync with src/test/java/com/google/devtools/build/lib/blackbox/framework/BlackBoxTestEnvironment.java. |
| 50 | # Perhaps it should be. |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 51 | "rules_cc": { |
| 52 | "archive": "b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 53 | "sha256": "d0c573b94a6ef20ef6ff20154a23d0efcb409fb0e1ff0979cec318dfe42f0cdd", |
| 54 | "strip_prefix": "rules_cc-b1c40e1de81913a3c40e5948f78719c28152486d", |
| 55 | "urls": [ |
| 56 | "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 57 | "https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| 58 | ], |
| 59 | "need_in_test_WORKSPACE": True, |
| 60 | }, |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame^] | 61 | ######################################## |
| 62 | # |
| 63 | # Build time dependencies |
| 64 | # |
| 65 | ######################################## |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 66 | "rules_pkg": { |
| 67 | "archive": "rules_pkg-0.2.4.tar.gz", |
| 68 | "sha256": "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a", |
| 69 | "urls": [ |
| 70 | "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz", |
| 71 | "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz", |
| 72 | ], |
| 73 | }, |
Tony Aiuto | 1c9e7ca | 2021-01-05 08:01:21 -0800 | [diff] [blame^] | 74 | # for Stardoc |
| 75 | "io_bazel_rules_sass": { |
| 76 | "archive": "1.25.0.zip", |
| 77 | "sha256": "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", |
| 78 | "strip_prefix": "rules_sass-1.25.0", |
| 79 | "urls": [ |
| 80 | "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.0.zip", |
| 81 | "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", |
| 82 | ], |
| 83 | }, |
| 84 | # for Stardoc |
| 85 | "build_bazel_rules_nodejs": { |
| 86 | "archive": "rules_nodejs-2.2.2.tar.gz", |
| 87 | "sha256": "f2194102720e662dbf193546585d705e645314319554c6ce7e47d8b59f459e9c", |
| 88 | "urls": [ |
| 89 | "https://mirror.bazel.build/github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz", |
| 90 | "https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz", |
| 91 | ], |
| 92 | }, |
Tony Aiuto | 337e717 | 2020-12-09 10:20:14 -0800 | [diff] [blame] | 93 | } |