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:
38
thirdparty/liblastfm2/admin/which_qmake.rb
vendored
Normal file
38
thirdparty/liblastfm2/admin/which_qmake.rb
vendored
Normal 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
|
Reference in New Issue
Block a user