anki/repos.bzl
2021-10-02 15:13:37 +10:00

162 lines
4.7 KiB
Python

"""
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")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
def register_repos():
"Register required dependency repos."
# bazel
##########
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
########
# native.local_repository(
# name = "rules_rust",
# path = "../rules_rust",
# )
# pending merge of https://github.com/bazelbuild/rules_rust/pull/955
maybe(
http_archive,
name = "rules_rust",
strip_prefix = "rules_rust-anki-2021-10-02",
urls = [
"https://github.com/ankitects/rules_rust/archive/anki-2021-10-02.tar.gz",
],
sha256 = "5da1130d6e472a0c96774738d959b6d4ab11412677762dfbea83ddc2b938962d",
)
# python
##########
# native.local_repository(
# name = "rules_python",
# path = "../rules_python",
# )
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",
# )
maybe(
http_archive,
name = "com_github_ali5h_rules_pip",
strip_prefix = "rules_pip-fb02cb7bf5c03bc8cd4269679e4aea2e1839b501",
urls = [
"https://github.com/ali5h/rules_pip/archive/fb02cb7bf5c03bc8cd4269679e4aea2e1839b501.zip",
],
sha256 = "34195cd437d34a7490276665225de353421e31e34c048715b66918e31d735ff6",
)
# javascript
##############
# maybe(
# http_archive,
# name = "build_bazel_rules_nodejs",
# urls = [
# "file:///c:/anki/release.tar.gz",
# "file:///Users/dae/Work/code/dtop/release.tar.gz",
# ],
# )
# when updating, remember to update pinned versions in package.json
maybe(
http_archive,
name = "build_bazel_rules_nodejs",
sha256 = "3635797a96c7bfcd0d265dacd722a07335e64d6ded9834af8d3f1b7ba5a25bba",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/4.3.0/rules_nodejs-4.3.0.tar.gz"],
)
# sass
############
# native.local_repository(
# name = "io_bazel_rules_sass",
# path = "../rules_sass",
# )
maybe(
http_archive,
name = "io_bazel_rules_sass",
strip_prefix = "rules_sass-d0cda2205a6e9706ded30f7dd7d30c82b1301fbe",
urls = [
"https://github.com/bazelbuild/rules_sass/archive/d0cda2205a6e9706ded30f7dd7d30c82b1301fbe.zip",
],
sha256 = "640ad20f878a6656968e35f35343359446db91a773224ddf52ae110f1e48bb20",
)
# translations
################
core_i18n_repo = "anki-core-i18n"
core_i18n_commit = "284659a08719a6d3c0aa2449cf09379d910fda15"
core_i18n_zip_csum = "fa5f15b0c4b86c7d1d1f6cbfd407e2876c848980b3fa17ea88daee9e564a0f9c"
qtftl_i18n_repo = "anki-desktop-ftl"
qtftl_i18n_commit = "5359f84328c1484c5db69edbb6b851acc4160095"
qtftl_i18n_zip_csum = "aa7c9ea94d05d2996eb02c198f228cc2bb171ebcda6ac802d7793027191ac73d"
i18n_build_content = """
filegroup(
name = "files",
srcs = glob(["**/*.ftl"]),
visibility = ["//visibility:public"],
)
exports_files(["l10n.toml"])
"""
maybe(
http_archive,
name = "rslib_ftl",
build_file_content = i18n_build_content,
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,
)
maybe(
http_archive,
name = "extra_ftl",
build_file_content = i18n_build_content,
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,
)