From 334244be6864dd1dbec9bc8bb4996cc286a8e3e3 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Thu, 27 Sep 2018 10:31:36 -0700 Subject: Add tf.strings.unicode_script, which detects the script of a unicode codepoint based on standard ranges. PiperOrigin-RevId: 214796357 --- third_party/icu/BUILD | 1 + third_party/icu/BUILD.bazel | 88 +++++++++++++++++++++++++++++++++++++++++++ third_party/icu/workspace.bzl | 15 ++++++++ 3 files changed, 104 insertions(+) create mode 100644 third_party/icu/BUILD create mode 100644 third_party/icu/BUILD.bazel create mode 100644 third_party/icu/workspace.bzl (limited to 'third_party') diff --git a/third_party/icu/BUILD b/third_party/icu/BUILD new file mode 100644 index 0000000000..82bab3ffd9 --- /dev/null +++ b/third_party/icu/BUILD @@ -0,0 +1 @@ +# This empty BUILD file is required to make Bazel treat this directory as a package. diff --git a/third_party/icu/BUILD.bazel b/third_party/icu/BUILD.bazel new file mode 100644 index 0000000000..36d6b9006b --- /dev/null +++ b/third_party/icu/BUILD.bazel @@ -0,0 +1,88 @@ +package( + default_visibility = ["//visibility:public"], +) + +licenses(["notice"]) # Apache 2.0 + +exports_files([ + "icu4c/LICENSE", + "icu4j/main/shared/licenses/LICENSE", +]) + +cc_library( + name = "headers", + hdrs = glob(["icu4c/source/common/unicode/*.h"]), + includes = [ + "icu4c/source/common", + ], + deps = [ + ], +) + +cc_library( + name = "common", + hdrs = glob(["icu4c/source/common/unicode/*.h"]), + includes = [ + "icu4c/source/common", + ], + deps = [ + ":icuuc", + ], +) + +cc_library( + name = "icuuc", + srcs = glob( + [ + "icu4c/source/common/*.c", + "icu4c/source/common/*.cpp", + "icu4c/source/stubdata/*.cpp", + ], + ), + hdrs = glob([ + "icu4c/source/common/*.h", + ]), + copts = [ + "-DU_COMMON_IMPLEMENTATION", + "-DU_HAVE_STD_ATOMICS", + ] + select({ + ":android": [ + "-fdata-sections", + "-DGOOGLE_VENDOR_SRC_BRANCH", + "-DU_HAVE_NL_LANGINFO_CODESET=0", + "-Wno-deprecated-declarations", + ], + ":apple": [ + "-DGOOGLE_VENDOR_SRC_BRANCH", + "-Wno-shorten-64-to-32", + "-Wno-unused-variable", + ], + ":windows": [ + "/utf-8", + "/DLOCALE_ALLOW_NEUTRAL_NAMES=0", + ], + "//conditions:default": [], + }), + tags = ["requires-rtti"], + visibility = [ + "//visibility:private", + ], + deps = [ + ":headers", + ], +) + +config_setting( + name = "android", + values = {"crosstool_top": "//external:android/crosstool"}, +) + +config_setting( + name = "apple", + values = {"cpu": "darwin"}, +) + +config_setting( + name = "windows", + values = {"cpu": "x64_windows"}, +) diff --git a/third_party/icu/workspace.bzl b/third_party/icu/workspace.bzl new file mode 100644 index 0000000000..bfebf4219b --- /dev/null +++ b/third_party/icu/workspace.bzl @@ -0,0 +1,15 @@ +"""Loads a lightweight subset of the ICU library for Unicode processing.""" + +load("//third_party:repo.bzl", "third_party_http_archive") + +def repo(): + third_party_http_archive( + name = "icu", + strip_prefix = "icu-release-62-1", + sha256 = "e15ffd84606323cbad5515bf9ecdf8061cc3bf80fb883b9e6aa162e485aa9761", + urls = [ + "https://mirror.bazel.build/github.com/unicode-org/icu/archive/release-62-1.tar.gz", + "https://github.com/unicode-org/icu/archive/release-62-1.tar.gz", + ], + build_file = "//third_party/icu:BUILD.bazel", + ) -- cgit v1.2.3