anki/repos.bzl

173 lines
4.9 KiB
Python
Raw Normal View History

"""
Dependencies required to build Anki.
"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
2020-11-24 07:42:10 +01:00
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def register_repos():
"Register required dependency repos."
# bazel
##########
2020-11-24 07:42:10 +01:00
maybe(
http_archive,
name = "bazel_skylib",
sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
],
)
# rust
########
2020-12-03 00:28:14 +01:00
# native.local_repository(
# name = "rules_rust",
2020-12-03 00:28:14 +01:00
# path = "../rules_rust",
# )
2020-11-24 07:42:10 +01:00
maybe(
http_archive,
name = "rules_rust",
strip_prefix = "rules_rust-anki-2021-04-09",
urls = [
"https://github.com/ankitects/rules_rust/archive/anki-2021-04-09.tar.gz",
],
sha256 = "2821b22e065c1b4dc73610b1d6ccbed7ed4d755b316e7e0641cd079b7abe4900",
)
# python
##########
# native.local_repository(
# name = "rules_python",
# path = "../rules_python",
# )
2020-11-24 07:42:10 +01:00
maybe(
http_archive,
name = "rules_python",
strip_prefix = "rules_python-anki-2020-11-04",
urls = [
"https://github.com/ankitects/rules_python/archive/anki-2020-11-04.tar.gz",
],
sha256 = "00e444dc3872a87838c2cb0cf50a15d92ca669385b72998f796d2fd6814356a3",
)
# native.local_repository(
# name = "com_github_ali5h_rules_pip",
# path = "../rules_pip",
# )
2020-11-24 07:42:10 +01:00
maybe(
http_archive,
name = "com_github_ali5h_rules_pip",
strip_prefix = "rules_pip-anki-2020-11-30",
urls = [
"https://github.com/ankitects/rules_pip/archive/anki-2020-11-30.tar.gz",
],
sha256 = "ab4f10967eb87985383a4172d4533dde568b3ff502aa550239eeccead249325b",
)
# javascript
##############
2020-11-24 07:42:10 +01:00
# maybe(
# http_archive,
# name = "build_bazel_rules_nodejs",
# urls = [
# "file:///c:/anki/release.tar.gz",
# "file:///Users/dae/Work/code/dtop/release.tar.gz",
# ],
# )
maybe(
http_archive,
name = "build_bazel_rules_nodejs",
2021-04-23 03:11:47 +02:00
sha256 = "a160d9ac88f2aebda2aa995de3fa3171300c076f06ad1d7c2e1385728b8442fa",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.4.1/rules_nodejs-3.4.1.tar.gz"],
)
# native.local_repository(
# name = "esbuild_toolchain",
# path = "../esbuild_toolchain",
# )
maybe(
http_archive,
name = "esbuild_toolchain",
sha256 = "ac530f935b10e2e45f009ef0a8a2e3f4c95172c2548932fb7ca0d37ad95b6e9e",
urls = ["https://github.com/ankitects/esbuild_toolchain/archive/refs/tags/anki-2021-04-15.tar.gz"],
strip_prefix = "esbuild_toolchain-anki-2021-04-15",
)
# sass
############
# native.local_repository(
# name = "io_bazel_rules_sass",
# path = "../rules_sass",
# )
2020-11-24 07:42:10 +01:00
maybe(
http_archive,
name = "io_bazel_rules_sass",
strip_prefix = "rules_sass-anki-2020-12-23",
urls = [
"https://github.com/ankitects/rules_sass/archive/anki-2020-12-23.tar.gz",
],
sha256 = "224ae14b8d2166b3ab4c5fa9b2ae1828f30620ac628dc152e6c0859c7853bb97",
)
# translations
################
2020-12-23 12:27:35 +01:00
core_i18n_repo = "anki-core-i18n"
2021-04-25 14:01:18 +02:00
core_i18n_commit = "af1bbb50ee876f040e99afcfb8f7f811ce451e90"
core_i18n_zip_csum = "b8da454b0e3341ad8a7ac7da7eb473f1f6051d11289362cec8534643d912e00a"
2020-12-23 12:27:35 +01:00
qtftl_i18n_repo = "anki-desktop-ftl"
2021-04-25 14:01:18 +02:00
qtftl_i18n_commit = "e4f6ba9606fdbfa0e91ba2235da965a115ac19a5"
qtftl_i18n_zip_csum = "ecf768273dd9bce00eee771c425693ab530ab981298acfb137f18180cdc8259b"
i18n_build_content = """
filegroup(
name = "files",
srcs = glob(["**/*.ftl"]),
visibility = ["//visibility:public"],
)
exports_files(["l10n.toml"])
"""
2020-11-24 07:42:10 +01:00
maybe(
2020-12-23 12:27:35 +01:00
http_archive,
name = "rslib_ftl",
build_file_content = i18n_build_content,
2020-12-23 12:27:35 +01:00
strip_prefix = core_i18n_repo + "-" + core_i18n_commit,
urls = [
"https://github.com/ankitects/{}/archive/{}.zip".format(
core_i18n_repo,
core_i18n_commit,
),
],
sha256 = core_i18n_zip_csum,
)
2020-11-24 07:42:10 +01:00
maybe(
2020-12-23 12:27:35 +01:00
http_archive,
2020-11-24 07:42:10 +01:00
name = "extra_ftl",
build_file_content = i18n_build_content,
2020-12-23 12:27:35 +01:00
strip_prefix = qtftl_i18n_repo + "-" + qtftl_i18n_commit,
urls = [
"https://github.com/ankitects/{}/archive/{}.zip".format(
qtftl_i18n_repo,
qtftl_i18n_commit,
),
],
sha256 = qtftl_i18n_zip_csum,
2020-11-24 07:42:10 +01:00
)