class Package::Package getter recipe : Recipe getter automatic : Bool def initialize(@recipe, @automatic = false, @fake_root_directory = nil) end macro inherit(attribute) @{{attribute.var.id}} : {{attribute.type.id}}? def {{attribute.var.id}} : {{attribute.type.id}} @{{attribute.var.id}} || @recipe.{{attribute.var.id}} end def {{attribute.var.id}}=(new_value : {{attribute.type.id}}) @{{attribute.var.id}} = new_value end end inherit name : String inherit version : String inherit release : Int32 inherit url : String? inherit description : String setter dependencies : Array(String)? inherit conflicts : Array(String) inherit provides : Array(String) # Reference for splits. Recipe#packages[0] should keep this set to `nil`. property files : Array(String)? property file_patterns : Array(Regex)? @fake_root_directory : String? def dependencies @dependencies || @recipe.run_dependencies end def fake_root_directory @fake_root_directory || "#{recipe.working_directory}/root-#{name}" end def to_s "" end end