google-research

Форк
0
478 строк · 16.7 Кб
1
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
2

3
# Probably wanna used versioned version
4
http_archive(
5
    name = "riegeli",
6
    strip_prefix = "riegeli-master",
7
    urls = [
8
        "https://github.com/google/riegeli/archive/master.zip",
9
    ],
10
)
11

12
http_archive(
13
    name = "org_brotli",
14
    patch_args = ["-p1"],
15
    patches = ["@riegeli//third_party:brotli.patch"],
16
    sha256 = "fec5a1d26f3dd102c542548aaa704f655fecec3622a24ec6e97768dcb3c235ff",
17
    strip_prefix = "brotli-68f1b90ad0d204907beb58304d0bd06391001a4d",
18
    urls = ["https://github.com/google/brotli/archive/68f1b90ad0d204907beb58304d0bd06391001a4d.zip"],  # 2021-08-18
19
)
20

21
http_archive(
22
    name = "net_zstd",
23
    build_file = "@riegeli//third_party:net_zstd.BUILD",
24
    sha256 = "b6c537b53356a3af3ca3e621457751fa9a6ba96daf3aebb3526ae0f610863532",
25
    strip_prefix = "zstd-1.4.5/lib",
26
    urls = ["https://github.com/facebook/zstd/archive/v1.4.5.zip"],  # 2020-05-22
27
)
28

29
http_archive(
30
    name = "crc32c",
31
    build_file = "@riegeli//third_party:crc32.BUILD",
32
    sha256 = "338f1d9d95753dc3cdd882dfb6e176bbb4b18353c29c411ebcb7b890f361722e",
33
    strip_prefix = "crc32c-1.1.0",
34
    urls = ["https://github.com/google/crc32c/archive/1.1.0.zip"],  # 2019-05-24
35
)
36

37
http_archive(
38
    name = "zlib",
39
    build_file = "@riegeli//third_party:zlib.BUILD",
40
    sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
41
    strip_prefix = "zlib-1.2.11",
42
    urls = ["http://zlib.net/fossils/zlib-1.2.11.tar.gz"],  # 2017-01-15
43
)
44

45
http_archive(
46
    name = "highwayhash",
47
    build_file = "@riegeli//third_party:highwayhash.BUILD",
48
    sha256 = "cf891e024699c82aabce528a024adbe16e529f2b4e57f954455e0bf53efae585",
49
    strip_prefix = "highwayhash-276dd7b4b6d330e4734b756e97ccfb1b69cc2e12",
50
    urls = ["https://github.com/google/highwayhash/archive/276dd7b4b6d330e4734b756e97ccfb1b69cc2e12.zip"],  # 2019-02-22
51
)
52

53
# Pin to mediapipe GitHub version (latest as of 2021-12-13 is 0.8.9)
54
http_archive(
55
    name = "mediapipe",
56
    strip_prefix = "mediapipe-0.8.9",
57
    urls = [
58
        "https://github.com/google/mediapipe/archive/refs/tags/v0.8.9.tar.gz",
59
    ],
60
)
61

62
# ------------- Begin mediapipe dependencies ----------------
63

64
# Bazel does not support transitive external dependencies. All contents of mediapipe must be copied here.
65
http_archive(
66
    name = "bazel_skylib",
67
    type = "tar.gz",
68
    urls = [
69
        "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
70
        "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz",
71
    ],
72
    sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c",
73
)
74
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
75
bazel_skylib_workspace()
76
load("@bazel_skylib//lib:versions.bzl", "versions")
77
versions.check(minimum_bazel_version = "3.7.2")
78

79
# ABSL cpp library lts_2021_03_24, patch 2.
80
http_archive(
81
    name = "com_google_absl",
82
    urls = [
83
        "https://github.com/abseil/abseil-cpp/archive/refs/tags/20210324.2.tar.gz",
84
    ],
85
    # Remove after https://github.com/abseil/abseil-cpp/issues/326 is solved.
86
    patches = [
87
        "@mediapipe//third_party:com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff"
88
    ],
89
    patch_args = [
90
        "-p1",
91
    ],
92
    strip_prefix = "abseil-cpp-20210324.2",
93
    sha256 = "59b862f50e710277f8ede96f083a5bb8d7c9595376146838b9580be90374ee1f"
94
)
95

96
http_archive(
97
    name = "rules_cc",
98
    strip_prefix = "rules_cc-0.0.1",
99
    urls = ["https://github.com/bazelbuild/rules_cc/archive/refs/tags/0.0.1.zip"],
100
)
101

102
http_archive(
103
   name = "rules_foreign_cc",
104
   strip_prefix = "rules_foreign_cc-0.1.0",
105
   url = "https://github.com/bazelbuild/rules_foreign_cc/archive/0.1.0.zip",
106
)
107

108
load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependencies")
109

110
rules_foreign_cc_dependencies()
111

112
# This is used to select all contents of the archives for CMake-based packages to give CMake access to them.
113
all_content = """filegroup(name = "all", srcs = glob(["**"]), visibility = ["//visibility:public"])"""
114

115
# GoogleTest/GoogleMock framework. Used by most unit-tests.
116
# Last updated 2021-07-02.
117
http_archive(
118
    name = "com_google_googletest",
119
    urls = ["https://github.com/google/googletest/archive/4ec4cd23f486bf70efcc5d2caa40f24368f752e3.zip"],
120
    strip_prefix = "googletest-4ec4cd23f486bf70efcc5d2caa40f24368f752e3",
121
    sha256 = "de682ea824bfffba05b4e33b67431c247397d6175962534305136aa06f92e049",
122
)
123

124
# Google Benchmark library.
125
http_archive(
126
    name = "com_google_benchmark",
127
    urls = ["https://github.com/google/benchmark/archive/refs/tags/v1.6.1.zip"],
128
    strip_prefix = "benchmark-v1.6.1.zip",
129
    build_file = "@mediapipe//third_party:benchmark.BUILD",
130
)
131

132

133
# gflags needed by glog
134
http_archive(
135
    name = "com_github_gflags_gflags",
136
    strip_prefix = "gflags-2.2.2",
137
    sha256 = "19713a36c9f32b33df59d1c79b4958434cb005b5b47dc5400a7a4b078111d9b5",
138
    url = "https://github.com/gflags/gflags/archive/v2.2.2.zip",
139
)
140

141
# 2020-08-21. Change?
142
http_archive(
143
    name = "com_github_glog_glog",
144
    strip_prefix = "glog-0a2e5931bd5ff22fd3bf8999eb8ce776f159cda6",
145
    sha256 = "58c9b3b6aaa4dd8b836c0fd8f65d0f941441fb95e27212c5eeb9979cfd3592ab",
146
    urls = [
147
        "https://github.com/google/glog/archive/0a2e5931bd5ff22fd3bf8999eb8ce776f159cda6.zip",
148
    ],
149
)
150
http_archive(
151
    name = "com_github_glog_glog_no_gflags",
152
    strip_prefix = "glog-0a2e5931bd5ff22fd3bf8999eb8ce776f159cda6",
153
    sha256 = "58c9b3b6aaa4dd8b836c0fd8f65d0f941441fb95e27212c5eeb9979cfd3592ab",
154
    build_file = "@mediapipe//third_party:glog_no_gflags.BUILD",
155
    urls = [
156
        "https://github.com/google/glog/archive/0a2e5931bd5ff22fd3bf8999eb8ce776f159cda6.zip",
157
    ],
158
    patches = [
159
        "@mediapipe//third_party:com_github_glog_glog_9779e5ea6ef59562b030248947f787d1256132ae.diff",
160
    ],
161
    patch_args = [
162
        "-p1",
163
    ],
164
)
165

166
# easyexif
167
http_archive(
168
    name = "easyexif",
169
    url = "https://github.com/mayanklahiri/easyexif/archive/master.zip",
170
    strip_prefix = "easyexif-master",
171
    build_file = "@mediapipe//third_party:easyexif.BUILD",
172
)
173

174
# libyuv
175
http_archive(
176
    name = "libyuv",
177
    # Error: operand type mismatch for `vbroadcastss' caused by commit 8a13626e42f7fdcf3a6acbb0316760ee54cda7d8.
178
    urls = ["https://chromium.googlesource.com/libyuv/libyuv/+archive/2525698acba9bf9b701ba6b4d9584291a1f62257.tar.gz"],
179
    build_file = "@mediapipe//third_party:libyuv.BUILD",
180
)
181

182
# Note: protobuf-javalite is no longer released as a separate download, it's included in the main Java download.
183
# ...but the Java download is currently broken, so we use the "source" download.
184
http_archive(
185
    name = "com_google_protobuf_javalite",
186
    sha256 = "87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
187
    strip_prefix = "protobuf-3.19.1",
188
    urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz"],
189
)
190

191
http_archive(
192
    name = "com_google_protobuf",
193
    sha256 = "87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
194
    strip_prefix = "protobuf-3.19.1",
195
    urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz"],
196
    patches = [
197
        "@mediapipe//third_party:com_google_protobuf_fixes.diff"
198
    ],
199
    patch_args = [
200
        "-p1",
201
    ],
202
)
203

204
http_archive(
205
    name = "com_google_audio_tools",
206
    strip_prefix = "multichannel-audio-tools-master",
207
    urls = ["https://github.com/google/multichannel-audio-tools/archive/master.zip"],
208
)
209

210
# 2020-07-09
211
http_archive(
212
    name = "pybind11_bazel",
213
    strip_prefix = "pybind11_bazel-203508e14aab7309892a1c5f7dd05debda22d9a5",
214
    urls = ["https://github.com/pybind/pybind11_bazel/archive/203508e14aab7309892a1c5f7dd05debda22d9a5.zip"],
215
    sha256 = "75922da3a1bdb417d820398eb03d4e9bd067c4905a4246d35a44c01d62154d91",
216
)
217

218
# Point to the commit that deprecates the usage of Eigen::MappedSparseMatrix.
219
http_archive(
220
    name = "pybind11",
221
    urls = [
222
        "https://github.com/pybind/pybind11/archive/70a58c577eaf067748c2ec31bfd0b0a614cffba6.zip",
223
    ],
224
    sha256 = "b971842fab1b5b8f3815a2302331782b7d137fef0e06502422bc4bc360f4956c",
225
    strip_prefix = "pybind11-70a58c577eaf067748c2ec31bfd0b0a614cffba6",
226
    build_file = "@pybind11_bazel//:pybind11.BUILD",
227
)
228

229
# Point to the commit that deprecates the usage of Eigen::MappedSparseMatrix.
230
http_archive(
231
    name = "ceres_solver",
232
    url = "https://github.com/ceres-solver/ceres-solver/archive/123fba61cf2611a3c8bddc9d91416db26b10b558.zip",
233
    patches = [
234
        "@mediapipe//third_party:ceres_solver_compatibility_fixes.diff"
235
    ],
236
    patch_args = [
237
        "-p1",
238
    ],
239
    strip_prefix = "ceres-solver-123fba61cf2611a3c8bddc9d91416db26b10b558",
240
    sha256 = "8b7b16ceb363420e0fd499576daf73fa338adb0b1449f58bea7862766baa1ac7"
241
)
242

243
http_archive(
244
    name = "opencv",
245
    build_file_content = all_content,
246
    strip_prefix = "opencv-3.4.10",
247
    urls = ["https://github.com/opencv/opencv/archive/3.4.10.tar.gz"],
248
)
249

250
new_local_repository(
251
    name = "linux_opencv",
252
    build_file = "@mediapipe//third_party:opencv_linux.BUILD",
253
    path = "/usr",
254
)
255

256
new_local_repository(
257
    name = "linux_ffmpeg",
258
    build_file = "@mediapipe//third_party:ffmpeg_linux.BUILD",
259
    path = "/usr"
260
)
261

262
new_local_repository(
263
    name = "macos_opencv",
264
    build_file = "@mediapipe//third_party:opencv_macos.BUILD",
265
    path = "/usr/local/opt/opencv@3",
266
)
267

268
new_local_repository(
269
    name = "macos_ffmpeg",
270
    build_file = "@mediapipe//third_party:ffmpeg_macos.BUILD",
271
    path = "/usr/local/opt/ffmpeg",
272
)
273

274
new_local_repository(
275
    name = "windows_opencv",
276
    build_file = "@mediapipe//third_party:opencv_windows.BUILD",
277
    path = "C:\\opencv\\build",
278
)
279

280
http_archive(
281
    name = "android_opencv",
282
    build_file = "@mediapipe//third_party:opencv_android.BUILD",
283
    strip_prefix = "OpenCV-android-sdk",
284
    type = "zip",
285
    url = "https://github.com/opencv/opencv/releases/download/3.4.3/opencv-3.4.3-android-sdk.zip",
286
)
287

288
# After OpenCV 3.2.0, the pre-compiled opencv2.framework has google protobuf symbols, which will
289
# trigger duplicate symbol errors in the linking stage of building a mediapipe ios app.
290
# To get a higher version of OpenCV for iOS, opencv2.framework needs to be built from source with
291
# '-DBUILD_PROTOBUF=OFF -DBUILD_opencv_dnn=OFF'.
292
http_archive(
293
    name = "ios_opencv",
294
    sha256 = "7dd536d06f59e6e1156b546bd581523d8df92ce83440002885ec5abc06558de2",
295
    build_file = "@mediapipe//third_party:opencv_ios.BUILD",
296
    type = "zip",
297
    url = "https://github.com/opencv/opencv/releases/download/3.2.0/opencv-3.2.0-ios-framework.zip",
298
)
299

300
http_archive(
301
    name = "stblib",
302
    strip_prefix = "stb-b42009b3b9d4ca35bc703f5310eedc74f584be58",
303
    sha256 = "13a99ad430e930907f5611325ec384168a958bf7610e63e60e2fd8e7b7379610",
304
    urls = ["https://github.com/nothings/stb/archive/b42009b3b9d4ca35bc703f5310eedc74f584be58.tar.gz"],
305
    build_file = "@mediapipe//third_party:stblib.BUILD",
306
    patches = [
307
        "@mediapipe//third_party:stb_image_impl.diff"
308
    ],
309
    patch_args = [
310
        "-p1",
311
    ],
312
)
313

314
# iOS basic build deps.
315

316
http_archive(
317
    name = "build_bazel_rules_apple",
318
    sha256 = "77e8bf6fda706f420a55874ae6ee4df0c9d95da6c7838228b26910fc82eea5a2",
319
    url = "https://github.com/bazelbuild/rules_apple/releases/download/0.32.0/rules_apple.0.32.0.tar.gz",
320
    patches = [
321
        # Bypass checking ios unit test runner when building MP ios applications.
322
        "@mediapipe//third_party:build_bazel_rules_apple_bypass_test_runner_check.diff"
323
    ],
324
    patch_args = [
325
        "-p1",
326
    ],
327
)
328

329
load(
330
    "@build_bazel_rules_apple//apple:repositories.bzl",
331
    "apple_rules_dependencies",
332
)
333

334
apple_rules_dependencies()
335

336
load(
337
    "@build_bazel_rules_swift//swift:repositories.bzl",
338
    "swift_rules_dependencies",
339
)
340

341
swift_rules_dependencies()
342

343
http_archive(
344
    name = "build_bazel_apple_support",
345
    sha256 = "741366f79d900c11e11d8efd6cc6c66a31bfb2451178b58e0b5edc6f1db17b35",
346
    urls = [
347
        "https://github.com/bazelbuild/apple_support/releases/download/0.10.0/apple_support.0.10.0.tar.gz"
348
    ],
349
)
350

351
load(
352
    "@build_bazel_apple_support//lib:repositories.bzl",
353
    "apple_support_dependencies",
354
)
355

356
apple_support_dependencies()
357

358
# More iOS deps.
359

360
http_archive(
361
    name = "google_toolbox_for_mac",
362
    url = "https://github.com/google/google-toolbox-for-mac/archive/v2.2.1.zip",
363
    sha256 = "e3ac053813c989a88703556df4dc4466e424e30d32108433ed6beaec76ba4fdc",
364
    strip_prefix = "google-toolbox-for-mac-2.2.1",
365
    build_file = "@mediapipe//third_party:google_toolbox_for_mac.BUILD",
366
)
367

368
# Maven dependencies.
369

370
RULES_JVM_EXTERNAL_TAG = "4.0"
371
RULES_JVM_EXTERNAL_SHA = "31701ad93dbfe544d597dbe62c9a1fdd76d81d8a9150c2bf1ecf928ecdf97169"
372

373
http_archive(
374
    name = "rules_jvm_external",
375
    strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
376
    sha256 = RULES_JVM_EXTERNAL_SHA,
377
    url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
378
)
379

380
load("@rules_jvm_external//:defs.bzl", "maven_install")
381

382
# Important: there can only be one maven_install rule. Add new maven deps here.
383
maven_install(
384
    artifacts = [
385
        "androidx.concurrent:concurrent-futures:1.0.0-alpha03",
386
        "androidx.lifecycle:lifecycle-common:2.3.1",
387
        "androidx.activity:activity:1.2.2",
388
        "androidx.exifinterface:exifinterface:1.3.3",
389
        "androidx.fragment:fragment:1.3.4",
390
        "androidx.annotation:annotation:aar:1.1.0",
391
        "androidx.appcompat:appcompat:aar:1.1.0-rc01",
392
        "androidx.camera:camera-core:1.0.0-beta10",
393
        "androidx.camera:camera-camera2:1.0.0-beta10",
394
        "androidx.camera:camera-lifecycle:1.0.0-beta10",
395
        "androidx.constraintlayout:constraintlayout:aar:1.1.3",
396
        "androidx.core:core:aar:1.1.0-rc03",
397
        "androidx.legacy:legacy-support-v4:aar:1.0.0",
398
        "androidx.recyclerview:recyclerview:aar:1.1.0-beta02",
399
        "androidx.test.espresso:espresso-core:3.1.1",
400
        "com.github.bumptech.glide:glide:4.11.0",
401
        "com.google.android.material:material:aar:1.0.0-rc01",
402
        "com.google.auto.value:auto-value:1.8.1",
403
        "com.google.auto.value:auto-value-annotations:1.8.1",
404
        "com.google.code.findbugs:jsr305:latest.release",
405
        "com.google.android.datatransport:transport-api:3.0.0",
406
        "com.google.android.datatransport:transport-backend-cct:3.1.0",
407
        "com.google.android.datatransport:transport-runtime:3.1.0",
408
        "com.google.flogger:flogger-system-backend:0.6",
409
        "com.google.flogger:flogger:0.6",
410
        "com.google.guava:guava:27.0.1-android",
411
        "com.google.guava:listenablefuture:1.0",
412
        "junit:junit:4.12",
413
        "org.hamcrest:hamcrest-library:1.3",
414
    ],
415
    repositories = [
416
        "https://maven.google.com",
417
        "https://dl.google.com/dl/android/maven2",
418
        "https://repo1.maven.org/maven2",
419
        "https://jcenter.bintray.com",
420
    ],
421
    fetch_sources = True,
422
    version_conflict_policy = "pinned",
423
)
424

425
# Needed by TensorFlow
426
http_archive(
427
    name = "io_bazel_rules_closure",
428
    sha256 = "e0a111000aeed2051f29fcc7a3f83be3ad8c6c93c186e64beb1ad313f0c7f9f9",
429
    strip_prefix = "rules_closure-cf1e44edb908e9616030cc83d085989b8e6cd6df",
430
    urls = [
431
        "http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz",
432
        "https://github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz",  # 2019-04-04
433
    ],
434
)
435

436
# Tensorflow repo should always go after the other external dependencies.
437
# 2021-12-02
438
_TENSORFLOW_GIT_COMMIT = "18a1dc0ba806dc023808531f0373d9ec068e64bf"
439
_TENSORFLOW_SHA256 = "85b90416f7a11339327777bccd634de00ca0de2cf334f5f0727edcb11ff9289a"
440
http_archive(
441
    name = "org_tensorflow",
442
    urls = [
443
      "https://github.com/tensorflow/tensorflow/archive/%s.tar.gz" % _TENSORFLOW_GIT_COMMIT,
444
    ],
445
    patches = [
446
        "@mediapipe//third_party:org_tensorflow_compatibility_fixes.diff",
447
        "@mediapipe//third_party:org_tensorflow_objc_cxx17.diff",
448
        # Diff is generated with a script, don't update it manually.
449
        "@mediapipe//third_party:org_tensorflow_custom_ops.diff",
450
    ],
451
    patch_args = [
452
        "-p1",
453
    ],
454
    strip_prefix = "tensorflow-%s" % _TENSORFLOW_GIT_COMMIT,
455
    sha256 = _TENSORFLOW_SHA256,
456
)
457

458
load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")
459
tf_workspace3()
460
load("@org_tensorflow//tensorflow:workspace2.bzl", "tf_workspace2")
461
tf_workspace2()
462

463
# Edge TPU
464
http_archive(
465
  name = "libedgetpu",
466
  sha256 = "14d5527a943a25bc648c28a9961f954f70ba4d79c0a9ca5ae226e1831d72fe80",
467
  strip_prefix = "libedgetpu-3164995622300286ef2bb14d7fdc2792dae045b7",
468
  urls = [
469
    "https://github.com/google-coral/libedgetpu/archive/3164995622300286ef2bb14d7fdc2792dae045b7.tar.gz"
470
  ],
471
)
472
load("@libedgetpu//:workspace.bzl", "libedgetpu_dependencies")
473
libedgetpu_dependencies()
474

475
load("@coral_crosstool//:configure.bzl", "cc_crosstool")
476
cc_crosstool(name = "crosstool")
477

478
# ------------- End mediapipe dependencies ----------------
479

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.