| # Copyright 2020 The Bazel Authors. All rights reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http:#www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| """List the distribution dependencies we need to build Bazel.""" |
| |
| load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| def dist_http_archive(name, **kwargs): |
| """Wraps http_archive but takes sha and urls from DIST_DEPS. |
| |
| dist_http_archive wraps an http_archive invocation, but looks up relevant |
| information from DIST_DEPS so the user does not have to specify it. It |
| always strips sha256 and urls from kwargs. |
| |
| Args: |
| name: repo name |
| **kwargs: see http_archive for allowed args. |
| """ |
| info = DIST_DEPS[name] |
| if "patches" not in kwargs: |
| kwargs["patches"] = info.get("patches") |
| if "strip_prefix" not in kwargs: |
| kwargs["strip_prefix"] = info.get("strip_prefix") |
| http_archive( |
| name = name, |
| sha256 = info["sha256"], |
| urls = info["urls"], |
| **kwargs |
| ) |
| |
| DIST_DEPS = { |
| ######################################## |
| # |
| # Runtime language dependencies |
| # |
| ######################################## |
| # Keep in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/cpp/cc_configure.WORKSPACE. |
| # Keep in sync with src/main/java/com/google/devtools/build/lib/bazel/rules/java/jdk.WORKSPACE. |
| # Note: This is not in sync with src/test/java/com/google/devtools/build/lib/blackbox/framework/BlackBoxTestEnvironment.java. |
| # Perhaps it should be. |
| "rules_cc": { |
| "archive": "b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| "sha256": "d0c573b94a6ef20ef6ff20154a23d0efcb409fb0e1ff0979cec318dfe42f0cdd", |
| "strip_prefix": "rules_cc-b1c40e1de81913a3c40e5948f78719c28152486d", |
| "urls": [ |
| "https://mirror.bazel.build/github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| "https://github.com/bazelbuild/rules_cc/archive/b1c40e1de81913a3c40e5948f78719c28152486d.zip", |
| ], |
| "need_in_test_WORKSPACE": True, |
| }, |
| ######################################## |
| # |
| # Build time dependencies |
| # |
| ######################################## |
| "rules_pkg": { |
| "archive": "rules_pkg-0.2.4.tar.gz", |
| "sha256": "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a", |
| "urls": [ |
| "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz", |
| "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz", |
| ], |
| }, |
| # for Stardoc |
| "io_bazel_rules_sass": { |
| "archive": "1.25.0.zip", |
| "sha256": "c78be58f5e0a29a04686b628cf54faaee0094322ae0ac99da5a8a8afca59a647", |
| "strip_prefix": "rules_sass-1.25.0", |
| "urls": [ |
| "https://mirror.bazel.build/github.com/bazelbuild/rules_sass/archive/1.25.0.zip", |
| "https://github.com/bazelbuild/rules_sass/archive/1.25.0.zip", |
| ], |
| }, |
| # for Stardoc |
| "build_bazel_rules_nodejs": { |
| "archive": "rules_nodejs-2.2.2.tar.gz", |
| "sha256": "f2194102720e662dbf193546585d705e645314319554c6ce7e47d8b59f459e9c", |
| "urls": [ |
| "https://mirror.bazel.build/github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz", |
| "https://github.com/bazelbuild/rules_nodejs/releases/download/2.2.2/rules_nodejs-2.2.2.tar.gz", |
| ], |
| }, |
| } |