-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add build.rs generation back (wayland-* is absurd to compile w/o it)
- Loading branch information
1 parent
f767930
commit 1258b4d
Showing
7 changed files
with
79 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
rust_binary( | ||
name = "{{ crate_name_sanitized }}_build_script", | ||
srcs = glob(["**/*.rs"]), | ||
{% if crate.build_script_target.path %} | ||
crate_root = "{{ crate.build_script_target.path }}", | ||
{% else %} | ||
crate_root = "build.rs", | ||
{% endif %} | ||
data = glob([ | ||
"*" | ||
]), | ||
{% if crate.dependencies | length > 0 or crate.build_dependencies | length > 0 %} | ||
deps = [ | ||
{% for dependency in crate.build_dependencies %} | ||
"{{path_prefix}}/vendor/{{dependency.name}}-{{dependency.version}}:{{dependency.name | replace(from="-", to="_") }}", | ||
{% endfor %} | ||
], | ||
{% endif %} | ||
rustc_flags = [ | ||
"--cap-lints allow", | ||
"--target={{crate.platform_triple}}", | ||
], | ||
{% if crate.features | length > 0 %} | ||
crate_features = [ | ||
{% for feature in crate.features %} | ||
"{{feature}}", | ||
{% endfor %} | ||
], | ||
{% endif %} | ||
visibility = ["//visibility:private"], | ||
) | ||
|
||
genrule( | ||
name = "{{ crate_name_sanitized }}_build_script_executor", | ||
srcs = glob(["*", "**/*.rs"]), | ||
outs = ["{{ crate_name_sanitized }}_out_dir_outputs.tar.gz"], | ||
tools = [":{{ crate_name_sanitized }}_build_script"], | ||
local = 1, | ||
cmd = "mkdir {{ crate_name_sanitized}}_out_dir_outputs/;" | ||
+ " (export CARGO_MANIFEST_DIR=\"$$PWD/{{ path_prefix | replace(from="//", to="") }}/vendor/{{ crate.pkg_name }}-{{ crate.pkg_version }}\";" | ||
+ " export TARGET='{{ crate.platform_triple }}';" | ||
+ " export RUST_BACKTRACE=1;" | ||
{% for feature in crate.features %} | ||
+ " export CARGO_FEATURE_{{ feature | upper | replace(from="-", to="_") }}=1;" | ||
{% endfor %} | ||
+ " export OUT_DIR=$$PWD/{{ crate_name_sanitized }}_out_dir_outputs;" | ||
+ " export BINARY_PATH=\"$$PWD/$(location :{{ crate_name_sanitized }}_build_script)\";" | ||
+ " export OUT_TAR=$$PWD/$@;" | ||
+ " cd $$(dirname $(location :Cargo.toml)) && $$BINARY_PATH && tar -czf $$OUT_TAR -C $$OUT_DIR .)" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters