2020-11-01 05:26:58 +01:00
|
|
|
"""
|
|
|
|
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")
|
2020-11-01 05:26:58 +01:00
|
|
|
|
2020-11-05 05:15:36 +01:00
|
|
|
def register_repos():
|
|
|
|
"Register required dependency repos."
|
2020-11-01 05:26:58 +01:00
|
|
|
|
|
|
|
# bazel
|
|
|
|
##########
|
|
|
|
|
2020-11-24 07:42:10 +01:00
|
|
|
maybe(
|
|
|
|
http_archive,
|
2020-11-01 05:26:58 +01:00
|
|
|
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 = "io_bazel_rules_rust",
|
|
|
|
# path = "../rules_rust",
|
|
|
|
# )
|
|
|
|
|
2020-11-24 07:42:10 +01:00
|
|
|
maybe(
|
2020-12-23 11:42:45 +01:00
|
|
|
http_archive,
|
2020-11-01 05:26:58 +01:00
|
|
|
name = "io_bazel_rules_rust",
|
2020-12-23 11:42:45 +01:00
|
|
|
strip_prefix = "rules_rust-anki-2020-12-10",
|
|
|
|
urls = [
|
|
|
|
"https://github.com/ankitects/rules_rust/archive/anki-2020-12-10.tar.gz",
|
|
|
|
],
|
|
|
|
sha256 = "80a7647c3c1992c434a462bf424b9138c3c9af6c794ac112f636ca7c8c53180e",
|
2020-11-01 05:26:58 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# python
|
|
|
|
##########
|
|
|
|
|
2020-11-03 23:44:47 +01:00
|
|
|
# native.local_repository(
|
2020-11-01 05:26:58 +01:00
|
|
|
# name = "rules_python",
|
2020-11-03 23:44:47 +01:00
|
|
|
# path = "../rules_python",
|
2020-11-01 05:26:58 +01:00
|
|
|
# )
|
|
|
|
|
2020-11-24 07:42:10 +01:00
|
|
|
maybe(
|
2020-12-23 11:42:45 +01:00
|
|
|
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",
|
2020-11-01 05:26:58 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# native.local_repository(
|
|
|
|
# name = "com_github_ali5h_rules_pip",
|
|
|
|
# path = "../rules_pip",
|
|
|
|
# )
|
|
|
|
|
2020-11-24 07:42:10 +01:00
|
|
|
maybe(
|
|
|
|
http_archive,
|
2020-12-23 11:42:45 +01:00
|
|
|
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",
|
2020-11-01 05:26:58 +01:00
|
|
|
)
|
|
|
|
|
2020-12-23 11:42:45 +01:00
|
|
|
# javascript
|
|
|
|
##############
|
|
|
|
|
2020-11-24 07:42:10 +01:00
|
|
|
# maybe(
|
|
|
|
# http_archive,
|
2020-11-01 05:26:58 +01:00
|
|
|
# name = "build_bazel_rules_nodejs",
|
|
|
|
# urls = [
|
|
|
|
# "file:///c:/anki/release.tar.gz",
|
|
|
|
# "file:///Users/dae/Work/code/dtop/release.tar.gz",
|
|
|
|
# ],
|
|
|
|
# )
|
|
|
|
|
2020-12-23 11:42:45 +01:00
|
|
|
maybe(
|
|
|
|
http_archive,
|
|
|
|
name = "build_bazel_rules_nodejs",
|
|
|
|
sha256 = "6142e9586162b179fdd570a55e50d1332e7d9c030efd853453438d607569721d",
|
|
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.0.0/rules_nodejs-3.0.0.tar.gz"],
|
|
|
|
)
|
|
|
|
|
2020-11-01 05:26:58 +01:00
|
|
|
# sass
|
|
|
|
############
|
|
|
|
|
2020-12-23 07:05:15 +01:00
|
|
|
# native.local_repository(
|
|
|
|
# name = "io_bazel_rules_sass",
|
|
|
|
# path = "../rules_sass",
|
|
|
|
# )
|
|
|
|
|
2020-11-24 07:42:10 +01:00
|
|
|
maybe(
|
|
|
|
http_archive,
|
2020-11-01 05:26:58 +01:00
|
|
|
name = "io_bazel_rules_sass",
|
2020-12-23 07:05:15 +01:00
|
|
|
strip_prefix = "rules_sass-anki-2020-12-23",
|
|
|
|
urls = [
|
|
|
|
"https://github.com/ankitects/rules_sass/archive/anki-2020-12-23.tar.gz",
|
|
|
|
],
|
|
|
|
sha256 = "224ae14b8d2166b3ab4c5fa9b2ae1828f30620ac628dc152e6c0859c7853bb97",
|
2020-11-01 05:26:58 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# svelte
|
|
|
|
##########
|
|
|
|
|
|
|
|
# native.local_repository(
|
|
|
|
# name = "build_bazel_rules_svelte",
|
|
|
|
# path = "../rules_svelte",
|
|
|
|
# )
|
|
|
|
|
2020-12-23 07:05:15 +01:00
|
|
|
maybe(
|
|
|
|
http_archive,
|
|
|
|
name = "build_bazel_rules_svelte",
|
2021-02-05 23:16:41 +01:00
|
|
|
strip_prefix = "rules_svelte-anki-2021-02-06",
|
2020-12-23 07:05:15 +01:00
|
|
|
urls = [
|
2021-02-05 23:16:41 +01:00
|
|
|
"https://github.com/ankitects/rules_svelte/archive/anki-2021-02-06.tar.gz",
|
2020-12-23 07:05:15 +01:00
|
|
|
],
|
2021-02-05 23:32:14 +01:00
|
|
|
sha256 = "f77a96ae5a354f8c3c24045f3bee8521bfe56224292d4f71184a3382784640eb",
|
2020-12-23 07:05:15 +01:00
|
|
|
)
|
|
|
|
|
2020-11-01 05:26:58 +01:00
|
|
|
# translations
|
|
|
|
################
|
|
|
|
|
2020-12-23 12:27:35 +01:00
|
|
|
core_i18n_repo = "anki-core-i18n"
|
2021-03-10 01:46:34 +01:00
|
|
|
core_i18n_commit = "24153bfffb0f8487098e6b84b4f40f257a722a55"
|
|
|
|
core_i18n_zip_csum = "e89abe3f6ce28bb2c580bbcf59092a8fabed0b72aeeb83cc7f026df201da2d2f"
|
2020-11-01 05:26:58 +01:00
|
|
|
|
2020-12-23 12:27:35 +01:00
|
|
|
qtftl_i18n_repo = "anki-desktop-ftl"
|
2021-03-10 01:46:34 +01:00
|
|
|
qtftl_i18n_commit = "2f3651fcdf41d9f0c8063288be145dca0410cecf"
|
|
|
|
qtftl_i18n_zip_csum = "f588d33fcae37e2600c4e5c6a8cf150b83a0ac93f95639acb6e7f5e14555cc21"
|
2020-11-01 05:26:58 +01:00
|
|
|
|
2020-11-17 08:42:43 +01:00
|
|
|
i18n_build_content = """
|
2020-11-01 05:26:58 +01:00
|
|
|
filegroup(
|
|
|
|
name = "files",
|
|
|
|
srcs = glob(["**/*.ftl"]),
|
|
|
|
visibility = ["//visibility:public"],
|
2020-11-04 10:20:49 +01:00
|
|
|
)
|
|
|
|
exports_files(["l10n.toml"])
|
2020-11-17 08:42:43 +01:00
|
|
|
"""
|
|
|
|
|
2020-11-24 07:42:10 +01:00
|
|
|
maybe(
|
2020-12-23 12:27:35 +01:00
|
|
|
http_archive,
|
2020-11-17 12:47:47 +01:00
|
|
|
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-17 12:47:47 +01:00
|
|
|
)
|
2020-11-01 05:26:58 +01:00
|
|
|
|
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
|
|
|
)
|