Expose MediaPipe's ABSL and Sentencepiece as shared dependencies

PiperOrigin-RevId: 590320902
This commit is contained in:
Sebastian Schmidt 2023-12-12 13:38:51 -08:00 committed by Copybara-Service
parent 4237b765ce
commit 15f2b32006
3 changed files with 40 additions and 28 deletions

View File

@ -21,21 +21,9 @@ bazel_skylib_workspace()
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "3.7.2")
# ABSL cpp library lts_2023_01_25.
http_archive(
name = "com_google_absl",
urls = [
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.0.tar.gz",
],
patches = [
"@//third_party:com_google_absl_windows_patch.diff"
],
patch_args = [
"-p1",
],
strip_prefix = "abseil-cpp-20230125.0",
sha256 = "3ea49a7d97421b88a8c48a0de16c16048e17725c7ec0f1d3ea2683a2a75adc21"
)
load("@//third_party:shared_dependencies.bzl", "mediapipe_absl", "mediapipe_sentencepiece")
mediapipe_absl()
mediapipe_sentencepiece()
http_archive(
name = "rules_cc",
@ -241,18 +229,6 @@ http_archive(
build_file = "@//third_party:pffft.BUILD",
)
# sentencepiece
http_archive(
name = "com_google_sentencepiece",
strip_prefix = "sentencepiece-0.1.96",
sha256 = "8409b0126ebd62b256c685d5757150cf7fcb2b92a2f2b98efb3f38fc36719754",
urls = [
"https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip"
],
build_file = "@//third_party:sentencepiece.BUILD",
patches = ["@//third_party:com_google_sentencepiece.diff"],
patch_args = ["-p1"],
)
http_archive(
name = "darts_clone",

5
third_party/BUILD vendored
View File

@ -20,7 +20,10 @@ licenses(["notice"]) # Apache License 2.0
package(default_visibility = ["//visibility:public"])
exports_files(["LICENSE"])
exports_files([
"LICENSE",
"shared_dependencies.bzl",
])
cc_library(
name = "glog",

33
third_party/shared_dependencies.bzl vendored Normal file
View File

@ -0,0 +1,33 @@
"""MediaPipe's shared dependencies that can be used by dependent projects. Includes build patches."""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# ABSL cpp library lts_2023_01_25.
def mediapipe_absl():
http_archive(
name = "com_google_absl",
urls = [
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20230125.0.tar.gz",
],
patches = [
"@//third_party:com_google_absl_windows_patch.diff",
],
patch_args = [
"-p1",
],
strip_prefix = "abseil-cpp-20230125.0",
sha256 = "3ea49a7d97421b88a8c48a0de16c16048e17725c7ec0f1d3ea2683a2a75adc21",
)
def mediapipe_sentencepiece():
http_archive(
name = "com_google_sentencepiece",
strip_prefix = "sentencepiece-0.1.96",
sha256 = "8409b0126ebd62b256c685d5757150cf7fcb2b92a2f2b98efb3f38fc36719754",
urls = [
"https://github.com/google/sentencepiece/archive/refs/tags/v0.1.96.zip",
],
build_file = "@//third_party:sentencepiece.BUILD",
patches = ["@//third_party:com_google_sentencepiece.diff"],
patch_args = ["-p1"],
)