summaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
Diffstat (limited to 'etc')
-rw-r--r--etc/defaults/rust/TARGETS43
-rwxr-xr-xetc/generate-repos.sh4
-rw-r--r--etc/repos.json16
-rw-r--r--etc/repos.template.json7
4 files changed, 68 insertions, 2 deletions
diff --git a/etc/defaults/rust/TARGETS b/etc/defaults/rust/TARGETS
new file mode 100644
index 0000000..fbd1a69
--- /dev/null
+++ b/etc/defaults/rust/TARGETS
@@ -0,0 +1,43 @@
+{ "defaults":
+ { "type": "configure"
+ , "target": "defaults (unconfigured)"
+ , "arguments_config": ["TOOLCHAIN_CONFIG"]
+ , "config":
+ { "type": "let*"
+ , "bindings":
+ [ [ "toolchain"
+ , { "type": "lookup"
+ , "map":
+ { "type": "var"
+ , "name": "TOOLCHAIN_CONFIG"
+ , "default": {"type": "empty_map"}
+ }
+ , "key": "RUST"
+ , "default": {"type": "empty_map"}
+ }
+ ]
+ , [ "RUSTC"
+ , { "type": "lookup"
+ , "map": {"type": "var", "name": "toolchain"}
+ , "key": "RUSTC"
+ , "default": "rustc"
+ }
+ ]
+ , [ "PATH"
+ , { "type": "lookup"
+ , "map": {"type": "var", "name": "toolchain"}
+ , "key": "PATH"
+ , "default": []
+ }
+ ]
+ ]
+ , "body": {"type": "env", "vars": ["RUSTC", "PATH"]}
+ }
+ }
+, "defaults (unconfigured)":
+ { "type": "defaults"
+ , "arguments_config": ["RUSTC", "PATH"]
+ , "RUSTC": [{"type": "var", "name": "RUSTC"}]
+ , "PATH": {"type": "var", "name": "PATH"}
+ }
+}
diff --git a/etc/generate-repos.sh b/etc/generate-repos.sh
index f7b4cf8..8bd1ca6 100755
--- a/etc/generate-repos.sh
+++ b/etc/generate-repos.sh
@@ -5,7 +5,11 @@ readonly ROOT=$(readlink -f $(dirname $0)/..)
: ${RULES_CC_REPO:=https://github.com/just-buildsystem/rules-cc}
: ${RULES_CC_BRANCH:=master}
+: ${RULES_RUST_REPO:=https://github.com/just-buildsystem/rules-rust}
+: ${RULES_RUST_BRANCH:=master}
just-import-git -C ${ROOT}/etc/repos.template.json \
--as rules -b ${RULES_CC_BRANCH} ${RULES_CC_REPO} rules \
+ | just-import-git -C - \
+ --as rules-rust -b ${RULES_RUST_BRANCH} ${RULES_RUST_REPO} rules-rust \
| hdump > ${ROOT}/etc/repos.json
diff --git a/etc/repos.json b/etc/repos.json
index 5ab3477..1f68227 100644
--- a/etc/repos.json
+++ b/etc/repos.json
@@ -1,7 +1,7 @@
{ "repositories":
{ "":
{ "repository": {"type": "file", "path": "src"}
- , "bindings": {"rules": "rules/nix"}
+ , "bindings": {"rules": "rules/nix", "rust": "rules-rust/nix"}
}
, "test":
{ "repository": {"type": "file", "path": "test"}
@@ -10,6 +10,11 @@
, "defaults": {"repository": {"type": "file", "path": "etc/defaults"}}
, "rules/nix":
{"repository": "rules", "target_root": "defaults", "rule_root": "rules"}
+ , "rules-rust/nix":
+ { "repository": "rules-rust"
+ , "target_root": "defaults"
+ , "rule_root": "rules-rust"
+ }
, "rules/nix-test":
{ "repository": "rules"
, "target_root": "defaults"
@@ -26,5 +31,14 @@
, "subdir": "rules"
}
}
+ , "rules-rust":
+ { "repository":
+ { "type": "git"
+ , "repository": "https://github.com/just-buildsystem/rules-rust"
+ , "branch": "master"
+ , "commit": "bf3e05a614f1de5a9a8a0f8e40f1dd9e1f6609da"
+ , "subdir": "rules"
+ }
+ }
}
}
diff --git a/etc/repos.template.json b/etc/repos.template.json
index bb4d04c..929e149 100644
--- a/etc/repos.template.json
+++ b/etc/repos.template.json
@@ -1,7 +1,7 @@
{ "repositories":
{ "":
{ "repository": {"type": "file", "path": "src"}
- , "bindings": {"rules": "rules/nix"}
+ , "bindings": {"rules": "rules/nix", "rust": "rules-rust/nix"}
}
, "test":
{ "repository": {"type": "file", "path": "test"}
@@ -10,6 +10,11 @@
, "defaults": {"repository": {"type": "file", "path": "etc/defaults"}}
, "rules/nix":
{"repository": "rules", "target_root": "defaults", "rule_root": "rules"}
+ , "rules-rust/nix":
+ { "repository": "rules-rust"
+ , "target_root": "defaults"
+ , "rule_root": "rules-rust"
+ }
, "rules/nix-test":
{ "repository": "rules"
, "target_root": "defaults"