Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 1 | # Copyright (C) 2019 The Android Open Source Project |
| 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 | |
| 15 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 16 | load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") |
| 17 | |
| 18 | # This file must be kept in sync with tools/install-build-deps. |
| 19 | |
Ryan Savitski | 3175111 | 2022-04-02 00:49:07 +0100 | [diff] [blame] | 20 | # To generate shallow_since fields for git repos, use: |
| 21 | # git show --date=raw COMMIT |
| 22 | |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 23 | def perfetto_deps(): |
| 24 | # Note: this is more recent than the version of protobuf we use in the |
| 25 | # GN and Android builds. This is because older versions of protobuf don't |
| 26 | # support Bazel. |
| 27 | _add_repo_if_not_existing( |
| 28 | http_archive, |
| 29 | name = "com_google_protobuf", |
Lalit Maganti | 7d948fd | 2021-11-02 22:07:00 +0000 | [diff] [blame] | 30 | strip_prefix = "protobuf-3.10.1", |
| 31 | url = "https://github.com/protocolbuffers/protobuf/archive/v3.10.1.tar.gz", |
| 32 | sha256 = "6adf73fd7f90409e479d6ac86529ade2d45f50494c5c10f539226693cb8fe4f7", |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 33 | ) |
| 34 | |
| 35 | _add_repo_if_not_existing( |
| 36 | http_archive, |
| 37 | name = "perfetto_dep_sqlite", |
Lalit Maganti | b706914 | 2022-09-02 15:43:20 +0100 | [diff] [blame] | 38 | url = "https://storage.googleapis.com/perfetto/sqlite-amalgamation-3390200.zip", |
| 39 | sha256 = "87775784f8b22d0d0f1d7811870d39feaa7896319c7c20b849a4181c5a50609b", |
| 40 | strip_prefix = "sqlite-amalgamation-3390200", |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 41 | build_file = "//bazel:sqlite.BUILD", |
| 42 | ) |
| 43 | |
| 44 | _add_repo_if_not_existing( |
| 45 | http_archive, |
| 46 | name = "perfetto_dep_sqlite_src", |
Lalit Maganti | b706914 | 2022-09-02 15:43:20 +0100 | [diff] [blame] | 47 | url = "https://storage.googleapis.com/perfetto/sqlite-src-3390200.zip", |
| 48 | sha256 = "e933d77000f45f3fbc8605f0050586a3013505a8de9b44032bd00ed72f1586f0", |
| 49 | strip_prefix = "sqlite-src-3390200", |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 50 | build_file = "//bazel:sqlite.BUILD", |
| 51 | ) |
| 52 | |
| 53 | _add_repo_if_not_existing( |
| 54 | new_git_repository, |
| 55 | name = "perfetto_dep_linenoise", |
| 56 | remote = "https://fuchsia.googlesource.com/third_party/linenoise.git", |
| 57 | commit = "c894b9e59f02203dbe4e2be657572cf88c4230c3", |
| 58 | build_file = "//bazel:linenoise.BUILD", |
| 59 | shallow_since = "1469784335 +0200", |
| 60 | ) |
| 61 | |
| 62 | _add_repo_if_not_existing( |
| 63 | new_git_repository, |
| 64 | name = "perfetto_dep_jsoncpp", |
| 65 | remote = "https://github.com/open-source-parsers/jsoncpp", |
Jordan Bayles | 8c6a4bc | 2020-07-16 20:20:48 -0700 | [diff] [blame] | 66 | commit = "6aba23f4a8628d599a9ef7fa4811c4ff6e4070e2", # v1.9.3 |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 67 | build_file = "//bazel:jsoncpp.BUILD", |
Jordan Bayles | 8c6a4bc | 2020-07-16 20:20:48 -0700 | [diff] [blame] | 68 | shallow_since = "1590760226 +0800", |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 69 | ) |
| 70 | |
| 71 | _add_repo_if_not_existing( |
| 72 | new_git_repository, |
| 73 | name = "perfetto_dep_zlib", |
| 74 | remote = "https://android.googlesource.com/platform/external/zlib.git", |
Ryan Savitski | 3175111 | 2022-04-02 00:49:07 +0100 | [diff] [blame] | 75 | commit = "5c85a2da4c13eda07f69d81a1579a5afddd35f59", |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 76 | build_file = "//bazel:zlib.BUILD", |
Ryan Savitski | 3175111 | 2022-04-02 00:49:07 +0100 | [diff] [blame] | 77 | shallow_since = "1605147005 +0000", |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 78 | ) |
| 79 | |
Ryan Savitski | e65c405 | 2022-03-24 18:22:19 +0000 | [diff] [blame] | 80 | _add_repo_if_not_existing( |
| 81 | http_archive, |
| 82 | name = "perfetto_dep_llvm_demangle", |
| 83 | url = "https://storage.googleapis.com/perfetto/llvm-project-3b4c59c156919902c785ce3cbae0eee2ee53064d.tgz", |
| 84 | sha256 = "f4a52e7f36edd7cacc844d5ae0e5f60b6f57c5afc40683e99f295886c9ce8ff4", |
| 85 | strip_prefix = "llvm-project", |
| 86 | build_file = "//bazel:llvm_demangle.BUILD", |
| 87 | ) |
| 88 | |
Primiano Tucci | 1d40998 | 2019-09-19 10:15:18 +0100 | [diff] [blame] | 89 | # Without this protobuf.bzl fails. This seems a bug in protobuf_deps(). |
| 90 | _add_repo_if_not_existing( |
| 91 | http_archive, |
| 92 | name = "bazel_skylib", |
| 93 | sha256 = "bbccf674aa441c266df9894182d80de104cabd19be98be002f6d478aaa31574d", |
| 94 | strip_prefix = "bazel-skylib-2169ae1c374aab4a09aa90e65efe1a3aad4e279b", |
| 95 | url = "https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz", |
| 96 | ) |
| 97 | |
| 98 | def _add_repo_if_not_existing(repo_rule, name, **kwargs): |
| 99 | if name not in native.existing_rules(): |
| 100 | repo_rule(name = name, **kwargs) |