blob: 0b63d8cc64720d45fdfeee77f73383d7b60d66eb [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",
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 Bayles8c6a4bc2020-07-16 20:20:48 -070066 commit = "6aba23f4a8628d599a9ef7fa4811c4ff6e4070e2", # v1.9.3
Primiano Tucci1d409982019-09-19 10:15:18 +010067 build_file = "//bazel:jsoncpp.BUILD",
Jordan Bayles8c6a4bc2020-07-16 20:20:48 -070068 shallow_since = "1590760226 +0800",
Primiano Tucci1d409982019-09-19 10:15:18 +010069 )
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 Savitski31751112022-04-02 00:49:07 +010075 commit = "5c85a2da4c13eda07f69d81a1579a5afddd35f59",
Primiano Tucci1d409982019-09-19 10:15:18 +010076 build_file = "//bazel:zlib.BUILD",
Ryan Savitski31751112022-04-02 00:49:07 +010077 shallow_since = "1605147005 +0000",
Primiano Tucci1d409982019-09-19 10:15:18 +010078 )
79
Ryan Savitskie65c4052022-03-24 18:22:19 +000080 _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 Tucci1d409982019-09-19 10:15:18 +010089 # 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
98def _add_repo_if_not_existing(repo_rule, name, **kwargs):
99 if name not in native.existing_rules():
100 repo_rule(name = name, **kwargs)