2010-04-24 11:01:44 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Libspotify <Formula
|
|
|
|
url 'http://developer.spotify.com/download/libspotify/libspotify-0.0.4-darwin.zip'
|
|
|
|
version '0.0.4'
|
|
|
|
homepage 'http://developer.spotify.com/en/libspotify/overview/'
|
|
|
|
md5 'a97552130df26b1aa2228adcf8d4210b'
|
|
|
|
|
|
|
|
def install
|
|
|
|
prefix.install 'share'
|
2010-04-07 05:58:35 +00:00
|
|
|
(include+'libspotify').install "libspotify.framework/Versions/#{version}/Headers/api.h"
|
2010-08-10 14:44:10 +00:00
|
|
|
lib.install "libspotify.framework/Versions/#{version}/libspotify" => 'libspotify.0.0.4.dylib'
|
2010-04-24 11:01:44 +00:00
|
|
|
doc.install Dir['doc/*']
|
|
|
|
|
|
|
|
cd lib
|
|
|
|
ln_s "libspotify.0.0.4.dylib", "libspotify.dylib"
|
|
|
|
|
2010-08-10 14:44:10 +00:00
|
|
|
system "install_name_tool", "-id",
|
2010-04-24 11:01:44 +00:00
|
|
|
"#{HOMEBREW_PREFIX}/lib/libspotify.#{version}.dylib",
|
|
|
|
"libspotify.dylib"
|
|
|
|
|
2010-04-07 05:58:35 +00:00
|
|
|
(lib+'pkgconfig/libspotify.pc').write pc_content
|
2010-04-24 11:01:44 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def pc_content; <<-EOS.undent
|
|
|
|
prefix=#{HOMEBREW_PREFIX}
|
|
|
|
exec_prefix=${prefix}
|
|
|
|
libdir=${exec_prefix}/lib
|
|
|
|
includedir=${prefix}/include
|
|
|
|
|
|
|
|
Name: libspotify
|
|
|
|
Description: Spotify client library
|
|
|
|
Version: #{version}
|
|
|
|
Libs: -L${libdir} -lspotify
|
|
|
|
Cflags: -I${includedir}
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|