1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-02-11 19:24:40 +01:00

Synchronize liblastfm structure a bit, other than src/

This commit is contained in:
Jeff Mitchell 2012-05-04 10:38:04 -04:00
parent 65bc08524e
commit 9326813f3f
5 changed files with 149 additions and 104 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

142
thirdparty/liblastfm2/lastfm.pro vendored Normal file
View File

@ -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