Skip to content

Commit

Permalink
Update Bazel dependencies
Browse files Browse the repository at this point in the history
This also fixes a `borinssl` typo in the repository rules
  • Loading branch information
cblichmann authored and plusvic committed May 12, 2020
1 parent d01084b commit 7568acb
Showing 1 changed file with 58 additions and 57 deletions.
115 changes: 58 additions & 57 deletions bazel/yara_deps.bzl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Copyright (c) 2020. The YARA Authors. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
Expand Down Expand Up @@ -27,66 +26,68 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

"""Load dependencies needed to compile YARA as a 3rd-party consumer."""

load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository", "new_git_repository")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

def yara_deps():
"""Loads common dependencies needed to compile YARA."""
if not native.existing_rule("openssl"):
http_archive(
name = "openssl",
url = "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0h.tar.gz",
sha256 = "f56dd7d81ce8d3e395f83285bd700a1098ed5a4cb0a81ce9522e41e6db7e0389",
strip_prefix = "openssl-OpenSSL_1_1_0h",
build_file = "@com_github_virustotal_yara//:bazel/openssl.BUILD",
)
if not native.existing_rule("borinssl"):
git_repository(
name = "boringssl",
commit = "095d78b14f91cc9a910408eaae84a3bdafc54da9", # 2019-06-05
remote = "https://boringssl.googlesource.com/boringssl",
shallow_since = "1559759280 +0000",
)
if not native.existing_rule("jansson"):
http_archive(
name = "jansson",
url = "https://github.com/akheron/jansson/archive/v2.12.tar.gz",
sha256 = "76260d30e9bbd0ef392798525e8cd7fe59a6450c54ca6135672e3cd6a1642941",
strip_prefix = "jansson-2.12",
build_file = "@com_github_virustotal_yara//:bazel/jansson.BUILD",
)
if not native.existing_rule("magic"):
maybe(
http_archive,
name = "openssl",
url = "https://github.com/openssl/openssl/archive/OpenSSL_1_1_0h.tar.gz",
sha256 = "f56dd7d81ce8d3e395f83285bd700a1098ed5a4cb0a81ce9522e41e6db7e0389",
strip_prefix = "openssl-OpenSSL_1_1_0h",
build_file = "@com_github_virustotal_yara//:bazel/openssl.BUILD",
)
maybe(
git_repository,
name = "boringssl",
commit = "095d78b14f91cc9a910408eaae84a3bdafc54da9", # 2019-06-05
remote = "https://boringssl.googlesource.com/boringssl",
shallow_since = "1559759280 +0000",
)
maybe(
http_archive,
name = "jansson",
url = "https://github.com/akheron/jansson/archive/v2.12.tar.gz",
sha256 = "76260d30e9bbd0ef392798525e8cd7fe59a6450c54ca6135672e3cd6a1642941",
strip_prefix = "jansson-2.12",
build_file = "@com_github_virustotal_yara//:bazel/jansson.BUILD",
)
maybe(
# When updating this dependency to a more recent version, the version
# in the bazel/magic.BUILD must be updated acordingly.
http_archive(
name = "magic",
url = "https://github.com/file/file/archive/FILE5_38.tar.gz",
sha256 = "338ebe8cb536a3f86750b4df62be2d382f6da66afdb0087b36a1a3e14ea4baf8",
strip_prefix = "file-FILE5_38",
build_file = "@com_github_virustotal_yara//:bazel/magic.BUILD",
)
if not native.existing_rule("com_google_sandboxed_api"):
git_repository(
name = "com_google_sandboxed_api",
commit = "2301e05097818734f59b881d7fbe1624c17fc840", # 2019-07-08
remote = "https://github.com/google/sandboxed-api.git",
shallow_since = "1562590596 -0700",
)
if not native.existing_rule("rules_proto"):
http_archive(
name = "rules_proto",
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
)
if not native.existing_rule("com_google_googletest"):
http_archive,
name = "magic",
url = "https://github.com/file/file/archive/FILE5_38.tar.gz",
sha256 = "338ebe8cb536a3f86750b4df62be2d382f6da66afdb0087b36a1a3e14ea4baf8",
strip_prefix = "file-FILE5_38",
build_file = "@com_github_virustotal_yara//:bazel/magic.BUILD",
)
maybe(
git_repository,
name = "com_google_sandboxed_api",
commit = "aafc597630ecf22e32ae71fdd45cab8c43584e65", # 2020-04-30
remote = "https://github.com/google/sandboxed-api.git",
shallow_since = "1588247853 -0700",
)
maybe(
http_archive,
name = "rules_proto",
sha256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208",
strip_prefix = "rules_proto-97d8af4dc474595af3900dd85cb3a29ad28cc313",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
"https://github.com/bazelbuild/rules_proto/archive/97d8af4dc474595af3900dd85cb3a29ad28cc313.tar.gz",
],
)
maybe(
# GoogleTest/GoogleMock for testing the sandbox
http_archive(
name = "com_google_googletest",
sha256 = "baed63b97595c32667694de0a434f8f23da59609c4a44f3360ba94b0abd5c583",
strip_prefix = "googletest-8ffb7e5c88b20a297a2e786c480556467496463b",
urls = ["https://github.com/google/googletest/archive/8ffb7e5c88b20a297a2e786c480556467496463b.zip"], # 2019-05-30
)
http_archive,
name = "com_google_googletest",
sha256 = "ba5b04a4849246e7c16ba94227eed46486ef942f61dc8b78609732543c19c9f4", # 2019-11-21
strip_prefix = "googletest-200ff599496e20f4e39566feeaf2f6734ca7570f",
urls = ["https://github.com/google/googletest/archive/200ff599496e20f4e39566feeaf2f6734ca7570f.zip"],
)

0 comments on commit 7568acb

Please sign in to comment.