module(name = "sparkle_workspace")

# Minimal dependencies for building SparklePlugin
# This workspace is isolated from the main workspace to avoid
# rules_swift version conflicts between grpc and rules_apple

bazel_dep(name = "apple_support", version = "1.21.1", repo_name = "build_bazel_apple_support")
bazel_dep(name = "rules_apple", version = "4.3.3", repo_name = "build_bazel_rules_apple")

# Register Apple CC toolchain for Objective-C compilation
apple_cc_configure = use_extension(
    "@build_bazel_apple_support//crosstool:setup.bzl",
    "apple_cc_configure_extension",
)
use_repo(apple_cc_configure, "local_config_apple_cc")

# Sparkle framework for macOS auto-updates
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

SPARKLE_VERSION = "2.6.4"

http_archive(
    name = "sparkle",
    build_file = "//:external/BUILD.sparkle",
    sha256 = "50612a06038abc931f16011d7903b8326a362c1074dabccb718404ce8e585f0b",
    strip_prefix = "",
    url = "https://github.com/sparkle-project/Sparkle/releases/download/%s/Sparkle-%s.tar.xz" % (SPARKLE_VERSION, SPARKLE_VERSION),
)
