2012-03-17 01:08:08 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Redland < Formula
|
|
|
|
homepage 'http://librdf.org/'
|
2013-04-24 00:19:08 +00:00
|
|
|
url 'http://download.librdf.org/source/redland-1.0.16.tar.gz'
|
|
|
|
sha1 '0dc3d65bee6d580cae84ed261720b5b4e6b1f856'
|
2012-03-17 01:08:08 +00:00
|
|
|
|
2013-08-05 10:13:24 +00:00
|
|
|
option 'with-php', 'Build with php support'
|
|
|
|
option 'with-ruby', 'Build with ruby support'
|
|
|
|
|
2012-03-17 01:08:08 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
|
|
|
depends_on 'raptor'
|
|
|
|
depends_on 'rasqal'
|
2013-12-13 19:52:55 +00:00
|
|
|
depends_on 'unixodbc'
|
2013-05-08 00:46:46 +00:00
|
|
|
depends_on 'sqlite' => :recommended
|
2013-08-05 10:13:24 +00:00
|
|
|
depends_on 'berkeley-db' => :optional
|
|
|
|
depends_on :python => :optional
|
2012-03-17 01:08:08 +00:00
|
|
|
|
2013-09-17 04:06:34 +00:00
|
|
|
resource 'bindings' do
|
|
|
|
url 'http://download.librdf.org/source/redland-bindings-1.0.16.1.tar.gz'
|
|
|
|
sha1 '98c20b64cf5e99cbf29fcb84490e73e2a828213a'
|
|
|
|
end
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2334
|
|
|
|
end
|
2012-03-17 01:08:08 +00:00
|
|
|
|
|
|
|
def install
|
2013-08-05 10:13:24 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--with-mysql=no
|
|
|
|
]
|
|
|
|
|
|
|
|
if build.with? 'sqlite'
|
|
|
|
args << "--with-sqlite=yes"
|
|
|
|
else
|
|
|
|
args << "--with-sqlite=no"
|
|
|
|
end
|
|
|
|
|
|
|
|
if build.with? 'berkeley-db'
|
2014-02-27 03:38:53 +00:00
|
|
|
args << "--with-bdb=#{Formula["berkeley-db"].opt_prefix}"
|
2013-08-05 10:13:24 +00:00
|
|
|
else
|
|
|
|
args << "--with-bdb=no"
|
|
|
|
end
|
|
|
|
|
|
|
|
system "./configure", *args
|
2012-03-17 01:08:08 +00:00
|
|
|
system "make install"
|
2013-08-05 10:13:24 +00:00
|
|
|
|
2013-09-17 04:06:34 +00:00
|
|
|
if %w{php python ruby}.any? { |lang| build.with? lang }
|
|
|
|
resource('bindings').stage do
|
2013-08-05 10:13:24 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
]
|
|
|
|
|
|
|
|
if build.with? 'php'
|
|
|
|
args << "--with-php"
|
|
|
|
args << "--with-php-linking=dylib"
|
|
|
|
end
|
|
|
|
|
|
|
|
if build.with? 'ruby'
|
|
|
|
`ruby --version` =~ /ruby (\d\.\d).\d \(.*\) \[(.*)\]/
|
|
|
|
ruby_install_dir = lib + 'ruby/site_ruby/' + $1
|
|
|
|
ruby_arch_install_dir = ruby_install_dir + $2
|
|
|
|
ruby_install_dir.mkpath
|
|
|
|
ruby_arch_install_dir.mkpath
|
|
|
|
args << "--with-ruby"
|
|
|
|
args << "--with-ruby-install-dir=#{ruby_install_dir}"
|
|
|
|
args << "--with-ruby-arch-install-dir=#{ruby_arch_install_dir}"
|
|
|
|
end
|
|
|
|
|
|
|
|
if build.with? 'python'
|
2014-01-04 13:16:02 +00:00
|
|
|
ENV['PYTHON_LIB'] = lib/'python2.7/site-packages'
|
2013-08-05 10:13:24 +00:00
|
|
|
args << "--with-python"
|
|
|
|
end
|
|
|
|
|
|
|
|
ENV.append 'PKG_CONFIG_LIBDIR', "#{lib}/pkgconfig", ':'
|
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
|
|
|
|
if build.with? 'php'
|
|
|
|
php_extension_dir = lib + 'php/extensions'
|
|
|
|
php_extension_dir.mkpath
|
|
|
|
inreplace 'php/Makefile' do |s|
|
|
|
|
s.change_make_var! 'PHP_EXTENSION_DIR', php_extension_dir
|
|
|
|
s.change_make_var! 'phpdir', php_extension_dir
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
s = ''
|
|
|
|
|
|
|
|
if build.with? 'php'
|
|
|
|
s += <<-EOS.undent
|
|
|
|
You may need to add the following line to php.ini:
|
|
|
|
extension="#{HOMEBREW_PREFIX}/lib/php/extensions/redland.dylib"
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
if build.with? 'ruby'
|
|
|
|
s += <<-EOS.undent
|
|
|
|
You may need to add the Ruby bindings to your RUBYLIB from:
|
|
|
|
#{HOMEBREW_PREFIX}/lib/ruby/site_ruby
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
return s.empty? ? nil : s
|
2012-03-17 01:08:08 +00:00
|
|
|
end
|
|
|
|
end
|