Expose MediaPipe's ABSL and Sentencepiece as shared dependencies

PiperOrigin-RevId: 592256006
This commit is contained in:
Sebastian Schmidt 2023-12-19 09:17:17 -08:00 committed by Copybara-Service
parent 4f4f107a8b
commit 5ee24d1662
3 changed files with 28 additions and 40 deletions

View File

@ -21,9 +21,21 @@ bazel_skylib_workspace()
load("@bazel_skylib//lib:versions.bzl", "versions")
versions.check(minimum_bazel_version = "3.7.2")
load("@//third_party:shared_dependencies.bzl", "mediapipe_absl", "mediapipe_sentencepiece")
mediapipe_absl()
mediapipe_sentencepiece()
# 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"
)
http_archive(
name = "rules_cc",
@ -229,6 +241,18 @@ 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,10 +20,7 @@ licenses(["notice"]) # Apache License 2.0
package(default_visibility = ["//visibility:public"])
exports_files([
"LICENSE",
"shared_dependencies.bzl",
])
exports_files(["LICENSE"])
cc_library(
name = "glog",

View File

@ -1,33 +0,0 @@
"""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"],
)