1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 16:44:05 +02:00

* Remove obsolete ruby scripts in liblastfm.

This commit is contained in:
Christian Muehlhaeuser
2011-09-10 09:28:40 +02:00
parent a9e08a7104
commit fd72e7fa4e
3 changed files with 0 additions and 218 deletions

View File

@@ -1,101 +0,0 @@
#
# platform.rb: naive platform detection for Ruby
# author: Matt Mower <self@mattmower.com>
#
# == Platform
#
# Platform is a simple module which parses the Ruby constant
# RUBY_PLATFORM and works out the OS, it's implementation,
# and the architecture it's running on.
#
# The motivation for writing this was coming across a case where
#
# +if RUBY_PLATFORM =~ /win/+
#
# didn't behave as expected (i.e. on powerpc-darwin-8.1.0)
#
# It is hoped that providing a library for parsing the platform
# means that we can cover all the cases and have something which
# works reliably 99% of the time.
#
# Please report any anomalies or new combinations to the author(s).
#
# == Use
#
# require "platform"
#
# defines
#
# Platform::OS (:unix,:win32,:vms,:os2)
# Platform::IMPL (:macosx,:linux,:mswin)
# Platform::ARCH (:powerpc,:x86,:alpha)
#
# if an unknown configuration is encountered any (or all) of
# these constant may have the value :unknown.
#
# To display the combination for your setup run
#
# ruby platform.rb
#
module Platform
if RUBY_PLATFORM =~ /darwin/i
OS = :unix
IMPL = :macosx
elsif RUBY_PLATFORM =~ /linux/i
OS = :unix
IMPL = :linux
elsif RUBY_PLATFORM =~ /freebsd/i
OS = :unix
IMPL = :freebsd
elsif RUBY_PLATFORM =~ /netbsd/i
OS = :unix
IMPL = :netbsd
elsif RUBY_PLATFORM =~ /mswin/i
OS = :win32
IMPL = :mswin
elsif RUBY_PLATFORM =~ /cygwin/i
OS = :win32
IMPL = :mswin
elsif RUBY_PLATFORM =~ /mingw/i
OS = :win32
IMPL = :mingw
elsif RUBY_PLATFORM =~ /bccwin/i
OS = :win32
IMPL = :bccwin
elsif RUBY_PLATFORM =~ /wince/i
OS = :win32
IMPL = :wince
elsif RUBY_PLATFORM =~ /vms/i
OS = :vms
IMPL = :vms
elsif RUBY_PLATFORM =~ /os2/i
OS = :os2
IMPL = :os2 # maybe there is some better choice here?
else
OS = :unknown
IMPL = :unknown
end
# whither AIX, SOLARIS, and the other unixen?
if RUBY_PLATFORM =~ /(i\d86)/i
ARCH = :x86
elsif RUBY_PLATFORM =~ /ia64/i
ARCH = :ia64
elsif RUBY_PLATFORM =~ /powerpc/i
ARCH = :powerpc
elsif RUBY_PLATFORM =~ /alpha/i
ARCH = :alpha
else
ARCH = :unknown
end
# What about AMD, Turion, Motorola, etc..?
end
if __FILE__ == $0
puts "Platform OS=#{Platform::OS}, IMPL=#{Platform::IMPL}, ARCH=#{Platform::ARCH}"
end

View File

@@ -1,79 +0,0 @@
#!/usr/bin/ruby
# Usage examples:
# qpp foo.pro => ./_file.qmake
# qpp foo/bar/ => ./_file.qmake
#
cwd = File.dirname( __FILE__ )
require 'find'
require 'ftools'
require "#{cwd}/platform.rb"
def find_sources()
Find.find( '.' ) do |path|
if File.directory?( path )
excludes = ['.svn', 'tests', '_build', 'contrib']
case Platform::IMPL
when :macosx then excludes << 'win' << 'linux'
when :mswin, :cygwin then excludes << 'mac' << 'linux'
when :linux, :freebsd then excludes << 'win' << 'mac'
else excludes << 'win' << 'mac' << 'linux'
end
Find.prune if excludes.include?( File.basename( path ) ) or (path != "." and not Dir["#{path}/*.pro"].empty? )
elsif File.file?( path )
case Platform::IMPL
when :macosx then next if /_(linux|win)\.(cpp|h)$/.match( path )
when :mswin, :cygwin then next if /_(mac|linux)\.(cpp|h)$/.match( path )
when :linux, :freebsd then next if /_(mac|win)\.(cpp|h)$/.match( path )
end
yield( path, File.extname( path ) ) unless File.basename(path) == 'EXAMPLE.cpp'
end
end
end
########################################################################### impl
sources = Array.new
headers = Array.new
forms = Array.new
resources = Array.new
abort "usage: qpp file.pro.in" unless File.file? ARGV[0]
File.open( ARGV[0] ).each_line do |line|
line.chomp!
matches = /^\s*TEMPLATE += (.*)$/.match( line )
if !matches.nil?
exit if matches[1].downcase == 'subdirs'
end
matches = /^\s*VERSION += +((\d\.){0,2}\d)/.match( line )
if !matches.nil? && !File.file?( "_version.h" )
File.open( "_version.h", 'w' ) { |f| f.write( "#define VERSION \"#{matches[1]}\"\n" ) }
end
end
Dir.chdir File.dirname(ARGV[0]) do
find_sources do |path, ext|
path.sub!( /^.\//, '' )
case ext
when ".h" then headers << path
when ".ui" then forms << path
when ".qrc" then resources << path
when ".cpp" then sources << path
when ".mm" then sources << path if Platform::IMPL == :macosx
when ".m" then sources << path if Platform::IMPL == :macosx
end
end
end
def write_section( section, array )
return if array.empty?
print "#{section} +="
array.each { |path| print " \\\n\t#{path}" }
puts
end
write_section( "SOURCES", sources )
write_section( "HEADERS", headers )
write_section( "FORMS", forms )
write_section( "RESOURCES", resources )

View File

@@ -1,38 +0,0 @@
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