Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to c-toxcore 0.2.20 #1282

Merged
merged 2 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 61 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ http_archive(
url = "https://github.com/bazelbuild/rules_scala/releases/download/v%s/rules_scala-v%s.tar.gz" % (RULES_SCALA_TAG, RULES_SCALA_TAG),
)

RULES_FUZZING_TAG = "0.5.2"

http_archive(
name = "rules_fuzzing",
integrity = "sha256-5rwhm/rJ4fg7Mn3QkPcoqflz7pm5tdjloYSicy7whiM=",
strip_prefix = "rules_fuzzing-%s" % RULES_FUZZING_TAG,
urls = ["https://github.com/bazelbuild/rules_fuzzing/releases/download/v%s/rules_fuzzing-%s.zip" % (RULES_FUZZING_TAG, RULES_FUZZING_TAG)],
)

# Third-party
# =========================================================

Expand Down Expand Up @@ -219,6 +228,16 @@ maven_install(
# Tox
# =========================================================

local_repository(
name = "pthread",
path = "bazel/pthread",
)

local_repository(
name = "psocket",
path = "bazel/psocket",
)

JVM_TOXCORE_API_TAG = "c0f37cfd77d79d5826ea566127f60fce838858c2"

http_archive(
Expand Down Expand Up @@ -249,19 +268,46 @@ http_archive(
url = "https://github.com/TokTok/jvm-macros/archive/%s.tar.gz" % JVM_MACROS_TAG,
)

C_TOXCORE_TAG = "0.2.12"
C_TOXCORE_TAG = "0.2.20"

http_archive(
name = "c-toxcore",
build_file = "//bazel:BUILD.c-toxcore",
integrity = "sha256-qciaja6nRdU+XXjnqsuZx7R5LEQApaaccSOPRdYWT0w=",
patch_cmds = [
"echo toxcore/ > .bazelignore",
"echo toxencryptsave/ >> .bazelignore",
"echo toxav/ >> .bazelignore",
# Delete references to the "project" stuff that lives in toktok-stack.
"sed -i /project/d BUILD.bazel",

# Ignore the "other", "testing", and "auto_tests" bonus content.
"echo other >.bazelignore",
"echo testing >>.bazelignore",
"echo auto_tests >>.bazelignore",

# Delete references to the "no_undefined" cc_library that lives in toktok-stack.
"sed -i /no_undefined/d toxencryptsave/BUILD.bazel",
"sed -i /no_undefined/d toxav/BUILD.bazel",
"sed -i /no_undefined/d toxcore/BUILD.bazel",
"sed -i /no_undefined/d third_party/BUILD.bazel",

# Replace toktok-stack selects w/ more standard versions.
"sed -i 's|//tools/config:linux|@platforms//os:linux|g' toxcore/BUILD.bazel",

# Replace "//c-toxcore/" w/ "@c-toxcore//" to get internal dependencies between libraries working.
"sed -i 's|//c-toxcore/|@c-toxcore//|g' BUILD.bazel",
"sed -i 's|//c-toxcore/|@c-toxcore//|g' toxcore/BUILD.bazel",
"sed -i 's|//c-toxcore/|@c-toxcore//|g' toxav/BUILD.bazel",
"sed -i 's|//c-toxcore/|@c-toxcore//|g' toxencryptsave/BUILD.bazel",

# Fix some "//c-toxcore:" -> "@c-toxcore:" references.
"sed -i 's|//c-toxcore:|@c-toxcore//:|g' toxcore/BUILD.bazel",
"sed -i 's|//c-toxcore:|@c-toxcore//:|g' toxav/BUILD.bazel",
"sed -i 's|//c-toxcore:|@c-toxcore//:|g' toxencryptsave/BUILD.bazel",
"sed -i 's|//c-toxcore:|@c-toxcore//:|g' third_party/BUILD.bazel",

# Flatten the gendir structure to deal with c-toxcore having its own workspace.
"sed -i 's|$(GENDIR)/c-toxcore/|$(RULEDIR)/|g' BUILD.bazel",
],
sha256 = "6d21fcd8d505e03dcb302f4c94b4b4ef146a2e6b79d4e649f99ce4d9a4c0281f",
strip_prefix = "c-toxcore-%s" % C_TOXCORE_TAG,
url = "https://github.com/TokTok/c-toxcore/archive/v%s.zip" % C_TOXCORE_TAG,
url = "https://github.com/TokTok/c-toxcore/releases/download/v%s/c-toxcore-%s.tar.gz" % (C_TOXCORE_TAG, C_TOXCORE_TAG),
)

# Transitive dependencies and toolchain setup
Expand Down Expand Up @@ -312,3 +358,11 @@ scala_repositories()
scala_proto_repositories()

scala_proto_register_enable_all_options_toolchain()

load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")

rules_fuzzing_dependencies()

load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init")

rules_fuzzing_init()
Loading
Loading