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 15# Workspace definition used when Bzlmod is disabled 16workspace(name = "com_google_sandboxed_api") 17 18load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 19load("//sandboxed_api/bazel:sapi_deps.bzl", "sapi_deps") 20 21# Load Sandboxed API dependencies 22sapi_deps() 23 24load("@bazel_skylib//lib:versions.bzl", "versions") 25 26versions.check(minimum_bazel_version = "5.1.0") 27 28load("@rules_python//python:repositories.bzl", "py_repositories") 29 30py_repositories() 31 32load("@rules_python//python:pip.bzl", "pip_parse") 33 34pip_parse( 35 name = "pypi", 36 requirements_lock = "//sandboxed_api/tools/python_generator:requirements_lock.txt", 37) 38 39load("@pypi//:requirements.bzl", "install_deps") 40 41# Initialize repositories for all packages in requirements_lock.txt. 42install_deps() 43 44load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") 45 46protobuf_deps() 47 48load( 49 "//sandboxed_api/bazel:llvm_config.bzl", 50 "llvm_disable_optional_support_deps", 51) 52 53llvm_disable_optional_support_deps() 54 55# zlib, only needed for examples 56http_archive( 57 name = "net_zlib", 58 build_file = "//sandboxed_api:bazel/external/zlib.BUILD", 59 patch_args = ["-p1"], 60 # This is a patch that removes the "OF" macro that is used in zlib function 61 # definitions. It is necessary, because libclang, the library used by the 62 # interface generator to parse C/C++ files contains a bug that manifests 63 # itself with macros like this. 64 # We are investigating better ways to avoid this issue. For most "normal" 65 # C and C++ headers, parsing just works. 66 patches = ["//sandboxed_api:bazel/external/zlib.patch"], 67 sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", # 2020-04-23 68 strip_prefix = "zlib-1.2.11", 69 urls = [ 70 "https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz", 71 "https://www.zlib.net/zlib-1.2.11.tar.gz", 72 ], 73) 74