xref: /aosp_15_r20/external/skia/WORKSPACE.bazel (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1workspace(name = "skia")
2
3load("//bazel:deps.bzl", "bazel_deps", "c_plus_plus_deps")
4
5bazel_deps()
6
7load("//toolchain:download_toolchains.bzl", "download_toolchains_for_skia")
8
9download_toolchains_for_skia("clang_linux_amd64", "clang_mac", "clang_windows_amd64", "ndk_linux_amd64", "clang_ios")
10
11load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
12load("//bazel:gcs_mirror.bzl", "gcs_mirror_url")
13
14# See https://github.com/emscripten-core/emsdk/tree/85d27a4a2a60d591613a305b14ae438c2bb3ce11/bazel#setup-instructions
15http_archive(
16    name = "emsdk",
17    sha256 = "cb8cded78f6953283429d724556e89211e51ac4d871fcf38e0b32405ee248e91",
18    strip_prefix = "emsdk-3.1.44/bazel",
19    urls = gcs_mirror_url(
20        sha256 = "cb8cded78f6953283429d724556e89211e51ac4d871fcf38e0b32405ee248e91",
21        url = "https://github.com/emscripten-core/emsdk/archive/refs/tags/3.1.44.tar.gz",
22    ),
23)
24
25load("@emsdk//:deps.bzl", emsdk_deps = "deps")
26
27# One of the deps here is build_bazel_rules_nodejs, currently version 5.8.0
28# If we try to install it ourselves after this, it won't work.
29emsdk_deps()
30
31load("@emsdk//:emscripten_deps.bzl", emsdk_emscripten_deps = "emscripten_deps")
32
33emsdk_emscripten_deps(emscripten_version = "3.1.44")
34
35load("@bazel_toolchains//repositories:repositories.bzl", bazel_toolchains_repositories = "repositories")
36
37bazel_toolchains_repositories()
38
39http_archive(
40    name = "rules_pkg",
41    sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
42    urls = gcs_mirror_url(
43        sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
44        url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
45    ),
46)
47
48load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
49
50rules_pkg_dependencies()
51
52#######################################################################################
53# Python
54#######################################################################################
55
56# https://github.com/bazelbuild/rules_python
57http_archive(
58    name = "rules_python",
59    sha256 = "5fa3c738d33acca3b97622a13a741129f67ef43f5fdfcec63b29374cc0574c29",
60    strip_prefix = "rules_python-0.9.0",
61    urls = gcs_mirror_url(
62        sha256 = "5fa3c738d33acca3b97622a13a741129f67ef43f5fdfcec63b29374cc0574c29",
63        url = "https://github.com/bazelbuild/rules_python/archive/refs/tags/0.9.0.tar.gz",
64    ),
65)
66
67# This sets up a hermetic python3, rather than depending on what is installed.
68load("@rules_python//python:repositories.bzl", "python_register_toolchains")
69
70python_register_toolchains(
71    name = "python3_9",
72    # https://github.com/bazelbuild/rules_python/blob/main/python/versions.bzl
73    python_version = "3.9",
74)
75
76load("@python3_9//:defs.bzl", "interpreter")
77load("@rules_python//python:pip.bzl", "pip_install")
78
79pip_install(
80    name = "py_deps",
81    python_interpreter_target = interpreter,
82    requirements = "//:requirements.txt",
83)
84
85#######################################################################################
86# Gazelle
87#######################################################################################
88
89http_archive(
90    name = "io_bazel_rules_go",
91    sha256 = "91585017debb61982f7054c9688857a2ad1fd823fc3f9cb05048b0025c47d023",
92    urls = [
93        "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip",
94        "https://github.com/bazelbuild/rules_go/releases/download/v0.42.0/rules_go-v0.42.0.zip",
95    ],
96)
97
98http_archive(
99    name = "bazel_gazelle",
100    sha256 = "d3fa66a39028e97d76f9e2db8f1b0c11c099e8e01bf363a923074784e451f809",
101    urls = [
102        "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz",
103        "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.33.0/bazel-gazelle-v0.33.0.tar.gz",
104    ],
105)
106
107load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
108load("@io_bazel_rules_go//go:deps.bzl", "go_download_sdk", "go_register_toolchains", "go_rules_dependencies")
109load("//:go_repositories.bzl", "go_repositories")
110
111# gazelle:repository_macro go_repositories.bzl%go_repositories
112go_repositories()
113
114go_rules_dependencies()
115
116# For our Linux RBE pool
117go_download_sdk(
118    name = "go_sdk_linux_amd64",
119    goarch = "amd64",
120    goos = "linux",
121    version = "1.21.4",
122)
123
124# For the host machine
125go_download_sdk(
126    name = "go_sdk",
127    version = "1.21.4",
128)
129
130# Do not specify a version here or it will be an error (because we
131# specified the version above when downloading SDKs)
132go_register_toolchains()
133
134gazelle_dependencies(
135    go_repository_default_config = "//:WORKSPACE.bazel",
136    go_sdk = "go_sdk",
137)
138
139##########################
140# Other Go dependencies. #
141##########################
142
143load("//bazel:go_googleapis_compatibility_hack.bzl", "go_googleapis_compatibility_hack")
144
145# Compatibility hack to make the github.com/bazelbuild/remote-apis Go module work with rules_go
146# v0.41.0 or newer. See the go_googleapis() rule's docstring for details.
147go_googleapis_compatibility_hack(
148    name = "go_googleapis",
149)
150
151# Needed by @com_github_bazelbuild_remote_apis.
152http_archive(
153    name = "com_google_protobuf",
154    sha256 = "b8ab9bbdf0c6968cf20060794bc61e231fae82aaf69d6e3577c154181991f576",
155    strip_prefix = "protobuf-3.18.1",
156    urls = gcs_mirror_url(
157        sha256 = "b8ab9bbdf0c6968cf20060794bc61e231fae82aaf69d6e3577c154181991f576",
158        url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.18.1/protobuf-all-3.18.1.tar.gz",
159    ),
160)
161
162# Originally, we pulled protobuf dependencies as follows:
163#
164#     load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
165#     protobuf_deps()
166#
167# The protobuf_deps() macro brings in a bunch of dependencies, but by copying the macro body here
168# and removing dependencies one by one, "rules_proto" was identified as the only dependency that is
169# required to build this repository.
170http_archive(
171    name = "rules_proto",
172    sha256 = "a4382f78723af788f0bc19fd4c8411f44ffe0a72723670a34692ffad56ada3ac",
173    strip_prefix = "rules_proto-f7a30f6f80006b591fa7c437fe5a951eb10bcbcf",
174    urls = ["https://github.com/bazelbuild/rules_proto/archive/f7a30f6f80006b591fa7c437fe5a951eb10bcbcf.zip"],
175)
176
177http_archive(
178    name = "com_google_googleapis",
179    sha256 = "38701e513aff81c89f0f727e925bf04ac4883913d03a60cdebb2c2a5f10beb40",
180    strip_prefix = "googleapis-86fa44cc5ee2136e87c312f153113d4dd8e9c4de",
181    urls = [
182        "https://github.com/googleapis/googleapis/archive/86fa44cc5ee2136e87c312f153113d4dd8e9c4de.tar.gz",
183    ],
184)
185
186# Needed by @com_github_bazelbuild_remote_apis for the googleapis protos.
187http_archive(
188    name = "googleapis",
189    build_file = "BUILD.googleapis",
190    sha256 = "7b6ea252f0b8fb5cd722f45feb83e115b689909bbb6a393a873b6cbad4ceae1d",
191    strip_prefix = "googleapis-143084a2624b6591ee1f9d23e7f5241856642f4d",
192    urls = gcs_mirror_url(
193        sha256 = "7b6ea252f0b8fb5cd722f45feb83e115b689909bbb6a393a873b6cbad4ceae1d",
194        # b/267219467
195        url = "https://github.com/googleapis/googleapis/archive/143084a2624b6591ee1f9d23e7f5241856642f4d.zip",
196    ),
197)
198
199load("@com_google_googleapis//:repository_rules.bzl", googleapis_imports_switched_rules_by_language = "switched_rules_by_language")
200
201googleapis_imports_switched_rules_by_language(
202    name = "com_google_googleapis_imports",
203    go = True,
204    grpc = True,
205)
206
207# Needed by @com_github_bazelbuild_remote_apis for gRPC.
208http_archive(
209    name = "com_github_grpc_grpc",
210    sha256 = "b391a327429279f6f29b9ae7e5317cd80d5e9d49cc100e6d682221af73d984a6",
211    strip_prefix = "grpc-93e8830070e9afcbaa992c75817009ee3f4b63a0",  # v1.24.3 with fixes
212    urls = gcs_mirror_url(
213        sha256 = "b391a327429279f6f29b9ae7e5317cd80d5e9d49cc100e6d682221af73d984a6",
214        # Fix after https://github.com/grpc/grpc/issues/32259 is resolved
215        url = "https://github.com/grpc/grpc/archive/93e8830070e9afcbaa992c75817009ee3f4b63a0.zip",
216    ),
217)
218
219# Originally, we pulled gRPC dependencies as follows:
220#
221#     load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
222#     grpc_deps()
223#
224# The grpc_deps() macro brings in a bunch of dependencies, but by copying the macro body here
225# and removing dependencies one by one, "zlib" was identified as the only dependency that is
226# required to build this repository.
227http_archive(
228    name = "zlib",
229    build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD",
230    sha256 = "6d4d6640ca3121620995ee255945161821218752b551a1a180f4215f7d124d45",
231    strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f",
232    url = "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz",
233)
234
235###################################################
236# JavaScript / TypeScript rules and dependencies. #
237###################################################
238
239# The npm_install rule runs anytime the package.json or package-lock.json file changes. It also
240# extracts any Bazel rules distributed in an npm package.
241load("@build_bazel_rules_nodejs//:index.bzl", "npm_install")
242
243# Manages the node_modules directory.
244npm_install(
245    name = "npm",
246    package_json = "//:package.json",
247    package_lock_json = "//:package-lock.json",
248)
249
250# io_bazel_rules_webtesting allows us to download browsers in a hermetic, repeatable way. This
251# currently includes Chromium and Firefox. Note that the version on this does not necessarily
252# match the version below of the browsers-X.Y.Z below that is available.
253http_archive(
254    name = "io_bazel_rules_webtesting",
255    sha256 = "e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a",
256    urls = gcs_mirror_url(
257        sha256 = "e9abb7658b6a129740c0b3ef6f5a2370864e102a5ba5ffca2cea565829ed825a",
258        url = "https://github.com/bazelbuild/rules_webtesting/releases/download/0.3.5/rules_webtesting.tar.gz",
259    ),
260)
261
262# https://github.com/bazelbuild/rules_webtesting/blob/e9cf17123068b1123c68219edf9b274bf057b9cc/web/versioned/browsers-0.3.3.bzl
263load("@io_bazel_rules_webtesting//web/versioned:browsers-0.3.3.bzl", "browser_repositories")
264
265browser_repositories(
266    chromium = True,
267    firefox = True,
268)
269
270###################################################
271# Rust rules and dependencies.                    #
272###################################################
273
274http_archive(
275    name = "rules_rust",
276    sha256 = "671ddb3fe5ebcf9dd34d051eca7352fbaf33fa53bf61eed0b75a4c34829e5480",
277    urls = gcs_mirror_url(
278        sha256 = "671ddb3fe5ebcf9dd34d051eca7352fbaf33fa53bf61eed0b75a4c34829e5480",
279        url = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.2/rules_rust-v0.52.2.tar.gz",
280    ),
281)
282
283load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
284
285# https://github.com/bazelbuild/rules_rust/blob/5c715ec50602e2ba6ca2ebfdd870662a6e6d1eda/rust/repositories.bzl#L48
286rules_rust_dependencies()
287
288rust_register_toolchains(
289    edition = "2021",
290    extra_target_triples = [
291        "aarch64-apple-darwin",
292        "aarch64-apple-ios",
293    ],
294    versions = [
295        # supported versions from https://github.com/bazelbuild/rules_rust/blob/5c715ec50602e2ba6ca2ebfdd870662a6e6d1eda/util/fetch_shas_VERSIONS.txt
296        # The rust rules validate a toolchain by sha256 hash, as listed in https://github.com/bazelbuild/rules_rust/blob/5c715ec50602e2ba6ca2ebfdd870662a6e6d1eda/rust/known_shas.bzl
297        "1.76.0",
298    ],
299)
300
301# https://bazelbuild.github.io/rules_rust/crate_universe.html
302load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
303
304crate_universe_dependencies()
305
306# cxxbridge-cmd is a binary only Rust crate, so we follow these instructions for it
307# http://bazelbuild.github.io/rules_rust/crate_universe.html#binary-dependencies
308# If we need to update this, replace the Cargo.lock files with empty (existing) files and then
309# CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index
310http_archive(
311    name = "cxxbridge_cmd",
312    build_file = "//bazel/external/cxxbridge_cmd:BUILD.bazel.skia",
313    sha256 = "5b12e3f7b0477bd2e469107b778d333171cae561a555e96157e67bbd9f42e54f",
314    strip_prefix = "cxxbridge-cmd-1.0.131",
315    type = "tar.gz",
316    urls = gcs_mirror_url(
317        ext = ".tar.gz",
318        sha256 = "5b12e3f7b0477bd2e469107b778d333171cae561a555e96157e67bbd9f42e54f",
319        url = "https://crates.io/api/v1/crates/cxxbridge-cmd/1.0.131/download",
320    ),
321)
322
323load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
324
325# This finds all the dependencies needed to build cxxbridge_cmd...
326crates_repository(
327    name = "cxxbridge_cmd_deps",
328    cargo_lockfile = "//bazel/external/cxxbridge_cmd:Cargo.lock",
329    manifests = ["@cxxbridge_cmd//:Cargo.toml"],
330)
331
332load("@cxxbridge_cmd_deps//:defs.bzl", cxxbridge_cmd_deps = "crate_repositories")
333
334# ... and adds them to the workspace.
335cxxbridge_cmd_deps()
336
337# The cxx crate needs a custom BUILD.bazel file because the one that would be autogenerated
338# by http://bazelbuild.github.io/rules_rust/crate_universe.html#direct-packages does not work.
339# Thus, we download it ourselves, as if it were a binary-only package.
340http_archive(
341    name = "cxx",
342    build_file = "//bazel/external/cxx:BUILD.bazel.skia",
343    sha256 = "2568d7d2cfc051e43414fe1ef80c712cbcd60c3624d1ad1cb4b2572324d0a5d9",
344    strip_prefix = "cxx-1.0.131",
345    type = "tar.gz",
346    urls = gcs_mirror_url(
347        ext = ".tar.gz",
348        sha256 = "2568d7d2cfc051e43414fe1ef80c712cbcd60c3624d1ad1cb4b2572324d0a5d9",
349        url = "https://crates.io/api/v1/crates/cxx/1.0.131/download",
350    ),
351)
352
353# This finds all the dependencies needed to build cxx...
354crates_repository(
355    name = "cxx_deps",
356    cargo_lockfile = "//bazel/external/cxx:Cargo.lock",
357    manifests = ["@cxx//:Cargo.toml"],
358)
359
360load("@cxx_deps//:defs.bzl", cxx_deps = "crate_repositories")
361
362# ... and adds them to the workspace.
363cxx_deps()
364
365# The fontations repository consists of multiple crates. We download those
366# listed in the external/fontations/Cargo.* files.
367# Add this entry to have a root repository from which the individual
368# fontations crates can be fetched.
369# This allows them to be used as deps in other bazel targets.
370crates_repository(
371    name = "fontations",
372    cargo_lockfile = "//bazel/external/fontations:Cargo.lock",
373    manifests = ["//bazel/external/fontations:Cargo.toml"],
374)
375
376load("@fontations//:defs.bzl", fontations_crates = "crate_repositories")
377
378fontations_crates()
379
380# The icu4x repository consists of multiple crates. We download those
381# listed in the external/icu4x/Cargo.* files.
382# Add this entry to have a root repository from which the individual
383# icu4x crates can be fetched.
384# This allows them to be used as deps in other bazel targets.
385crates_repository(
386    name = "icu4x_deps",
387    cargo_lockfile = "//bazel/external/icu4x:Cargo.lock",
388    manifests = ["//bazel/external/icu4x:Cargo.toml"],
389)
390
391load("@icu4x_deps//:defs.bzl", icu4x_deps = "crate_repositories")
392
393icu4x_deps()
394
395# The repository of third-party crates (currently just the `png` crate)
396# to support `//experimental/rust_png` code.
397crates_repository(
398    name = "rust_png",
399    annotations = {
400        "png": [crate.annotation(
401            patch_args = ["-p6"],
402            # Patches from https://crrev.com/c/5922033:
403            # New public API for `png` crate: `fn next_frame_info`.
404            #
405            # TODO(lukasza, kjlubick): Remove this whole annotation once a new
406            # version of `png` is released on crates.io (presumably including
407            # the already merged PRs).
408            patches = [
409                "@//experimental/rust_png/patches:0101-Add-test-coverage-for-PolledAfterEndOfImage-error.patch",
410                "@//experimental/rust_png/patches:0102-Add-test-showing-next_frame-after-next_row-is-tempor.patch",
411                "@//experimental/rust_png/patches:0103-Call-finish_decoding-after-last-next_row.patch",
412                "@//experimental/rust_png/patches:0104-Simplify-how-Reader-tracks-how-many-frames-remain-to.patch",
413                "@//experimental/rust_png/patches:0105-Fix-a-subset-of-issues-identified-by-cargo-clippy.patch",
414                "@//experimental/rust_png/patches:0106-Avoid-infinite-loop-when-retrying-after-earlier-fata.patch",
415                "@//experimental/rust_png/patches:0107-New-API-Reader.next_frame_control-for-advancing-to-t.patch",
416                "@//experimental/rust_png/patches:0201-Add-EXIF-and-ICC-encoding-and-fix-chunk-order.patch",
417                "@//experimental/rust_png/patches:0301-Add-support-for-parsing-mDCv-and-cLLi-chunks.-528.patch",
418                "@//experimental/rust_png/patches:0302-Add-support-for-parsing-cICP-chunks.-529.patch",
419            ],
420        )],
421    },
422    cargo_lockfile = "//experimental/rust_png/ffi:Cargo.lock",
423    packages = {
424        "png": crate.spec(
425            # Note: for additional performance gains `features = ["unstable"]`
426            # can be enabled, but this requires the nightly, unstable `rustc`.
427            version = "0.17",
428        ),
429    },
430)
431
432load("@rust_png//:defs.bzl", rust_png_crates = "crate_repositories")
433
434rust_png_crates()
435
436# Skia uses crates from the vello repository that are under development and have not been published
437# to crates.io. Normally we could fetch them directly from the git mirror in the Cargo.lock file as
438# Bazel supports compiling them without any custom build rules. However, since Bazel's repository
439# rules don't play well with the vello_shader crate's build script, we compile the vello
440# crates from source using the rules defined in bazel/external/vello/BUILD.bazel and the
441# new_git_repository rule.
442#
443# vello_deps contains the dependencies of the two crates we build out of the vello repo (namely
444# vello_shaders and vello_encoding).
445#
446# See comments in bazel/external/vello/BUILD.bazel for more information.
447crates_repository(
448    name = "vello_deps",
449    cargo_lockfile = "//bazel/external/vello:Cargo.lock",
450    manifests = ["//bazel/external/vello:Cargo.toml"],
451)
452
453load("@vello_deps//:defs.bzl", vello_deps = "crate_repositories")
454
455vello_deps()
456
457###############################################################
458
459# Bazel will look for env variables ANDROID_HOME and ANDROID_NDK_HOME.
460# This is NOT hermetic as it requires the user to handle downloading the SDK  and accepting the
461# license independently.
462android_sdk_repository(name = "androidsdk")
463# TODO: skbug.com/14128
464# Uncomment the following after setting ANDROID_NDK_HOME to build for Android:
465# android_ndk_repository(name = "androidndk")
466
467# Clients must specify their own version of skia_user_config to overwrite SkUserConfig.h
468local_repository(
469    name = "skia_user_config",
470    path = "include/config",
471)
472
473# This are two lists of Bazel repository names, which is brought in by the following macro.
474# It is here for easier grepping, i.e. someone trying to find where a label like @brotli//:brotlidec
475# was defined. If a dep has its own BUILD rules, then one will need to go to its git repository
476# to find the BUILD or BUILD.bazel file with the rule. If a dep does not have Bazel support, then
477# that means someone on the Skia team wrote a BUILD.bazel file and put it in
478# //bazel/external/<dep_name> and one can go find it there.
479#
480#### START GENERATED LIST OF THIRD_PARTY DEPS
481# @abseil_cpp - https://skia.googlesource.com/external/github.com/abseil/abseil-cpp.git
482# @brotli - https://skia.googlesource.com/external/github.com/google/brotli.git
483# @highway - https://chromium.googlesource.com/external/github.com/google/highway.git
484# @spirv_headers - https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Headers.git
485# @spirv_tools - https://skia.googlesource.com/external/github.com/KhronosGroup/SPIRV-Tools.git
486#
487# @dawn - //bazel/external/dawn:BUILD.bazel
488# @delaunator - //bazel/external/delaunator:BUILD.bazel
489# @dng_sdk - //bazel/external/dng_sdk:BUILD.bazel
490# @expat - //bazel/external/expat:BUILD.bazel
491# @freetype - //bazel/external/freetype:BUILD.bazel
492# @harfbuzz - //bazel/external/harfbuzz:BUILD.bazel
493# @icu - //bazel/external/icu:BUILD.bazel
494# @icu4x - //bazel/external/icu4x:BUILD.bazel
495# @imgui - //bazel/external/imgui:BUILD.bazel
496# @libavif - //bazel/external/libavif:BUILD.bazel
497# @libgav1 - //bazel/external/libgav1:BUILD.bazel
498# @libjpeg_turbo - //bazel/external/libjpeg_turbo:BUILD.bazel
499# @libjxl - //bazel/external/libjxl:BUILD.bazel
500# @libpng - //bazel/external/libpng:BUILD.bazel
501# @libwebp - //bazel/external/libwebp:BUILD.bazel
502# @libyuv - //bazel/external/libyuv:BUILD.bazel
503# @perfetto - //bazel/external/perfetto:BUILD.bazel
504# @piex - //bazel/external/piex:BUILD.bazel
505# @spirv_cross - //bazel/external/spirv_cross:BUILD.bazel
506# @vello - //bazel/external/vello:BUILD.bazel
507# @vulkan_headers - //bazel/external/vulkan_headers:BUILD.bazel
508# @vulkan_tools - //bazel/external/vulkan_tools:BUILD.bazel
509# @vulkan_utility_libraries - //bazel/external/vulkan_utility_libraries:BUILD.bazel
510# @vulkanmemoryallocator - //bazel/external/vulkanmemoryallocator:BUILD.bazel
511# @wuffs - //bazel/external/wuffs:BUILD.bazel
512# @zlib_skia - //bazel/external/zlib_skia:BUILD.bazel
513#### END GENERATED LIST OF THIRD_PARTY DEPS
514c_plus_plus_deps()
515
516# In order to copy the Freetype configurations into the checked out Freetype folder,
517# it is easiest to treat them as a third-party dependency from the perspective of Freetype.
518# To do that, we put them in their own Bazel workspace and then have our injected BUILD.bazel
519# for Freetype reference this workspace.
520# https://bazel.build/reference/be/workspace#new_local_repository
521local_repository(
522    name = "freetype_config",
523    path = "third_party/freetype2/include",
524)
525
526local_repository(
527    name = "harfbuzz_config",
528    path = "third_party/harfbuzz",
529)
530
531local_repository(
532    name = "icu_utils",
533    path = "third_party/icu",
534)
535
536local_repository(
537    name = "expat_config",
538    path = "third_party/expat/include",
539)
540
541load("//bazel:cipd_install.bzl", "cipd_install")
542
543cipd_install(
544    name = "git_linux_amd64",
545    build_file_content = """
546filegroup(
547  name = "all_files",
548  # The exclude pattern prevents files with spaces in their names from tripping up Bazel.
549  srcs = glob(include=["**/*"], exclude=["**/* *"]),
550  visibility = ["//visibility:public"],
551)
552""",
553    cipd_package = "infra/3pp/tools/git/linux-amd64",
554    # Based on
555    # https://skia.googlesource.com/buildbot/+/f1d21dc58818cd6aba0a7822e59d37636aefe936/WORKSPACE#391.
556    #
557    # Note that the below "git config" commands do not affect the user's Git configuration. These
558    # settings are only visible to Bazel targets that depend on @git_linux_amd64//:all_files via
559    # the "data" attribute. The result of these commands can be examined as follows:
560    #
561    #     $ cat $(bazel info output_base)/external/git_linux_amd64/etc/gitconfig
562    #     [user]
563    #             name = Bazel Test User
564    #             email = [email protected]
565    postinstall_cmds_posix = [
566        "mkdir etc",
567        "bin/git config --system user.name \"Bazel Test User\"",
568        "bin/git config --system user.email \"[email protected]\"",
569    ],
570    # From https://chrome-infra-packages.appspot.com/p/infra/3pp/tools/git/linux-amd64/+/version:2.29.2.chromium.6
571    sha256 = "36cb96051827d6a3f6f59c5461996fe9490d997bcd2b351687d87dcd4a9b40fa",
572    tag = "version:2.29.2.chromium.6",
573)
574
575cipd_install(
576    name = "gn_linux_amd64",
577    build_file_content = """
578exports_files(
579    ["gn"],
580    visibility = ["//visibility:public"]
581)
582""",
583    cipd_package = "gn/gn/linux-amd64",
584    # From https://chrome-infra-packages.appspot.com/p/gn/gn/linux-amd64/+/git_revision:1c4151ff5c1d6fbf7fa800b8d4bb34d3abc03a41
585    sha256 = "7195291488d08f3a10e85b85d8c4816e077015f1c5f196f770003a97aa42caf8",
586    tag = "git_revision:1c4151ff5c1d6fbf7fa800b8d4bb34d3abc03a41",
587)
588
589cipd_install(
590    name = "gn_mac_arm64",
591    build_file_content = """
592exports_files(
593    ["gn"],
594    visibility = ["//visibility:public"]
595)
596""",
597    cipd_package = "gn/gn/mac-arm64",
598    # From https://chrome-infra-packages.appspot.com/p/gn/gn/mac-arm64/+/git_revision:1c4151ff5c1d6fbf7fa800b8d4bb34d3abc03a41
599    sha256 = "1123907ac3317530e9dd537d50cd83fd83e852aacc07d286f45753c8fc5287ed",
600    tag = "git_revision:1c4151ff5c1d6fbf7fa800b8d4bb34d3abc03a41",
601)
602
603cipd_install(
604    name = "gn_mac_amd64",
605    build_file_content = """
606exports_files(
607    ["gn"],
608    visibility = ["//visibility:public"]
609)
610""",
611    cipd_package = "gn/gn/mac-amd64",
612    # From https://chrome-infra-packages.appspot.com/p/gn/gn/mac-amd64/+/git_revision:1c4151ff5c1d6fbf7fa800b8d4bb34d3abc03a41
613    sha256 = "ed96f7d2f49b83b016e4bdbed432e4734a5a133accb025d7c07685e01489ba93",
614    tag = "git_revision:1c4151ff5c1d6fbf7fa800b8d4bb34d3abc03a41",
615)
616
617cipd_install(
618    name = "skimage",
619    build_file = "//bazel/external/skimage:BUILD.bazel",
620    cipd_package = "skia/bots/skimage",
621    # From https://chrome-infra-packages.appspot.com/p/skia/bots/skimage/+/sRladEfUAXeYIBD3Pt3ke0Fd08vtYVLrg4IASKk5F6YC
622    sha256 = "b1195a7447d40177982010f73edde47b415dd3cbed6152eb83820048a93917a6",
623    tag = "version:47",
624)
625
626http_file(
627    name = "buildifier_linux_x64",
628    downloaded_file_path = "buildifier",
629    executable = True,
630    sha256 = "be63db12899f48600bad94051123b1fd7b5251e7661b9168582ce52396132e92",
631    urls = gcs_mirror_url(
632        ext = "",
633        sha256 = "be63db12899f48600bad94051123b1fd7b5251e7661b9168582ce52396132e92",
634        url = "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-linux-amd64",
635    ),
636)
637
638http_file(
639    name = "buildifier_macos_arm64",
640    downloaded_file_path = "buildifier",
641    executable = True,
642    sha256 = "fa07ba0d20165917ca4cc7609f9b19a8a4392898148b7babdf6bb2a7dd963f05",
643    urls = gcs_mirror_url(
644        ext = "",
645        sha256 = "fa07ba0d20165917ca4cc7609f9b19a8a4392898148b7babdf6bb2a7dd963f05",
646        url = "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-darwin-arm64",
647    ),
648)
649
650http_file(
651    name = "buildifier_macos_x64",
652    downloaded_file_path = "buildifier",
653    executable = True,
654    sha256 = "eeb47b2de27f60efe549348b183fac24eae80f1479e8b06cac0799c486df5bed",
655    urls = gcs_mirror_url(
656        ext = "",
657        sha256 = "eeb47b2de27f60efe549348b183fac24eae80f1479e8b06cac0799c486df5bed",
658        url = "https://github.com/bazelbuild/buildtools/releases/download/v6.4.0/buildifier-darwin-amd64",
659    ),
660)
661
662##################################
663# Docker rules and dependencies. #
664##################################
665
666http_archive(
667    name = "io_bazel_rules_docker",
668    sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
669    urls = gcs_mirror_url(
670        sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
671        url = "https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz",
672    ),
673)
674
675load(
676    "@io_bazel_rules_docker//repositories:repositories.bzl",
677    container_repositories = "repositories",
678)
679
680container_repositories()
681
682# This is required by the toolchain_container rule.
683load(
684    "@io_bazel_rules_docker//repositories:go_repositories.bzl",
685    container_go_deps = "go_deps",
686)
687
688container_go_deps()
689
690load(
691    "@io_bazel_rules_docker//container:container.bzl",
692    "container_pull",
693)
694
695# Pulls the gcr.io/skia-public/debugger-app-base container.
696container_pull(
697    name = "debugger-app-base",
698    digest = "sha256:e9a6ea69ff3d616e5757891be54a232902b65f790d69655dab25048abacbd84d",
699    registry = "gcr.io",
700    repository = "skia-public/debugger-app-base",
701)
702
703# Pulls the gcr.io/skia-public/jsfiddle-base container.
704container_pull(
705    name = "jsfiddle-base",
706    digest = "sha256:fb2d48f7af982ed974832b6eef330985af8f640f5168188bbea3986543d4af90",
707    registry = "gcr.io",
708    repository = "skia-public/jsfiddle-base",
709)
710
711# Pulls the gcr.io/skia-public/shaders-base container.
712container_pull(
713    name = "shaders-base",
714    digest = "sha256:9481c3eb25d23889071ead9351254cc96b295c5290794cb4a13298134d1c5b57",
715    registry = "gcr.io",
716    repository = "skia-public/shaders-base",
717)
718
719# Pulls the gcr.io/skia-public/skottie-base container.
720container_pull(
721    name = "skottie-base",
722    digest = "sha256:32e4afed6d80609923d419fd854ed7a999b6a3bf53efc09713c0488e908fc7f9",
723    registry = "gcr.io",
724    repository = "skia-public/skottie-base",
725)
726
727http_archive(
728    name = "build_bazel_rules_apple",
729    sha256 = "62847b3f444ce514ae386704a119ad7b29fa6dfb65a38bff4ae239f2389a0429",
730    url = "https://github.com/bazelbuild/rules_apple/releases/download/3.8.0/rules_apple.3.8.0.tar.gz",
731)
732
733load(
734    "@build_bazel_rules_apple//apple:repositories.bzl",
735    "apple_rules_dependencies",
736)
737
738apple_rules_dependencies()
739
740load(
741    "@build_bazel_rules_swift//swift:repositories.bzl",
742    "swift_rules_dependencies",
743)
744
745swift_rules_dependencies()
746
747load(
748    "@build_bazel_rules_swift//swift:extras.bzl",
749    "swift_rules_extra_dependencies",
750)
751
752swift_rules_extra_dependencies()
753
754load(
755    "@build_bazel_apple_support//lib:repositories.bzl",
756    "apple_support_dependencies",
757)
758
759apple_support_dependencies()
760