Skip to content

Commit

Permalink
Make it compile on FreeBSD.
Browse files Browse the repository at this point in the history
  • Loading branch information
mat813 committed Jul 25, 2011
1 parent a4538b6 commit eca1376
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/capybara_webkit_builder.rb
Expand Up @@ -3,23 +3,30 @@
module CapybaraWebkitBuilder
extend self

def make_bin
make_binaries = ['gmake', 'make']
make_binaries.detect { |make| system("which #{make}") }
end

def makefile
qmake_binaries = ['qmake', 'qmake-qt4']
qmake = qmake_binaries.detect { |qmake| system("which #{qmake}") }
case RUBY_PLATFORM
when /linux/
system("#{qmake} -spec linux-g++")
when /freebsd/
system("#{qmake} -spec freebsd-g++")
else
system("#{qmake} -spec macx-g++")
end
end

def qmake
system("make qmake")
system("#{make_bin} qmake")
end

def build
system("make") or return false
system(make_bin) or return false

FileUtils.mkdir("bin") unless File.directory?("bin")
FileUtils.cp("src/webkit_server", "bin", :preserve => true)
Expand Down

0 comments on commit eca1376

Please sign in to comment.