1    maybe(
2        http_archive,
3        name = "{{ crate_repository(name = crate.name, version = crate.version) }}",
4    {%- if attrs | get(key="patch_args", default=Null) %}
5        patch_args = [
6    {%- for arg in attrs.patch_args %}
7            "{{ arg }}",
8    {%- endfor %}
9        ],
10    {%- endif %}
11    {%- if attrs | get(key="patch_tool", default=Null) %}
12        patch_tool = "{{ attrs.patch_tool }}",
13    {%- endif %}
14    {%- if attrs | get(key="patches", default=Null) %}
15        patches = [
16    {%- for patch in attrs.patches %}
17            "{{ patch }}",
18    {%- endfor %}
19        ],
20    {%- endif %}
21    {%- if attrs | get(key="sha256", default=Null) %}
22        sha256 = "{{ attrs.sha256 }}",
23    {%- endif %}
24        type = "tar.gz",
25        urls = ["{{ attrs.url }}"],
26        strip_prefix = "{{ crate.name }}-{{ crate.version }}",
27        build_file = Label("{{ crate_build_file(name = crate.name, version = crate.version)}}"),
28    )
29