forked from google/mozc
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMODULE.bazel
328 lines (285 loc) · 9.46 KB
/
MODULE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# MODULE.bazel is the new dependency configuration system (Bzlmod), but not used yet by default.
# To use Bzlmod, you need to specify --enable_bzlmod to the Bazel command or modify .bazelrc.
module(name = "mozc")
# absl-cpp: 2024-08-02
# https://github.com/abseil/abseil-cpp
#
# abseil-cpp with patches for Bazel 8.0.0 is used instead of the local Abseil in third_party/.
# Otherwise, `bazel fetch` will fail with the error: "cc_configure_extension no longer available".
# References
# * https://github.com/bazelbuild/bazel/issues/24426
# * https://github.com/bazelbuild/bazel-central-registry/pull/3320
# Also we cannot switch to 20250127.0 until the protobuf team fixes the following issue.
# * https://github.com/protocolbuffers/protobuf/issues/20331
bazel_dep(
name = "abseil-cpp",
version = "20240722.0.bcr.2",
repo_name = "com_google_absl",
)
# This is also workaround for the above issue bazel/issues/24426.
# This bazel_dep should be removed after the issue is fixed.
bazel_dep(
name = "re2",
version = "2024-07-02.bcr.1",
)
# protobuf: 29.3 2025-01-09
# https://github.com/protocolbuffers/protobuf
# We cannot switch to 30.x until the protobuf team fixes the following issue.
# * https://github.com/protocolbuffers/protobuf/issues/20331
bazel_dep(
name = "protobuf",
version = "29.3",
repo_name = "com_google_protobuf",
)
# googletest: 1.15.2 2024-07-31
# https://github.com/google/googletest
# We cannot switch to 1.16.0 until the protobuf team fixes the following issue.
# * https://github.com/protocolbuffers/protobuf/issues/20331
bazel_dep(
name = "googletest",
version = "1.15.2",
repo_name = "com_google_googletest",
)
# platforms: 0.0.10 2024-04-26
# https://github.com/bazelbuild/platforms/
bazel_dep(
name = "platforms",
version = "0.0.10",
)
# bazel_skylib: 1.7.1 2024-06-03
# https://github.com/bazelbuild/bazel-skylib/
bazel_dep(
name = "bazel_skylib",
version = "1.7.1",
)
# rules_python: 1.0.0 2024-12-06
# https://github.com/bazelbuild/rules_python/
bazel_dep(
name = "rules_python",
version = "1.0.0",
)
# Bazel macOS build (3.16.1 2024-12-13)
# https://github.com/bazelbuild/rules_apple
bazel_dep(
name = "rules_apple",
version = "3.16.1",
repo_name = "build_bazel_rules_apple",
)
# Apple Support for Bazel (1.16.0 2024-07-10)
## this must come above 'rules_cc'
## https://github.com/bazelbuild/apple_support/blob/d87e8b07f3345e750834dbb6ce38c7c7d3b8b44b/README.md#bazel-7-setup
bazel_dep(
name = "apple_support",
version = "1.16.0",
repo_name = "build_bazel_apple_support",
)
# rules_cc: 0.0.17 2024-11-19
# https://github.com/bazelbuild/rules_cc/
bazel_dep(
name = "rules_cc",
version = "0.0.17",
)
single_version_override(
module_name = "rules_cc",
patches = [
# Enable to build x86 (32-bit) executables with clang-cl.
# https://github.com/bazelbuild/rules_cc/pull/360
"bazel/rules_cc_BUILD.windows.tpl.patch",
"bazel/rules_cc_windows_cc_configure.bzl.patch",
"bazel/rules_cc_windows_cc_toolchain_config.bzl.patch",
],
version = "0.0.17",
)
cc_configure = use_extension(
"@rules_cc//cc:extensions.bzl",
"cc_configure_extension",
)
use_repo(cc_configure, "local_config_cc")
register_toolchains("@local_config_cc//:all")
# Android NDK rules (0.1.3 2025-01-31)
# https://github.com/bazelbuild/rules_android_ndk
bazel_dep(
name = "rules_android_ndk",
version = "0.1.3",
)
single_version_override(
module_name = "rules_android_ndk",
patches = [
# Might be removed after the folloing PR.
# https://github.com/bazelbuild/rules_android_ndk/pull/63
"bazel/rules_android_ndk.patch",
],
version = "0.1.3",
)
android_ndk_repository_extension = use_extension(
"@rules_android_ndk//:extension.bzl",
"android_ndk_repository_extension",
)
android_ndk_repository_extension.configure(
path = "$WORKSPACE_ROOT/third_party/ndk/android-ndk-r28",
)
use_repo(android_ndk_repository_extension, "androidndk")
register_toolchains("@androidndk//:all")
new_local_repository = use_repo_rule(
"@bazel_tools//tools/build_defs/repo:local.bzl",
"new_local_repository",
)
# Japanese Usage Dictionary
new_local_repository(
name = "ja_usage_dict",
build_file = "@//bazel:BUILD.ja_usage_dict.bazel",
path = "third_party/japanese_usage_dictionary",
)
# Windows Implementation Library (WIL)
# https://github.com/microsoft/wil/
new_local_repository(
name = "com_microsoft_wil",
build_file = "@//bazel:BUILD.wil.bazel",
path = "third_party/wil",
)
pkg_config_repository = use_repo_rule(
"@//bazel:pkg_config_repository.bzl",
"pkg_config_repository",
)
# iBus
pkg_config_repository(
name = "ibus",
packages = [
"glib-2.0",
"gobject-2.0",
"ibus-1.0",
],
)
# Fcitx
new_local_repository(
name = "fcitx",
build_file = "BUILD.fcitx.bazel",
# This path should be updated per the environment.
path = "/usr", # For Debian
)
# Fcitx 5
pkg_config_repository(
name = "fcitx5",
packages = [
"Fcitx5Core",
"Fcitx5Module",
],
)
# Qt for Linux
pkg_config_repository(
name = "qt_linux",
packages = [
"Qt6Core",
"Qt6Gui",
"Qt6Widgets",
],
)
# Qt for macOS
qt_mac_repository = use_repo_rule("@//bazel:qt_mac_repository.bzl", "qt_mac_repository")
MACOS_QT_PATH = "/usr/local/Qt-6.5.2"
qt_mac_repository(
name = "qt_mac",
default_path = MACOS_QT_PATH, # can be replaced with MOZC_QT_PATH envvar.
)
# Qt for Windows
new_local_repository(
name = "qt_win",
build_file = "@//bazel:BUILD.qt_win.bazel",
path = "third_party/qt",
)
# Windows SDK
windows_sdk_repository = use_repo_rule(
"@//bazel:windows_sdk_repository.bzl",
"windows_sdk_repository",
)
windows_sdk_repository(
name = "windows_sdk",
)
# dotnet tool repository (to load "wix")
dotnet_tool_repository = use_repo_rule(
"@//bazel:dotnet_tool_repository.bzl",
"dotnet_tool_repository",
)
dotnet_tool_repository(
name = "wix",
version = "5.0.2",
)
http_file = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
# Material icons
http_file(
name = "material_icon_dictionary_png",
downloaded_file_path = "dictionary.png",
sha256 = "6d2ac7befa038d4f32e07136293acaf5d8645a4daecb6d063f34be2ffea59b55",
urls = [
"https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/chrome_reader_mode/materialiconsoutlined/48dp/1x/outline_chrome_reader_mode_black_48dp.png",
],
)
http_file(
name = "material_icon_dictionary_svg",
downloaded_file_path = "dictionary.svg",
sha256 = "a4c7b9bfb442a7497b72d74358c31034c4fef1ab2a50659834784580751ac04d",
urls = [
"https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/chrome_reader_mode/materialiconsoutlined/24px.svg",
],
)
http_file(
name = "material_icon_properties_png",
downloaded_file_path = "properties.png",
sha256 = "c4ae8bb7992f43157be9d026f76a7039af6e0e3de0f220842208dfda8c38714a",
urls = [
"https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/settings/materialiconsround/48dp/1x/round_settings_black_48dp.png",
],
)
http_file(
name = "material_icon_properties_svg",
downloaded_file_path = "properties.svg",
sha256 = "9b01b133be1caffc680f132d385d0e594262d6cfd29759a63c428050b83fe628",
urls = [
"https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/settings/materialiconsround/24px.svg",
],
)
http_file(
name = "material_icon_tool_png",
downloaded_file_path = "tool.png",
sha256 = "269433bf6d6948a93ab6a57a73ceb5930870223046052cfffe01eeca37327d3e",
urls = [
"https://raw.githubusercontent.com/google/material-design-icons/4.0.0/png/action/build/materialicons/48dp/1x/baseline_build_black_48dp.png",
],
)
http_file(
name = "material_icon_tool_svg",
downloaded_file_path = "tool.svg",
sha256 = "df34fba3d09778db69503a23b688761051dbf65b5bccb0d7b729c69ff61c3804",
urls = [
"https://raw.githubusercontent.com/google/material-design-icons/4.0.0/src/action/build/materialicons/24px.svg",
],
)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Google Toolbox for Mac
# https://github.com/google/google-toolbox-for-mac
# We just need UnitTesting, so strip to the directory and skip dependencies.
GTM_GIT_SHA = "8fbaae947b87c1e66c0934493168fc6d583ed889"
http_archive(
name = "google_toolbox_for_mac",
build_file = "@//bazel:BUILD.google_toolbox_for_mac.bazel",
patch_args = ["-p2"],
patches = ["@//bazel:google_toolbox_for_mac.patch"],
sha256 = "424bca6571778496efa5328ffcca26edf083e282da7074d30b3e980516cea2a4",
strip_prefix = "google-toolbox-for-mac-%s/UnitTesting" % GTM_GIT_SHA,
urls = [
"https://github.com/google/google-toolbox-for-mac/archive/%s.zip" % GTM_GIT_SHA,
],
)
# Zip code (2025-01-12)
http_archive(
name = "zip_code_ken_all",
build_file_content = "exports_files([\"KEN_ALL.CSV\"])",
sha256 = "8736e6a331be40582cfbd86e77c29b6efdbc8425052877e235c8a3c1f7190150",
url = "https://github.com/hiroyuki-komatsu/japanpost_zipcode/raw/refs/heads/main/ken_all.zip",
)
http_archive(
name = "zip_code_jigyosyo",
build_file_content = "exports_files([\"JIGYOSYO.CSV\"])",
sha256 = "0e62af72f56a3039409dc105057051df0e374c2e373a2a068172daaaa1a9af13",
url = "https://github.com/hiroyuki-komatsu/japanpost_zipcode/raw/refs/heads/main/jigyosyo.zip",
)