""" Dependencies required to build Anki. """ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") 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", sha256 = "954aa89b491be4a083304a2cb838019c8b8c3720a7abb9c4cb81ac7a24230cea", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/rules_python/releases/download/0.4.0/rules_python-0.4.0.tar.gz", "https://github.com/bazelbuild/rules_python/releases/download/0.4.0/rules_python-0.4.0.tar.gz", ], ) # 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 = "181c56e793781df381d7ff6ccf35aaec7ec4d812" core_i18n_zip_csum = "407aa6436f1110b1396d47ebc6d8f3df7ae381acc91d236d9b15e46eceb43fb2" qtftl_i18n_repo = "anki-desktop-ftl" qtftl_i18n_commit = "93cd61daa1e3f7625df494d164fe565069162a6f" qtftl_i18n_zip_csum = "b7dbc56a10eafdf4076b22c7f22010d37b33daf4e4b9ca9ff86bdada261204ee" 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, )