Base: codex-main originale (prima del fork aKode)
This commit is contained in:
33
third_party/voice/extensions.bzl
vendored
Normal file
33
third_party/voice/extensions.bzl
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"""Use standard Bazel archives for the standalone builder's pinned sources."""
|
||||
|
||||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
|
||||
|
||||
_BUILD_FILE = """
|
||||
filegroup(
|
||||
name = "sources",
|
||||
srcs = glob(["**"]),
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
"""
|
||||
|
||||
def _voice_sources_impl(module_ctx):
|
||||
manifest = json.decode(module_ctx.read(Label("//third_party/voice:sources.json")))
|
||||
for source in manifest["sources"]:
|
||||
http_file(
|
||||
name = "voice_archive_" + source["name"].replace("-", "_"),
|
||||
urls = [source["url"]],
|
||||
sha256 = source["sha256"],
|
||||
downloaded_file_path = source["archive"],
|
||||
)
|
||||
http_archive(
|
||||
name = "voice_" + source["name"].replace("-", "_"),
|
||||
urls = [source["url"]],
|
||||
sha256 = source["sha256"],
|
||||
strip_prefix = source["root"],
|
||||
# Ninja's pinned codeload URL has no archive filename extension.
|
||||
type = "tar.gz" if source["name"] == "ninja" else "",
|
||||
build_file_content = _BUILD_FILE,
|
||||
)
|
||||
return module_ctx.extension_metadata(reproducible = True)
|
||||
|
||||
voice_sources = module_extension(implementation = _voice_sources_impl)
|
||||
Reference in New Issue
Block a user