...
1""" Fetches and extracts data.tar.xz from specified debian for use in supplied bazel BUILD """
2
3def _impl(repository_ctx):
4 repository_ctx.download_and_extract(repository_ctx.attr.url, sha256 = repository_ctx.attr.sha256)
5 repository_ctx.extract("data.tar.xz")
6 repository_ctx.file("BUILD.bazel", repository_ctx.attr.build_file_content)
7
8deb_package_extract = repository_rule(
9 implementation = _impl,
10 attrs = {
11 "url": attr.string(mandatory = True),
12 "sha256": attr.string(mandatory = False),
13 "build_file_content": attr.string(mandatory = False),
14 },
15)
View as plain text