blob: a105a633001d115cb11e48103ca81b3193b72b01 [file] [log] [blame]
Primiano Tucci1d409982019-09-19 10:15:18 +01001# 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
15load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
16load("@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 Savitski31751112022-04-02 00:49:07 +010020# To generate shallow_since fields for git repos, use:
21# git show --date=raw COMMIT
22
Primiano Tucci1d409982019-09-19 10:15:18 +010023def 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 Maganti7d948fd2021-11-02 22:07:00 +000030 strip_prefix = "protobuf-3.10.1",
31 url = "https://github.com/protocolbuffers/protobuf/archive/v3.10.1.tar.gz",
32 sha256 = "6adf73fd7f90409e479d6ac86529ade2d45f50494c5c10f539226693cb8fe4f7",
Primiano Tucci1d409982019-09-19 10:15:18 +010033 )
34
35 _add_repo_if_not_existing(
36 http_archive,
37 name = "perfetto_dep_sqlite",
Lalit Magantib7069142022-09-02 15:43:20 +010038 url = "https://storage.googleapis.com/perfetto/sqlite-amalgamation-3390200.zip",
39 sha256 = "87775784f8b22d0d0f1d7811870d39feaa7896319c7c20b849a4181c5a50609b",
40 strip_prefix = "sqlite-amalgamation-3390200",
Primiano Tucci1d409982019-09-19 10:15:18 +010041 build_file = "//bazel:sqlite.BUILD",
42 )
43
44 _add_repo_if_not_existing(
45 http_archive,
46 name = "perfetto_dep_sqlite_src",
Lalit Magantib7069142022-09-02 15:43:20 +010047 url = "https://storage.googleapis.com/perfetto/sqlite-src-3390200.zip",
48 sha256 = "e933d77000f45f3fbc8605f0050586a3013505a8de9b44032bd00ed72f1586f0",
49 strip_prefix = "sqlite-src-3390200",
Primiano Tucci1d409982019-09-19 10:15:18 +010050 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",
Primiano Tucci1d409982019-09-19 10:15:18 +010059 )
60
61 _add_repo_if_not_existing(
62 new_git_repository,
63 name = "perfetto_dep_jsoncpp",
64 remote = "https://github.com/open-source-parsers/jsoncpp",
Jordan Bayles8c6a4bc2020-07-16 20:20:48 -070065 commit = "6aba23f4a8628d599a9ef7fa4811c4ff6e4070e2", # v1.9.3
Primiano Tucci1d409982019-09-19 10:15:18 +010066 build_file = "//bazel:jsoncpp.BUILD",
Primiano Tucci1d409982019-09-19 10:15:18 +010067 )
68
69 _add_repo_if_not_existing(
Primiano Tucci89c31342023-04-21 16:16:38 +010070 http_archive,
Primiano Tucci1d409982019-09-19 10:15:18 +010071 name = "perfetto_dep_zlib",
Primiano Tucci89c31342023-04-21 16:16:38 +010072 url = "https://storage.googleapis.com/perfetto/zlib-6d3f6aa0f87c9791ca7724c279ef61384f331dfd.tar.gz",
73 sha256 = "e9a1d6e8c936de68628ffb83a13d28a40cd6b2def2ad9378e8b951d4b8f4df18",
Primiano Tucci1d409982019-09-19 10:15:18 +010074 build_file = "//bazel:zlib.BUILD",
Primiano Tucci1d409982019-09-19 10:15:18 +010075 )
76
Ryan Savitskie65c4052022-03-24 18:22:19 +000077 _add_repo_if_not_existing(
78 http_archive,
79 name = "perfetto_dep_llvm_demangle",
80 url = "https://storage.googleapis.com/perfetto/llvm-project-3b4c59c156919902c785ce3cbae0eee2ee53064d.tgz",
81 sha256 = "f4a52e7f36edd7cacc844d5ae0e5f60b6f57c5afc40683e99f295886c9ce8ff4",
82 strip_prefix = "llvm-project",
83 build_file = "//bazel:llvm_demangle.BUILD",
84 )
85
Primiano Tucci1d409982019-09-19 10:15:18 +010086 # Without this protobuf.bzl fails. This seems a bug in protobuf_deps().
87 _add_repo_if_not_existing(
88 http_archive,
89 name = "bazel_skylib",
90 sha256 = "bbccf674aa441c266df9894182d80de104cabd19be98be002f6d478aaa31574d",
91 strip_prefix = "bazel-skylib-2169ae1c374aab4a09aa90e65efe1a3aad4e279b",
92 url = "https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz",
93 )
94
95def _add_repo_if_not_existing(repo_rule, name, **kwargs):
96 if name not in native.existing_rules():
97 repo_rule(name = name, **kwargs)