From 9326813f3f106938e49ae34bfc90c38f439c2ae4 Mon Sep 17 00:00:00 2001 From: Jeff Mitchell Date: Fri, 4 May 2012 10:38:04 -0400 Subject: [PATCH] Synchronize liblastfm structure a bit, other than src/ --- thirdparty/liblastfm2/{README => README.md} | 26 +--- thirdparty/liblastfm2/admin/lastfm.h.rb | 5 - thirdparty/liblastfm2/admin/utils.rb | 34 ----- thirdparty/liblastfm2/configure | 46 ------- thirdparty/liblastfm2/lastfm.pro | 142 ++++++++++++++++++++ 5 files changed, 149 insertions(+), 104 deletions(-) rename thirdparty/liblastfm2/{README => README.md} (84%) delete mode 100755 thirdparty/liblastfm2/admin/lastfm.h.rb delete mode 100644 thirdparty/liblastfm2/admin/utils.rb delete mode 100755 thirdparty/liblastfm2/configure create mode 100644 thirdparty/liblastfm2/lastfm.pro diff --git a/thirdparty/liblastfm2/README b/thirdparty/liblastfm2/README.md similarity index 84% rename from thirdparty/liblastfm2/README rename to thirdparty/liblastfm2/README.md index d39417ecc..4132ce5ea 100644 --- a/thirdparty/liblastfm2/README +++ b/thirdparty/liblastfm2/README.md @@ -4,19 +4,17 @@ liblastfm is a collection of libraries to help you integrate Last.fm services into your rich desktop software. It is officially supported software developed by Last.fm staff. -Max Howell http://twitter.com/mxcl -Jono Cole http://twitter.com/jonocole -Doug Mansell http://twitter.com/dougma +Michael Coffey http://twitter.com/eartle -Fork it: http://github.com/mxcl/liblastfm +Fork it: http://github.com/eartle/liblastfm Dependencies ============ liblastfm dynamically links to: -* Qt 4.4 - http://www.qtsoftware.com +* Qt 4.8 + http://qt.nokia.com/ * FFTW 3.2 Compiled with single precision http://www.fftw.org @@ -31,14 +29,6 @@ Mac OS X sudo port upgrade installed sudo port install libsamplerate fftw-3 qt4-mac-devel -qt4-mac-devel will take a long time to build. So you may want to install the -Trolltech binary package instead. - -MacPorts carries liblastfm now, so you may have downloaded this package simply -to perform this next line: - - sudo port install liblastfm - Linux/*NIX ---------- Do something like this: @@ -49,11 +39,11 @@ Additionally on Linux the configure process requires lsb_release. This is usually already installed (correct me if I'm wrong). Please note, we have only tested on Linux, but we think it'll work on all -varieties of UNIX. If it doesn't, report the bug to mxcl on GitHub. +varieties of UNIX. If it doesn't, report the bug to eartle on GitHub. Windows ------- -Install Ruby. Install Visual Studio 2005 or higher. Install Qt. Install the +Install Ruby. Install Visual Studio 2008 or higher. Install Qt. Install the Windows Server 2003 Platform SDK r2: http://www.microsoft.com/Downloads/details.aspx?FamilyID=484269e2-3b89-47e3-8eb7-1f2be6d7123a @@ -69,12 +59,10 @@ see the next section. Installing liblastfm ==================== - ruby configure --release --prefix /usr/local && make && sudo make install + qmake && make && sudo make install Packaging liblastfm ------------------- -DESTDIR is supported. - liblastfm builds to two dynamic libraries (liblastfm.so and liblastfm_fingerprint.so). liblastfm.so links only to Qt, but the fingerprinting part has additional dependencies. So ideally, you would diff --git a/thirdparty/liblastfm2/admin/lastfm.h.rb b/thirdparty/liblastfm2/admin/lastfm.h.rb deleted file mode 100755 index 1582b7086..000000000 --- a/thirdparty/liblastfm2/admin/lastfm.h.rb +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/ruby -f = File.new(ARGV[0], "w") -Dir["_include/lastfm/*"].each do |h| - f.write %Q{#include "lastfm/#{File.basename h}"\n} -end \ No newline at end of file diff --git a/thirdparty/liblastfm2/admin/utils.rb b/thirdparty/liblastfm2/admin/utils.rb deleted file mode 100644 index 5a6772c4c..000000000 --- a/thirdparty/liblastfm2/admin/utils.rb +++ /dev/null @@ -1,34 +0,0 @@ -cwd = File.dirname( __FILE__ ) - -def h(s, n) - puts '==> '+s -end - -def h1 s - h(s, 34) -end - -def h2 s - h(s, 33) - yield -end - -def qmake_env(env, qenv) - env=Array.new(1,env) if env.instance_of? String - values=Array.new - env.each { |x| values << ENV[x] if ENV[x] } - if values.size > 0 - "#{qenv} = #{values.join(' ')}\n" - else - nil - end -end - -class PkgConfigNotFound < RuntimeError; end -class PkgNotFound < RuntimeError; end - -def pkgconfig pkg, prettyname - system "pkg-config --exists '#{pkg}'" - raise PkgConfigNotFound if $? == 127 - raise PkgNotFound.new(prettyname) if $? != 0 -end diff --git a/thirdparty/liblastfm2/configure b/thirdparty/liblastfm2/configure deleted file mode 100755 index f6c02fa88..000000000 --- a/thirdparty/liblastfm2/configure +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/ruby -cwd = File.dirname( __FILE__ ) -require "#{cwd}/admin/utils.rb" - - h2 'Determining installation prefix' do - if ARGV.include? '--prefix' - n=ARGV.index '--prefix' - ENV['LFM_PREFIX'] = ARGV[n+1] - end - ENV['LFM_PREFIX'] = '/usr/local' if ENV['LFM_PREFIX'].nil? - if File.exists? ENV['LFM_PREFIX'] and !File.directory? ENV['LFM_PREFIX'] - abort "Installation prefix exists but isn't a directory: "+ENV['LFM_PREFIX'] - end - puts "Will install to: "+ENV['LFM_PREFIX'] - end - - h2 "Configuring qmake..." do - args=Array.new - if ARGV.include? '--release' - args << '-config release' - else - args << '-config debug' - end - if ARGV.include? '--no-strip' - args << '"CONFIG += nostrip"' - end - ENV['LFM_QMAKE'] = "#{$qmake} #{args.join(' ')}" - end - - h2 "Generating Makefile..." do - hs = Array.new - hs << 'global.h' - hs << 'core/UrlBuilder.h' << 'core/XmlQuery.h' << 'core/misc.h' - hs << 'fingerprint/Fingerprint.h' << 'fingerprint/FingerprintableSource.h' - hs << 'radio/RadioStation.h' << 'radio/RadioTuner.h' - hs << 'scrobble/Audioscrobbler.h' << 'scrobble/ScrobblePoint.h' << 'scrobble/ScrobbleCache.h' - hs << 'types/Tasteometer.h' << 'types/AbstractType.h' << 'types/Track.h' << 'types/Mbid.h' << 'types/Artist.h' << 'types/Album.h' << 'types/FingerprintId.h' << 'types/Playlist.h' << 'types/Tag.h' << 'types/User.h' << 'types/Xspf.h' - hs << 'ws/ws.h' << 'ws/InternetConnectionMonitor.h' << 'ws/NetworkAccessManager.h' - uname = `uname` - ENV['LFM_VERSION']="0.4.0" - File.new("#{cwd}/Makefile", 'w').write `ruby admin/Makefile.rb #{hs.join(' ')}` - end - - puts - puts "Good, your configure is finished! Now type: make" - diff --git a/thirdparty/liblastfm2/lastfm.pro b/thirdparty/liblastfm2/lastfm.pro new file mode 100644 index 000000000..32839418e --- /dev/null +++ b/thirdparty/liblastfm2/lastfm.pro @@ -0,0 +1,142 @@ +TEMPLATE = lib +CONFIG += dll +QT = core network xml + +ROOT_DIR = . + +BUILD_DIR = _build +DESTDIR = $$ROOT_DIR/_bin + +OBJECTS_DIR = $$BUILD_DIR +MOC_DIR = $$BUILD_DIR +UI_DIR = $$BUILD_DIR +RCC_DIR = $$BUILD_DIR +INCLUDEPATH += $$ROOT_DIR/_include + +win32:DEFINES += _CRT_SECURE_NO_WARNINGS WIN32_LEAN_AND_MEAN + +mac { + QMAKE_PKGINFO_TYPEINFO = last + QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.4 +} + +*g++* { + # allow use of 'and', 'or', etc. as symbols + QMAKE_CXXFLAGS += -fno-operator-names + QMAKE_CXXFLAGS_RELEASE += -fvisibility-inlines-hidden -fvisibility=hidden +} + +# used to determine if we should statically link the fingerprint library +# used by lastfm-desktop and other projects +CONFIG -= app_bundle + +win32{ +INSTALLS = headers +headers.path = _include/lastfm +headers.files = src/*.h +} +else{ + isEmpty( PREFIX ) { + PREFIX=/usr/local + } +INSTALLS = target headers +target.path = $${PREFIX}/lib +headers.path = $${PREFIX}/include/lastfm +headers.files = src/*.h +} + +INCLUDEPATH += src + +win32{ + DEFINES += LASTFM_LIB _ATL_DLL + LIBS += winhttp.lib wbemuuid.lib # ws configuration +} +mac{ + LIBS += -framework SystemConfiguration # ws configuration + #TODO we should only use these with the carbon version of Qt! + LIBS += -framework CoreFoundation # various +} + +unix:!mac{ + QT += dbus +} + +SOURCES += \ + src/ws.cpp \ + src/NetworkConnectionMonitor.cpp \ + src/NetworkAccessManager.cpp \ + src/InternetConnectionMonitor.cpp \ + src/Xspf.cpp \ + src/User.cpp \ + src/Track.cpp \ + src/Tasteometer.cpp \ + src/Tag.cpp \ + src/Playlist.cpp \ + src/Mbid.cpp \ + src/FingerprintId.cpp \ + src/Artist.cpp \ + src/Album.cpp \ + src/ScrobbleCache.cpp \ + src/ScrobblePoint.cpp \ + src/Audioscrobbler.cpp \ + src/RadioTuner.cpp \ + src/RadioStation.cpp \ + src/XmlQuery.cpp \ + src/UrlBuilder.cpp \ + src/misc.cpp \ + src/Chart.cpp \ + src/Auth.cpp \ + src/Library.cpp + +HEADERS += \ + src/ws.h \ + src/NetworkConnectionMonitor.h \ + src/NetworkAccessManager.h \ + src/InternetConnectionMonitor.h \ + src/Xspf.h \ + src/User.h \ + src/Track.h \ + src/Tasteometer.h \ + src/Tag.h \ + src/Playlist.h \ + src/Mbid.h \ + src/FingerprintId.h \ + src/Artist.h \ + src/Album.h \ + src/AbstractType.h \ + src/ScrobblePoint.h \ + src/ScrobbleCache.h \ + src/Audioscrobbler.h \ + src/RadioTuner.h \ + src/RadioStation.h \ + src/global.h \ + src/XmlQuery.h \ + src/UrlBuilder.h \ + src/misc.h \ + src/Chart.h \ + src/Auth.h \ + src/Library.h + +win32:SOURCES += src/win/WNetworkConnectionMonitor_win.cpp \ + src/win/WmiSink.cpp \ + src/win/Pac.cpp \ + src/win/NdisEvents.cpp + +win32:HEADERS += src/win/WNetworkConnectionMonitor.h \ + src/win/WmiSink.h \ + src/win/Pac.h \ + src/win/NdisEvents.h \ + src/win/IeSettings.h \ + src/win/ComSetup.h + +mac:SOURCES += src/mac/MNetworkConnectionMonitor_mac.cpp + +mac:HEADERS += src/mac/ProxyDict.h \ + src/mac/MNetworkConnectionMonitor.h + +unix:!mac:SOURCES += src/linux/LNetworkConnectionMonitor_linux.cpp +unix:!mac:HEADERS += src/linux/LNetworkConnectionMonitor.h + +!win32:VERSION = 1.0.0 + +