Skip to content

Commit

Permalink
Update protobuf version to 3.7.0 (#341)
Browse files Browse the repository at this point in the history
  • Loading branch information
davido authored and dslomov committed Mar 20, 2019
1 parent a176ec8 commit 316e613
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions BUILD
@@ -0,0 +1 @@
# Empty Bazel build file
21 changes: 21 additions & 0 deletions WORKSPACE
@@ -1,10 +1,26 @@
workspace(name = "io_bazel_rules_closure")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("//closure/private:java_import_external.bzl", "java_import_external")
load("//closure:repositories.bzl", "closure_repositories")

closure_repositories()

http_archive(
name = "net_zlib",
build_file = "//:third_party/zlib.BUILD",
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1",
strip_prefix = "zlib-1.2.11",
urls = ["https://zlib.net/zlib-1.2.11.tar.gz"],
)

http_archive(
name = "bazel_skylib",
sha256 = "bbccf674aa441c266df9894182d80de104cabd19be98be002f6d478aaa31574d",
strip_prefix = "bazel-skylib-2169ae1c374aab4a09aa90e65efe1a3aad4e279b",
urls = ["https://github.com/bazelbuild/bazel-skylib/archive/2169ae1c374aab4a09aa90e65efe1a3aad4e279b.tar.gz"],
)

java_import_external(
name = "com_google_guava_testlib",
jar_sha256 = "1e7e0e728bb8d68a985115d2439ad6a36473c3e49d78a70945919731f9ac7136",
Expand Down Expand Up @@ -82,3 +98,8 @@ java_import_external(
testonly_ = 1,
deps = ["@com_google_guava"],
)

bind(
name = "zlib",
actual = "@net_zlib//:zlib",
)
60 changes: 60 additions & 0 deletions third_party/zlib.BUILD
@@ -0,0 +1,60 @@
package(default_visibility = ["//visibility:public"])

licenses(["notice"]) # BSD/MIT-like license (for zlib)

_ZLIB_HEADERS = [
"crc32.h",
"deflate.h",
"gzguts.h",
"inffast.h",
"inffixed.h",
"inflate.h",
"inftrees.h",
"trees.h",
"zconf.h",
"zlib.h",
"zutil.h",
]

_ZLIB_PREFIXED_HEADERS = ["zlib/include/" + hdr for hdr in _ZLIB_HEADERS]

# In order to limit the damage from the `includes` propagation
# via `:zlib`, copy the public headers to a subdirectory and
# expose those.
genrule(
name = "copy_public_headers",
srcs = _ZLIB_HEADERS,
outs = _ZLIB_PREFIXED_HEADERS,
cmd = "cp $(SRCS) $(@D)/zlib/include/",
visibility = ["//visibility:private"],
)

cc_library(
name = "zlib",
srcs = [
"adler32.c",
"compress.c",
"crc32.c",
"deflate.c",
"gzclose.c",
"gzlib.c",
"gzread.c",
"gzwrite.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"uncompr.c",
"zutil.c",
# Include the un-prefixed headers in srcs to work
# around the fact that zlib isn't consistent in its
# choice of <> or "" delimiter when including itself.
] + _ZLIB_HEADERS,
hdrs = _ZLIB_PREFIXED_HEADERS,
copts = [
"-Wno-unused-variable",
"-Wno-implicit-function-declaration",
],
includes = ["zlib/include/"],
)

0 comments on commit 316e613

Please sign in to comment.