Archived
3
0

More metadata available to Recipe and Package.

This commit is contained in:
Luka Vandervelden 2019-07-03 04:24:33 +02:00
parent e6645e4f3d
commit 3d08c7ecff
3 changed files with 42 additions and 8 deletions

View File

@ -16,6 +16,10 @@ Context.new().tap do |context|
#recipe.instructions.build << "cd hello-#{recipe.version} && make"
recipe.instructions.install << "cd hello-#{recipe.version} && make DESTDIR='${PKG}' install"
recipe.url = "https://www.gnu.org/software/hello/"
recipe.description = "The GNU Hello program produces a familiar, friendly greeting."
recipe.dependencies << "gettext"
recipe.download
recipe.extract

View File

@ -11,10 +11,22 @@ class Package::Package
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
inherit dependencies : Array(String)
inherit conflicts : Array(String)
inherit provides : Array(String)
# Internals
inherit fake_root_directory : String

View File

@ -18,14 +18,32 @@ end
class Package::Recipe
@context : Context
# Core recipe informations.
getter name : String
getter version : String
getter dirname : String?
getter release = 1
property url : String?
property description : String = ""
# Informations not specific to individual packages.
getter sources : Sources
getter packages : Array(Package)
property packager : String?
property maintainer : String?
getter contributors = Array(String).new
# Relations to other packages.
# FIXME: `dependencies` needs splitting between run-time and build-time.
getter dependencies = Array(String).new
getter provides = Array(String).new
getter conflicts = Array(String).new
# Build instructions, helpers and other build-only data.
setter dirname : String? # matching getter defined manually later.
getter instructions = Instructions.new
def initialize(@context, @name, @version)
@sources = Sources.new
@packages = [] of Package