Archived
3
0

Recipe#options

This commit is contained in:
Luka Vandervelden 2019-07-23 16:41:34 +02:00
parent a066d39918
commit d80e1f12b3
2 changed files with 8 additions and 3 deletions

View File

@ -90,7 +90,7 @@ class Package::Context
next BuildStatus::Pass
end
child = context.run "./configure", ["--prefix=/usr"]
child = context.sh "./configure --prefix=/usr #{recipe.options["configure"]? || ""}"
if child.exit_status == 0
BuildStatus::Success
@ -106,7 +106,7 @@ class Package::Context
next BuildStatus::Pass
end
child = context.run "make"
child = context.sh "make #{recipe.options["make"]? || ""}"
if child.exit_status == 0
BuildStatus::Success
@ -122,7 +122,7 @@ class Package::Context
next BuildStatus::Pass
end
child = context.run "make", ["install", "DESTDIR=#{recipe.fake_root_directory}"]
child = context.sh "make install 'DESTDIR=#{recipe.fake_root_directory}' #{recipe.options["make install"]? || ""}"
if child.exit_status == 0
BuildStatus::Success
@ -166,6 +166,10 @@ class Package::Context
run nil, command, nil
end
def sh(command)
run nil, "sh", ["-x", "-e", "-c", command]
end
def package(package : Package) : Bool
@selected_packaging_backend.package self, package
end

View File

@ -43,6 +43,7 @@ class Package::Recipe
# Build instructions, helpers and other build-only data.
setter dirname : String? # matching getter defined manually later.
getter instructions = Instructions.new
getter options = Hash(String, String).new
def initialize(@context, @name, @version)
@sources = Sources.new