diff --git a/build/jam/ImageRules b/build/jam/ImageRules index 71e2680b0c..374a8bf9fa 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -856,6 +856,43 @@ rule AddGroupToHaikuImage group : gid : members AddEntryToHaikuImageUserGroupFile group : $(entry) ; } +rule AddEntryToHaikuImageExpanderRuleFile file : entry +{ + local allEntries + = [ on $(file) return $(HAIKU_IMAGE_EXPANDER_RULES_ENTRIES) ] ; + + if $(allEntries) { + allEntries = $(allEntries)!$(entry) ; + } else { + allEntries = $(entry) ; + + Always $(file) ; + MakeLocate $(file) : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ; + BuildHaikuImageExpanderRules $(file) ; + AddFilesToHaikuImage common etc : $(file) ; + } + + HAIKU_IMAGE_EXPANDER_RULES_ENTRIES on $(file) = $(allEntries) ; +} + +actions BuildHaikuImageExpanderRules +{ + echo -e "$(HAIKU_IMAGE_EXPANDER_RULES_ENTRIES)" | tr '!' '\n' > $(1) +} + +rule AddExpanderRuleToHaikuImage mimetype : extension : list : extract +{ + #AddExpanderRuleToHaikuImage : : : + + if ! $(mimetype) || ! $(extension) || ! $(list) || ! $(extract) { + Exit "Invalid expander rule specification passed to AddExpanderRule." ; + } + + local entry = "\\\"$(mimetype)\\\"\\\t$(extension)\\\t\\\"$(list)\\\"\\\t\\\"$(extract)\\\"" ; + AddEntryToHaikuImageExpanderRuleFile expander.rules + : $(entry) ; +} + rule AddOptionalPackageDescriptionToHaikuImage file : searchPath { if $(searchPath) { diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages index 7bf2d18dc7..6c218a1a0a 100644 --- a/build/jam/OptionalPackages +++ b/build/jam/OptionalPackages @@ -823,16 +823,11 @@ if [ IsOptionalHaikuImagePackageAdded P7zip ] { : ; } + AddExpanderRuleToHaikuImage "application/x-7z-compressed" : .7z + : "7za l \\0045s" + : "7za x -y \\0045s" + ; - actions BuildHaikuImageExpanderRules - { - echo -e "\"application/x-7z-compressed\"\t.7z\t\"7za l \0045s\"\t\"7za x -y \0045s\"" > $(1) - } - - Always expander.rules ; - MakeLocate expander.rules : $(HAIKU_COMMON_PLATFORM_OBJECT_DIR) ; - BuildHaikuImageExpanderRules expander.rules ; - AddFilesToHaikuImage home config etc : expander.rules ; } }