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(
|
2021-03-27 09:39:02 +01:00
|
|
|
# name = "rules_rust",
|
2020-12-03 00:28:14 +01:00
|
|
|
# path = "../rules_rust",
|
|
|
|
# )
|
|
|
|
|
2020-11-24 07:42:10 +01:00
|
|
|
maybe(
|
2020-12-23 11:42:45 +01:00
|
|
|
http_archive,
|
2021-03-27 09:39:02 +01:00
|
|
|
name = "rules_rust",
|
2021-06-21 04:12:59 +02:00
|
|
|
strip_prefix = "rules_rust-f66001a3ae396b7695e10ca451a6d89c024529a1",
|
2020-12-23 11:42:45 +01:00
|
|
|
urls = [
|
2021-06-21 04:12:59 +02:00
|
|
|
"https://github.com/bazelbuild/rules_rust/archive/f66001a3ae396b7695e10ca451a6d89c024529a1.zip",
|
2020-12-23 11:42:45 +01:00
|
|
|
],
|
2021-06-21 04:12:59 +02:00
|
|
|
sha256 = "c6f1fe6056d8c3ed44a4eda4b8e6d327312a0ae17b36671c10fd849825edf55f",
|
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",
|
2021-06-21 04:02:06 +02:00
|
|
|
strip_prefix = "rules_pip-fb02cb7bf5c03bc8cd4269679e4aea2e1839b501",
|
2020-12-23 11:42:45 +01:00
|
|
|
urls = [
|
2021-06-21 04:02:06 +02:00
|
|
|
"https://github.com/ali5h/rules_pip/archive/fb02cb7bf5c03bc8cd4269679e4aea2e1839b501.zip",
|
2020-12-23 11:42:45 +01:00
|
|
|
],
|
2021-06-21 04:02:06 +02:00
|
|
|
sha256 = "34195cd437d34a7490276665225de353421e31e34c048715b66918e31d735ff6",
|
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",
|
|
|
|
# ],
|
|
|
|
# )
|
|
|
|
|
2021-05-26 01:09:02 +02:00
|
|
|
# when updating, remember to update pinned versions in package.json
|
2021-04-15 02:53:49 +02:00
|
|
|
maybe(
|
|
|
|
http_archive,
|
2020-12-23 11:42:45 +01:00
|
|
|
name = "build_bazel_rules_nodejs",
|
2021-05-26 01:09:02 +02:00
|
|
|
sha256 = "4a5d654a4ccd4a4c24eca5d319d85a88a650edf119601550c95bf400c8cc897e",
|
|
|
|
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.5.1/rules_nodejs-3.5.1.tar.gz"],
|
2020-12-23 11:42:45 +01:00
|
|
|
)
|
|
|
|
|
2021-04-15 02:53:49 +02:00
|
|
|
# native.local_repository(
|
|
|
|
# name = "esbuild_toolchain",
|
|
|
|
# path = "../esbuild_toolchain",
|
|
|
|
# )
|
|
|
|
|
|
|
|
maybe(
|
|
|
|
http_archive,
|
|
|
|
name = "esbuild_toolchain",
|
2021-06-01 02:11:37 +02:00
|
|
|
sha256 = "7385dfb2acce6517fcfdb16480cf18d1959bafb83d8cddc0c1e95779609f762c",
|
|
|
|
urls = ["https://github.com/ankitects/esbuild_toolchain/archive/refs/tags/anki-2021-06-01.tar.gz"],
|
|
|
|
strip_prefix = "esbuild_toolchain-anki-2021-06-01",
|
2021-04-15 02:53:49 +02:00
|
|
|
)
|
|
|
|
|
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
|
|
|
)
|
|
|
|
|
|
|
|
# translations
|
|
|
|
################
|
|
|
|
|
2020-12-23 12:27:35 +01:00
|
|
|
core_i18n_repo = "anki-core-i18n"
|
2021-09-08 11:19:53 +02:00
|
|
|
core_i18n_commit = "14d5cfad40cfd302a74f71e6ea30efda5827b444"
|
|
|
|
core_i18n_zip_csum = "4459c53ef347398d2a0a56835e6c54e23bfd08e03d5304de41b39f359d1c27b8"
|
2020-11-01 05:26:58 +01:00
|
|
|
|
2020-12-23 12:27:35 +01:00
|
|
|
qtftl_i18n_repo = "anki-desktop-ftl"
|
2021-09-08 11:19:53 +02:00
|
|
|
qtftl_i18n_commit = "5359f84328c1484c5db69edbb6b851acc4160095"
|
|
|
|
qtftl_i18n_zip_csum = "aa7c9ea94d05d2996eb02c198f228cc2bb171ebcda6ac802d7793027191ac73d"
|
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
|
|
|
)
|