• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1workspace(name = "org_tensorflow_lite_support")
2
3load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
4load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
5load("@//third_party/py:python_configure.bzl", "python_configure")
6
7http_archive(
8    name = "io_bazel_rules_closure",
9    sha256 = "5b00383d08dd71f28503736db0500b6fb4dda47489ff5fc6bed42557c07c6ba9",
10    strip_prefix = "rules_closure-308b05b2419edb5c8ee0471b67a40403df940149",
11    urls = [
12        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz",
13        "https://github.com/bazelbuild/rules_closure/archive/308b05b2419edb5c8ee0471b67a40403df940149.tar.gz",  # 2019-06-13
14    ],
15)
16
17# Apple and Swift rules.
18# https://github.com/bazelbuild/rules_apple/releases
19http_archive(
20    name = "build_bazel_rules_apple",
21    sha256 = "ee9e6073aeb5a65c100cb9c44b0017c937706a4ae03176e14a7e78620a198079",
22    strip_prefix = "rules_apple-5131f3d46794bf227d296c82f30c2499c9de3c5b",
23    urls = [
24        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_apple/archive/5131f3d46794bf227d296c82f30c2499c9de3c5b.tar.gz",
25        "https://github.com/bazelbuild/rules_apple/archive/5131f3d46794bf227d296c82f30c2499c9de3c5b.tar.gz",
26    ],
27)
28
29# https://github.com/bazelbuild/rules_swift/releases
30http_archive(
31    name = "build_bazel_rules_swift",
32    sha256 = "d0833bc6dad817a367936a5f902a0c11318160b5e80a20ece35fb85a5675c886",
33    strip_prefix = "rules_swift-3eeeb53cebda55b349d64c9fc144e18c5f7c0eb8",
34    urls = [
35        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/bazelbuild/rules_swift/archive/3eeeb53cebda55b349d64c9fc144e18c5f7c0eb8.tar.gz",
36        "https://github.com/bazelbuild/rules_swift/archive/3eeeb53cebda55b349d64c9fc144e18c5f7c0eb8.tar.gz",
37    ],
38)
39
40# tf-nightly-20200810
41http_archive(
42    name = "org_tensorflow",
43    sha256 = "26c833b7e1873936379e810a39d14700281125257ddda8cd822c89111db6f6ae",
44    strip_prefix = "tensorflow-2.4.0",
45    urls = [
46        "https://github.com/tensorflow/tensorflow/archive/v2.4.0.tar.gz",
47    ],
48    patches = ["@//third_party:tensorflow_lite_ios_build.patch"],
49    patch_args = ["-p1"],
50)
51
52# Set up dependencies. Need to do this before set up TF so that our modification
53# could take effects.
54load("//third_party:repo.bzl", "third_party_http_archive")
55
56# Use our patched gflags which fixes a linking issue.
57load("//third_party/gflags:workspace.bzl", gflags = "repo")
58gflags()
59
60third_party_http_archive(
61    name = "pybind11",
62    urls = [
63        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/pybind/pybind11/archive/v2.6.0.tar.gz",
64        "https://github.com/pybind/pybind11/archive/v2.6.0.tar.gz",
65    ],
66    sha256 = "90b705137b69ee3b5fc655eaca66d0dc9862ea1759226f7ccd3098425ae69571",
67    strip_prefix = "pybind11-2.6.0",
68    build_file = "//third_party:pybind11.BUILD",
69)
70
71http_archive(
72    name = "absl_py",
73    sha256 = "603febc9b95a8f2979a7bdb77d2f5e4d9b30d4e0d59579f88eba67d4e4cc5462",
74    strip_prefix = "abseil-py-pypi-v0.9.0",
75    urls = [
76        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/abseil/abseil-py/archive/pypi-v0.9.0.tar.gz",
77        "https://github.com/abseil/abseil-py/archive/pypi-v0.9.0.tar.gz",
78    ],
79)
80
81http_archive(
82    name = "six_archive",
83    build_file = "//third_party:six.BUILD",
84    sha256 = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73",
85    strip_prefix = "six-1.12.0",
86    urls = [
87        "https://storage.googleapis.com/mirror.tensorflow.org/pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz",
88        "https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz",
89    ],
90)
91
92http_archive(
93    name = "com_google_sentencepiece",
94    strip_prefix = "sentencepiece-1.0.0",
95    sha256 = "c05901f30a1d0ed64cbcf40eba08e48894e1b0e985777217b7c9036cac631346",
96    urls = [
97        "https://github.com/google/sentencepiece/archive/1.0.0.zip",
98    ],
99)
100
101http_archive(
102    name = "org_tensorflow_text",
103    sha256 = "f64647276f7288d1b1fe4c89581d51404d0ce4ae97f2bcc4c19bd667549adca8",
104    strip_prefix = "text-2.2.0",
105    urls = [
106        "https://github.com/tensorflow/text/archive/v2.2.0.zip",
107    ],
108    patches = ["@//third_party:tensorflow_text_remove_tf_deps.patch"],
109    patch_args = ["-p1"],
110    repo_mapping = {"@com_google_re2": "@com_googlesource_code_re2"},
111)
112
113http_archive(
114    name = "com_googlesource_code_re2",
115    sha256 = "d070e2ffc5476c496a6a872a6f246bfddce8e7797d6ba605a7c8d72866743bf9",
116    strip_prefix = "re2-506cfa4bffd060c06ec338ce50ea3468daa6c814",
117    urls = [
118        "https://github.com/google/re2/archive/506cfa4bffd060c06ec338ce50ea3468daa6c814.tar.gz",
119    ],
120)
121
122# ABSL cpp library lts_2020_02_25
123# Needed for absl/status
124http_archive(
125    name = "com_google_absl",
126    build_file = "//third_party:com_google_absl.BUILD",
127    urls = [
128        "https://github.com/abseil/abseil-cpp/archive/20200225.tar.gz",
129    ],
130    # Remove after https://github.com/abseil/abseil-cpp/issues/326 is solved.
131    patches = [
132        "@//third_party:com_google_absl_f863b622fe13612433fdf43f76547d5edda0c93001.diff"
133    ],
134    patch_args = [
135        "-p1",
136    ],
137    strip_prefix = "abseil-cpp-20200225",
138    sha256 = "728a813291bdec2aa46eab8356ace9f75ac2ed9dfe2df5ab603c4e6c09f1c353"
139)
140
141http_archive(
142    name = "com_google_glog",
143    sha256 = "1ee310e5d0a19b9d584a855000434bb724aa744745d5b8ab1855c85bff8a8e21",
144    strip_prefix = "glog-028d37889a1e80e8a07da1b8945ac706259e5fd8",
145    urls = [
146        "https://mirror.bazel.build/github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz",
147        "https://github.com/google/glog/archive/028d37889a1e80e8a07da1b8945ac706259e5fd8.tar.gz",
148    ],
149)
150
151
152http_archive(
153    name = "zlib",
154    build_file = "//third_party:zlib.BUILD",
155    sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
156    strip_prefix = "zlib-1.2.11",
157    urls = [
158        "http://mirror.bazel.build/zlib.net/fossils/zlib-1.2.11.tar.gz",
159        "http://zlib.net/fossils/zlib-1.2.11.tar.gz",  # 2017-01-15
160    ],
161)
162
163http_archive(
164    name = "org_libzip",
165    build_file = "//third_party:libzip.BUILD",
166    sha256 = "a5d22f0c87a2625450eaa5e10db18b8ee4ef17042102d04c62e311993a2ba363",
167    strip_prefix = "libzip-rel-1-5-1",
168    urls = [
169        # Bazel does not like the official download link at libzip.org,
170        # so use the GitHub release tag.
171        "https://mirror.bazel.build/github.com/nih-at/libzip/archive/rel-1-5-1.zip",
172        "https://github.com/nih-at/libzip/archive/rel-1-5-1.zip",
173    ],
174)
175
176http_archive(
177    name = "libyuv",
178    urls = ["https://chromium.googlesource.com/libyuv/libyuv/+archive/6d603ec3f57dafddc424ef895e5d903915e94ba6.tar.gz"],
179    # Adding the constrain of sha256 and strip_prefix will cause failure.
180    # It seems that the downloaded libyuv was different every time, so that
181    # the specified sha256 and strip_prefix cannot match.
182    # sha256 = "ce196c72858456baa8022fa4a0dc18b77d619265dbc0e3d58e25ad15ca402522",
183    # strip_prefix = "libyuv-6d603ec3f57dafddc424ef895e5d903915e94ba6",
184    build_file = "//third_party:libyuv.BUILD",
185)
186
187http_archive(
188    name = "stblib",
189    strip_prefix = "stb-b42009b3b9d4ca35bc703f5310eedc74f584be58",
190    sha256 = "13a99ad430e930907f5611325ec384168a958bf7610e63e60e2fd8e7b7379610",
191    urls = ["https://github.com/nothings/stb/archive/b42009b3b9d4ca35bc703f5310eedc74f584be58.tar.gz"],
192    build_file = "//third_party:stblib.BUILD",
193)
194
195http_archive(
196    name = "google_toolbox_for_mac",
197    url = "https://github.com/google/google-toolbox-for-mac/archive/v2.2.1.zip",
198    sha256 = "e3ac053813c989a88703556df4dc4466e424e30d32108433ed6beaec76ba4fdc",
199    strip_prefix = "google-toolbox-for-mac-2.2.1",
200    build_file = "@//third_party:google_toolbox_for_mac.BUILD",
201)
202
203http_archive(
204    name = "utf_archive",
205    build_file = "@//third_party:utf.BUILD",
206    sha256 = "262a902f622dcd28e05b8a4be10da0aa3899050d0be8f4a71780eed6b2ea65ca",
207    urls = [
208        "https://mirror.bazel.build/9fans.github.io/plan9port/unix/libutf.tgz",
209        "https://9fans.github.io/plan9port/unix/libutf.tgz",
210    ],
211)
212
213http_archive(
214    name = "icu",
215    strip_prefix = "icu-release-64-2",
216    sha256 = "dfc62618aa4bd3ca14a3df548cd65fe393155edd213e49c39f3a30ccd618fc27",
217    urls = [
218        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/unicode-org/icu/archive/release-64-2.zip",
219        "https://github.com/unicode-org/icu/archive/release-64-2.zip",
220    ],
221    build_file = "@//third_party:icu.BUILD",
222)
223
224http_archive(
225    name = "fft2d",
226    build_file = "@//third_party/fft2d:fft2d.BUILD",
227    sha256 = "5f4dabc2ae21e1f537425d58a49cdca1c49ea11db0d6271e2a4b27e9697548eb",
228    strip_prefix = "OouraFFT-1.0",
229    urls = [
230        "https://storage.googleapis.com/mirror.tensorflow.org/github.com/petewarden/OouraFFT/archive/v1.0.tar.gz",
231        "https://github.com/petewarden/OouraFFT/archive/v1.0.tar.gz",
232    ],
233)
234
235http_archive(
236    name = "darts_clone",
237    build_file = "@//third_party:darts_clone.BUILD",
238    sha256 = "c97f55d05c98da6fcaf7f9ecc6a6dc6bc5b18b8564465f77abff8879d446491c",
239    strip_prefix = "darts-clone-e40ce4627526985a7767444b6ed6893ab6ff8983",
240    urls = [
241        "https://github.com/s-yata/darts-clone/archive/e40ce4627526985a7767444b6ed6893ab6ff8983.zip",
242    ],
243)
244
245http_archive(
246    name = "com_google_protobuf",
247    sha256 = "a79d19dcdf9139fa4b81206e318e33d245c4c9da1ffed21c87288ed4380426f9",
248    strip_prefix = "protobuf-3.11.4",
249    urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.11.4.tar.gz"],
250    patches = [
251        "@//third_party:com_google_protobuf_fixes.diff"
252    ],
253    patch_args = [
254        "-p1",
255    ],
256)
257
258# AutoValue 1.6+ shades Guava, Auto Common, and JavaPoet. That's OK
259# because none of these jars become runtime dependencies.
260java_import_external(
261    name = "com_google_auto_value",
262    jar_sha256 = "fd811b92bb59ae8a4cf7eb9dedd208300f4ea2b6275d726e4df52d8334aaae9d",
263    jar_urls = [
264        "https://mirror.bazel.build/repo1.maven.org/maven2/com/google/auto/value/auto-value/1.6/auto-value-1.6.jar",
265        "https://repo1.maven.org/maven2/com/google/auto/value/auto-value/1.6/auto-value-1.6.jar",
266    ],
267    licenses = ["notice"],  # Apache 2.0
268    generated_rule_name = "processor",
269    exports = ["@com_google_auto_value_annotations"],
270    extra_build_file_content = "\n".join([
271        "java_plugin(",
272        "    name = \"AutoAnnotationProcessor\",",
273        "    output_licenses = [\"unencumbered\"],",
274        "    processor_class = \"com.google.auto.value.processor.AutoAnnotationProcessor\",",
275        "    tags = [\"annotation=com.google.auto.value.AutoAnnotation;genclass=${package}.AutoAnnotation_${outerclasses}${classname}_${methodname}\"],",
276        "    deps = [\":processor\"],",
277        ")",
278        "",
279        "java_plugin(",
280        "    name = \"AutoOneOfProcessor\",",
281        "    output_licenses = [\"unencumbered\"],",
282        "    processor_class = \"com.google.auto.value.processor.AutoOneOfProcessor\",",
283        "    tags = [\"annotation=com.google.auto.value.AutoValue;genclass=${package}.AutoOneOf_${outerclasses}${classname}\"],",
284        "    deps = [\":processor\"],",
285        ")",
286        "",
287        "java_plugin(",
288        "    name = \"AutoValueProcessor\",",
289        "    output_licenses = [\"unencumbered\"],",
290        "    processor_class = \"com.google.auto.value.processor.AutoValueProcessor\",",
291        "    tags = [\"annotation=com.google.auto.value.AutoValue;genclass=${package}.AutoValue_${outerclasses}${classname}\"],",
292        "    deps = [\":processor\"],",
293        ")",
294        "",
295        "java_library(",
296        "    name = \"com_google_auto_value\",",
297        "    exported_plugins = [",
298        "        \":AutoAnnotationProcessor\",",
299        "        \":AutoOneOfProcessor\",",
300        "        \":AutoValueProcessor\",",
301        "    ],",
302        "    exports = [\"@com_google_auto_value_annotations\"],",
303        ")",
304    ]),
305)
306
307# Auto value annotations
308java_import_external(
309    name = "com_google_auto_value_annotations",
310    jar_sha256 = "d095936c432f2afc671beaab67433e7cef50bba4a861b77b9c46561b801fae69",
311    jar_urls = [
312        "https://mirror.bazel.build/repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.6/auto-value-annotations-1.6.jar",
313        "https://repo1.maven.org/maven2/com/google/auto/value/auto-value-annotations/1.6/auto-value-annotations-1.6.jar",
314    ],
315    licenses = ["notice"],  # Apache 2.0
316    neverlink = True,
317    default_visibility = ["@com_google_auto_value//:__pkg__"],
318)
319
320load("//third_party/flatbuffers:workspace.bzl", flatbuffers = "repo")
321
322flatbuffers()
323# Set up TF.
324load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace")
325tf_workspace(tf_repo_name="@org_tensorflow")
326
327load("//third_party/tensorflow:tf_configure.bzl", "tf_configure")
328tf_configure(name = "local_config_tf")
329
330# TF submodule compilation doesn't take care of grpc deps. Do it manually here.
331load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
332grpc_deps()
333
334load(
335    "@build_bazel_rules_apple//apple:repositories.bzl",
336    "apple_rules_dependencies",
337)
338apple_rules_dependencies()
339
340load(
341    "@build_bazel_apple_support//lib:repositories.bzl",
342    "apple_support_dependencies",
343)
344apple_support_dependencies()
345
346load("@upb//bazel:repository_defs.bzl", "bazel_version_repository")
347bazel_version_repository(name = "bazel_version")
348
349
350# Set up Android.
351load("//third_party/android:android_configure.bzl", "android_configure")
352android_configure(name="local_config_android")
353load("@local_config_android//:android.bzl", "android_workspace")
354android_workspace()
355
356python_configure(name = "local_config_python")
357
358
359# Maven dependencies.
360
361RULES_JVM_EXTERNAL_TAG = "3.2"
362
363http_archive(
364    name = "rules_jvm_external",
365    strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
366    sha256 = "82262ff4223c5fda6fb7ff8bd63db8131b51b413d26eb49e3131037e79e324af",
367    url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
368)
369
370load("@rules_jvm_external//:defs.bzl", "maven_install")
371
372maven_install(
373    artifacts = [
374        "androidx.annotation:annotation:aar:1.1.0",
375    ],
376    repositories = [
377        "https://jcenter.bintray.com",
378        "https://maven.google.com",
379        "https://dl.google.com/dl/android/maven2",
380        "https://repo1.maven.org/maven2",
381    ],
382    fetch_sources = True,
383    version_conflict_policy = "pinned",
384)
385