2011-04-15 17:19:26 -04:00
|
|
|
require "fileutils"
|
|
|
|
|
|
|
|
module CapybaraWebkitBuilder
|
|
|
|
extend self
|
|
|
|
|
|
|
|
def makefile
|
2011-05-09 16:12:52 -04:00
|
|
|
qmake_binaries = ['qmake', 'qmake-qt4']
|
|
|
|
qmake = qmake_binaries.detect { |qmake| system("which #{qmake}") }
|
|
|
|
system("#{qmake} -spec macx-g++")
|
2011-04-15 17:19:26 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def qmake
|
|
|
|
system("make qmake")
|
|
|
|
end
|
|
|
|
|
|
|
|
def build
|
2011-05-05 17:45:44 -04:00
|
|
|
system("make") or return false
|
2011-04-15 17:19:26 -04:00
|
|
|
|
|
|
|
FileUtils.mkdir("bin") unless File.directory?("bin")
|
|
|
|
|
|
|
|
if File.exist?("src/webkit_server.app")
|
|
|
|
FileUtils.cp("src/webkit_server.app/Contents/MacOS/webkit_server", "bin", :preserve => true)
|
|
|
|
else
|
|
|
|
FileUtils.cp("src/webkit_server", "bin", :preserve => true)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def build_all
|
2011-05-05 17:45:44 -04:00
|
|
|
makefile &&
|
|
|
|
qmake &&
|
2011-04-15 17:19:26 -04:00
|
|
|
build
|
|
|
|
end
|
|
|
|
end
|