1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-19 12:21:52 +02:00

Add liblastfm2 and make tomahawk build against it

This commit is contained in:
Jeff Mitchell
2011-03-24 19:18:42 -04:00
parent 1780781e12
commit b7a1cb8d99
114 changed files with 14711 additions and 3 deletions

View File

@@ -0,0 +1,38 @@
require "#{File.dirname __FILE__}/platform.rb"
class QMakeNotFound < RuntimeError; end
class QMakeTooOld < RuntimeError; end
def which_qmake
args = '-v'
args += ' 2> /dev/null' unless Platform::IMPL == :mswin
versions = Hash.new
['qmake','qmake-qt4'].each do |qmake|
begin
/^Using Qt version (\d\.\d\.\d)(-(.+))?/.match( `#{qmake} #{args}` )
rescue
end
versions[qmake] = $1 unless $1.nil?
end
raise QMakeNotFound if versions.empty?
versions.each do |key, v|
i = 1
j = 0
v.split( '.' ).reverse.each {|n| j += (n.to_i * i); i *= 100}
versions[key] = j
end
versions.sort {|a,b| a[1]<=>b[1]}
versions.each do |k, v|
if v >= 40400
return k
end
raise QMakeTooOld
end
end
puts which_qmake if __FILE__ == $0