yesod-homebrew-tools/BUILD.bazel
Copybara 479f03cb62 Project import generated by Copybara.
GitOrigin-RevId: 972a0827462b131c99dd8103b01bdae0d6d22565
2026-01-20 00:54:02 +00:00

26 lines
822 B
Text

genrule(
name = "generate_tts_client_rb",
srcs = [
"tts-client.rb.tpl",
"//experimental/users/acmcarther/llm/tts_grpc:tts_client_go",
],
outs = ["tts-client.rb"],
cmd = """
# Identify the binary. It's the file that doesn't end in .tpl
for f in $(locations //experimental/users/acmcarther/llm/tts_grpc:tts_client_go); do
BINARY=$$f
break
done
# Calculate SHA256
if command -v sha256sum >/dev/null 2>&1; then
HASH=$$(sha256sum $$BINARY | cut -d' ' -f1)
else
HASH=$$(shasum -a 256 $$BINARY | cut -d' ' -f1)
fi
# Substitute into template
sed "s/{SHA256}/$$HASH/g" $(location tts-client.rb.tpl) > $@
""",
visibility = ["//visibility:public"],
)