Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ ripunzip_archive = use_repo_rule("//misc/ripunzip:ripunzip.bzl", "ripunzip_archi
ripunzip_archive(
name = "ripunzip",
sha256_linux = "71482d7a7e4ea9176d5596161c49250c34b136b157c45f632b1111323fbfc0de",
sha256_linux_arm = "a282740ef376ff8dc0de3c589b7457598db15cc045b7daa688f15531612e0bbe",
sha256_macos_arm = "604194ab13f0aba3972995d995f11002b8fc285c8170401fcd46655065df20c9",
sha256_macos_intel = "65367b94fd579d93d46f2d2595cc4c9a60cfcf497e3c824f9d1a7b80fa8bd38a",
sha256_windows = "ac3874075def2b9e5074a3b5945005ab082cc6e689e1de658da8965bc23e643e",
Expand Down
17 changes: 14 additions & 3 deletions misc/ripunzip/ripunzip.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,22 @@ def _ripunzip_archive_impl(repository_ctx):
url_prefix = "https://github.com/GoogleChrome/ripunzip/releases/download/v%s" % version
build_file = Label("//misc/ripunzip:BUILD.ripunzip.bazel")
if "linux" in repository_ctx.os.name:
arch = repository_ctx.os.arch
if arch in ("aarch64", "arm64"):
deb_arch = "arm64"
sha256 = repository_ctx.attr.sha256_linux_arm
canonical_id = "ripunzip-linux-arm"
Comment thread
redsun82 marked this conversation as resolved.
Outdated
else:
deb_arch = "amd64"
sha256 = repository_ctx.attr.sha256_linux
canonical_id = "ripunzip-linux"
Comment thread
redsun82 marked this conversation as resolved.
Outdated

# ripunzip only provides a deb package for Linux: we fish the binary out of it
# a deb archive contains a data.tar.xz one which contains the files to be installed under usr/bin
repository_ctx.download_and_extract(
url = "%s/ripunzip_%s-1_amd64.deb" % (url_prefix, version),
sha256 = repository_ctx.attr.sha256_linux,
canonical_id = "ripunzip-linux",
url = "%s/ripunzip_%s-1_%s.deb" % (url_prefix, version, deb_arch),
sha256 = sha256,
canonical_id = canonical_id,
output = "deb",
)
repository_ctx.extract(
Expand Down Expand Up @@ -52,6 +62,7 @@ ripunzip_archive = repository_rule(
attrs = {
"version": attr.string(mandatory = True),
"sha256_linux": attr.string(mandatory = True),
"sha256_linux_arm": attr.string(mandatory = True),
Comment thread
redsun82 marked this conversation as resolved.
Outdated
"sha256_windows": attr.string(mandatory = True),
"sha256_macos_intel": attr.string(mandatory = True),
"sha256_macos_arm": attr.string(mandatory = True),
Expand Down
Loading