2010-04-24 11:01:44 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Libspotify < Formula
|
2010-04-24 11:01:44 +00:00
|
|
|
homepage 'http://developer.spotify.com/en/libspotify/overview/'
|
2012-06-17 12:43:17 +00:00
|
|
|
url 'https://developer.spotify.com/download/libspotify/libspotify-12.1.51-Darwin-universal.zip'
|
|
|
|
md5 '41d019fd85c83ca4c28b823f825a9311'
|
2010-04-24 11:01:44 +00:00
|
|
|
|
|
|
|
def install
|
2012-06-17 12:43:17 +00:00
|
|
|
(include+'libspotify').install "libspotify.framework/Versions/12.1.51/Headers/api.h"
|
|
|
|
lib.install "libspotify.framework/Versions/12.1.51/libspotify" => "libspotify.12.1.51.dylib"
|
2011-11-01 13:58:43 +00:00
|
|
|
doc.install Dir['docs/*']
|
2012-05-23 19:43:50 +00:00
|
|
|
doc.install %w(ChangeLog README LICENSE licenses.xhtml examples)
|
2011-11-01 13:58:43 +00:00
|
|
|
man3.install Dir['man3/*']
|
2010-04-24 11:01:44 +00:00
|
|
|
|
|
|
|
cd lib
|
2012-06-17 12:43:17 +00:00
|
|
|
ln_s "libspotify.12.1.51.dylib", "libspotify.dylib"
|
|
|
|
ln_s "libspotify.12.1.51.dylib", "libspotify.12.dylib"
|
2010-04-24 11:01:44 +00:00
|
|
|
|
2010-08-10 14:44:10 +00:00
|
|
|
system "install_name_tool", "-id",
|
2012-06-17 12:43:17 +00:00
|
|
|
"#{HOMEBREW_PREFIX}/lib/libspotify.12.1.51.dylib",
|
2010-04-24 11:01:44 +00:00
|
|
|
"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
|