xref: /aosp_15_r20/external/sandboxed-api/WORKSPACE (revision ec63e07ab9515d95e79c211197c445ef84cefa6a)
1# Copyright 2019 Google LLC
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#     https://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
15workspace(name = "com_google_sandboxed_api")
16
17load("//sandboxed_api/bazel:sapi_deps.bzl", "sapi_deps")
18
19# Load Sandboxed API dependencies
20sapi_deps()
21
22load("@bazel_skylib//lib:versions.bzl", "versions")
23load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
24load(
25    "//sandboxed_api/bazel:llvm_config.bzl",
26    "llvm_disable_optional_support_deps",
27)
28load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
29
30versions.check(minimum_bazel_version = "5.1.0")
31
32protobuf_deps()
33
34llvm_disable_optional_support_deps()
35
36# zlib, only needed for examples
37http_archive(
38    name = "net_zlib",
39    build_file = "//sandboxed_api:bazel/external/zlib.BUILD",
40    patch_args = ["-p1"],
41    # This is a patch that removes the "OF" macro that is used in zlib function
42    # definitions. It is necessary, because libclang, the library used by the
43    # interface generator to parse C/C++ files contains a bug that manifests
44    # itself with macros like this.
45    # We are investigating better ways to avoid this issue. For most "normal"
46    # C and C++ headers, parsing just works.
47    patches = ["//sandboxed_api:bazel/external/zlib.patch"],
48    sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",  # 2020-04-23
49    strip_prefix = "zlib-1.2.11",
50    urls = [
51        "https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz",
52        "https://www.zlib.net/zlib-1.2.11.tar.gz",
53    ],
54)
55