From 231cfec4166ad69a5f18599734cdf121ca85aad6 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Mon, 1 Jul 2024 12:06:37 +0200 Subject: ["shell", "defaults"]: support "bin dirs" --- shell/RULES | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/shell/RULES b/shell/RULES index 73c295f..2ce078e 100644 --- a/shell/RULES +++ b/shell/RULES @@ -8,7 +8,7 @@ , "meaningful use of this rule." ] , "target_fields": ["base", "toolchain"] - , "string_fields": ["sh", "PATH"] + , "string_fields": ["sh", "PATH", "bin dirs"] , "field_doc": { "base": ["Other targets (using the same rule) to inherit values from."] , "toolchain": @@ -27,6 +27,10 @@ [ "Paths for looking up system tools." , "Specifying this field extends values from \"base\"." ] + , "bin dirs": + [ "Directories of the toolchain that contain additional binaries." + , "Shell-specific rules will add those into PATH." + ] } , "config_vars": ["ARCH", "HOST_ARCH", "TARGET_ARCH"] , "imports": @@ -132,12 +136,23 @@ } } ] + , [ "bin dirs" + , { "type": "++" + , "$1": + [ {"type": "FIELD", "name": "bin dirs"} + , { "type": "let*" + , "bindings": [["provider", "bin dirs"]] + , "body": {"type": "CALL_EXPRESSION", "name": "base-provides-++"} + } + ] + } + ] ] , "body": { "type": "RESULT" , "provides": { "type": "env" - , "vars": ["TOOLCHAIN", "sh", "NON_SYSTEM_TOOLS", "PATH"] + , "vars": ["TOOLCHAIN", "sh", "NON_SYSTEM_TOOLS", "PATH", "bin dirs"] } } } -- cgit v1.2.3