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.sh15
-rw-r--r--etc/repos.json34
-rw-r--r--etc/repos.template.json26
4 files changed, 108 insertions, 10 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
new file mode 100755
index 0000000..8bd1ca6
--- /dev/null
+++ b/etc/generate-repos.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+
+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 d1537db..1f68227 100644
--- a/etc/repos.json
+++ b/etc/repos.json
@@ -1,24 +1,20 @@
{ "repositories":
{ "":
{ "repository": {"type": "file", "path": "src"}
- , "bindings": {"rules": "rules/nix"}
+ , "bindings": {"rules": "rules/nix", "rust": "rules-rust/nix"}
}
, "test":
{ "repository": {"type": "file", "path": "test"}
, "bindings": {"rules": "rules/nix-test", "src": ""}
}
, "defaults": {"repository": {"type": "file", "path": "etc/defaults"}}
- , "rules":
- { "repository":
- { "type": "git"
- , "branch": "master"
- , "commit": "0d436f26134d3fcaa695e4e6e87249d7fa381e44"
- , "repository": "https://github.com/just-buildsystem/rules-cc.git"
- , "subdir": "rules"
- }
- }
, "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 +22,23 @@
, "target_file_name": "test.TARGETS"
, "bindings": {"base": "rules/nix"}
}
+ , "rules":
+ { "repository":
+ { "type": "git"
+ , "repository": "https://github.com/just-buildsystem/rules-cc"
+ , "branch": "master"
+ , "commit": "0e9d13a761c878a647fde5a543946a02bf2c693d"
+ , "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
new file mode 100644
index 0000000..929e149
--- /dev/null
+++ b/etc/repos.template.json
@@ -0,0 +1,26 @@
+{ "repositories":
+ { "":
+ { "repository": {"type": "file", "path": "src"}
+ , "bindings": {"rules": "rules/nix", "rust": "rules-rust/nix"}
+ }
+ , "test":
+ { "repository": {"type": "file", "path": "test"}
+ , "bindings": {"rules": "rules/nix-test", "src": ""}
+ }
+ , "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"
+ , "rule_root": "rules"
+ , "target_file_name": "test.TARGETS"
+ , "bindings": {"base": "rules/nix"}
+ }
+ }
+}