From 87727bbe914544f305905aa1c30be9f73f85c901 Mon Sep 17 00:00:00 2001
From: Jason Zaman <jason@perfinion.com>
Date: Wed, 7 Oct 2020 17:36:07 -0700
Subject: [PATCH] systemlibs: unbundle @tblib_archive dep

Signed-off-by: Jason Zaman <jason@perfinion.com>
---
 tensorflow/workspace.bzl                     |  1 +
 third_party/systemlibs/syslibs_configure.bzl |  1 +
 third_party/systemlibs/tblib.BUILD           | 12 ++++++++++++
 3 files changed, 14 insertions(+)
 create mode 100644 third_party/systemlibs/tblib.BUILD

diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index b4d442ce00d..41c4c836185 100755
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -557,6 +557,7 @@ def tf_repositories(path_prefix = "", tf_repo_name = ""):
     tf_http_archive(
         name = "tblib_archive",
         build_file = clean_dep("//third_party:tblib.BUILD"),
+        system_build_file = clean_dep("//third_party/systemlibs:tblib.BUILD"),
         urls = [
             "http://mirror.tensorflow.org/files.pythonhosted.org/packages/ec/c4/8c651f3240a73c28a218194f3d527eb2be5a173d08501060cdee84ade33f/tblib-1.3.2.tar.gz",
             "https://files.pythonhosted.org/packages/ec/c4/8c651f3240a73c28a218194f3d527eb2be5a173d08501060cdee84ade33f/tblib-1.3.2.tar.gz",
diff --git a/third_party/systemlibs/syslibs_configure.bzl b/third_party/systemlibs/syslibs_configure.bzl
index 87cd44b4596..74f15c885d9 100644
--- a/third_party/systemlibs/syslibs_configure.bzl
+++ b/third_party/systemlibs/syslibs_configure.bzl
@@ -42,6 +42,7 @@ VALID_LIBS = [
     "pybind11",
     "six_archive",
     "snappy",
+    "tblib_archive",
     "termcolor_archive",
     "wrapt",
     "zlib",
diff --git a/third_party/systemlibs/tblib.BUILD b/third_party/systemlibs/tblib.BUILD
new file mode 100644
index 00000000000..0b2ad25c746
--- /dev/null
+++ b/third_party/systemlibs/tblib.BUILD
@@ -0,0 +1,12 @@
+licenses(["notice"])  # BSD 3-clause
+
+filegroup(
+    name = "LICENSE",
+    visibility = ["//visibility:public"],
+)
+
+py_library(
+    name = "tblib",
+    srcs_version = "PY2AND3",
+    visibility = ["//visibility:public"],
+)