Obsolete
/
packaging
Archived
3
0
Fork 0

Untested cmake build backend.

master
Luka Vandervelden 2019-08-29 01:18:32 +02:00
parent cfa33308e7
commit 60f5e55489
1 changed files with 24 additions and 0 deletions

View File

@ -109,6 +109,8 @@ class Package::Context
@selected_packaging_backend = @packaging_backends[0] @selected_packaging_backend = @packaging_backends[0]
@building_backends << Backend::Building.new "configure", "autotools" do |context, recipe| @building_backends << Backend::Building.new "configure", "autotools" do |context, recipe|
next BuildStatus::Pass unless Dir.exists? recipe.dirname
Dir.cd recipe.dirname Dir.cd recipe.dirname
unless File.exists? "configure" unless File.exists? "configure"
@ -124,7 +126,28 @@ class Package::Context
end end
end end
@building_backends << Backend::Building.new "configure", "cmake" do |context, recipe|
next BuildStatus::Pass unless Dir.exists? recipe.dirname
Dir.cd recipe.dirname
next BuildStatus::Pass unless File.exists? "CMakeLists.txt"
options = [
"-DCMAKE_INSTALL_PREFIX='#{recipe.prefix}'",
"-DCMAKE_BUILD_TYPE=Release #{recipe.options["cmake"]}"
]
child = context.sh "cmake . #{options.join " "}"
if child.exit_status == 0
BuildStatus::Success
else
BuildStatus::Failed
end
end
@building_backends << Backend::Building.new "build", "make" do |context, recipe| @building_backends << Backend::Building.new "build", "make" do |context, recipe|
next BuildStatus::Pass unless Dir.exists? recipe.dirname
Dir.cd recipe.dirname Dir.cd recipe.dirname
unless File.exists? "Makefile" unless File.exists? "Makefile"
@ -141,6 +164,7 @@ class Package::Context
end end
@building_backends << Backend::Building.new "install", "make" do |context, recipe| @building_backends << Backend::Building.new "install", "make" do |context, recipe|
next BuildStatus::Pass unless Dir.exists? recipe.dirname
Dir.cd recipe.dirname Dir.cd recipe.dirname
unless File.exists? "Makefile" unless File.exists? "Makefile"