diff --git a/src/context.cr b/src/context.cr index a46a106..2ea0bc2 100644 --- a/src/context.cr +++ b/src/context.cr @@ -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 diff --git a/src/recipe.cr b/src/recipe.cr index 32abd8d..7f10363 100644 --- a/src/recipe.cr +++ b/src/recipe.cr @@ -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