Skip to content

Commit

Permalink
Add minizip-ng as third-party dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
jbms committed Feb 13, 2023
1 parent c1f2ceb commit 5d8ce40
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
52 changes: 52 additions & 0 deletions third_party/minizip_ng/minizip_ng.BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package(default_visibility = ["//visibility:private"])

licenses(["notice"])

cc_library(
name = "minizip_ng",
srcs = glob(
[
"*.h",
"*.c",
],
exclude = [
"*_win32.c",
"*_posix.c",
"*_apple.c",
"mz_strm_libcomp.*",
"minizip.c",
"minigzip.c",
],
) + select({
"@platforms//os:windows": [
"mz_os_win32.c",
"mz_strm_os_win32.c",
],
"//conditions:default": [
"mz_os_posix.c",
"mz_strm_os_posix.c",
],
}),
local_defines = [
"HAVE_ZLIB",
"ZLIB_COMPAT",
"HAVE_ZSTD",
],
deps = [
"@com_google_boringssl//:crypto",
"@net_zlib//:zlib",
"@net_zstd//:zstdlib",
],
)

cc_binary(
name = "minizip",
srcs = ["minizip.c"],
deps = [":minizip_ng"],
)

cc_binary(
name = "minigzip",
srcs = ["minigzip.c"],
deps = [":minizip_ng"],
)
36 changes: 36 additions & 0 deletions third_party/minizip_ng/workspace.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Copyright 2023 The TensorStore Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load(
"//third_party:repo.bzl",
"third_party_http_archive",
)
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def repo():
maybe(
third_party_http_archive,
name = "minizip_ng",
sha256 = "27cc2f62cd02d79b71b346fc6ace02728385f8ba9c6b5f124062b0790a04629a",
strip_prefix = "minizip-ng-3.0.8",
urls = [
"https://github.com/zlib-ng/minizip-ng/archive/refs/tags/3.0.8.tar.gz",
],
build_file = Label("//third_party:minizip_ng/minizip_ng.BUILD.bazel"),
cmake_name = "MINIZIP",
bazel_to_cmake = {},
cmake_target_mapping = {
"@minizip_ng//:minizip_ng": "MINIZIP::minizip-ng",
},
)
2 changes: 2 additions & 0 deletions third_party/third_party.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ load("//third_party:jpeg/workspace.bzl", repo_jpeg = "repo")
load("//third_party:libtiff/workspace.bzl", repo_libtiff = "repo")
load("//third_party:libwebp/workspace.bzl", repo_libwebp = "repo")
load("//third_party:local_proto_mirror/workspace.bzl", repo_local_proto_mirror = "repo")
load("//third_party:minizip_ng/workspace.bzl", repo_minizip_ng = "repo")
load("//third_party:nasm/workspace.bzl", repo_nasm = "repo")
load("//third_party:net_sourceforge_half/workspace.bzl", repo_net_sourceforge_half = "repo")
load("//third_party:net_zlib/workspace.bzl", repo_net_zlib = "repo")
Expand Down Expand Up @@ -57,6 +58,7 @@ def third_party_dependencies():
repo_libtiff()
repo_libwebp()
repo_local_proto_mirror()
repo_minizip_ng()
repo_nasm()
repo_net_sourceforge_half()
repo_net_zlib()
Expand Down

0 comments on commit 5d8ce40

Please sign in to comment.