2009-11-02 03:00:35 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Libxml2 < Formula
|
2009-11-02 03:00:35 +00:00
|
|
|
homepage 'http://xmlsoft.org'
|
|
|
|
|
2013-09-22 00:27:26 +00:00
|
|
|
stable do
|
|
|
|
url 'ftp://xmlsoft.org/libxml2/libxml2-2.9.1.tar.gz'
|
|
|
|
mirror 'http://xmlsoft.org/sources/libxml2-2.9.1.tar.gz'
|
|
|
|
sha256 'fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb'
|
2013-06-11 09:37:55 +00:00
|
|
|
|
|
|
|
# 2.9.1 cannot build with Python 2.6: https://github.com/mxcl/homebrew/issues/20249
|
2013-07-16 09:22:44 +00:00
|
|
|
if MacOS.version <= :snow_leopard
|
|
|
|
depends_on :python => ["2.7", :optional]
|
|
|
|
else
|
|
|
|
depends_on :python => ["2.7", :recommended]
|
|
|
|
end
|
2013-06-11 09:37:55 +00:00
|
|
|
end
|
2013-02-11 00:06:42 +00:00
|
|
|
|
2013-09-22 00:27:26 +00:00
|
|
|
head do
|
|
|
|
url 'https://git.gnome.org/browse/libxml2', :using => :git
|
|
|
|
|
|
|
|
depends_on :python => :recommended # satisfied by Python 2.6+
|
|
|
|
depends_on :autoconf
|
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
end
|
|
|
|
|
|
|
|
keg_only :provided_by_osx
|
|
|
|
|
|
|
|
option :universal
|
|
|
|
|
2012-03-18 20:33:24 +00:00
|
|
|
fails_with :llvm do
|
|
|
|
build 2326
|
|
|
|
cause "Undefined symbols when linking"
|
|
|
|
end
|
2011-03-21 21:24:22 +00:00
|
|
|
|
2009-11-02 03:00:35 +00:00
|
|
|
def install
|
2012-09-02 18:46:24 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2013-06-11 09:37:55 +00:00
|
|
|
if build.head?
|
|
|
|
inreplace 'autogen.sh', 'libtoolize', 'glibtoolize'
|
|
|
|
system './autogen.sh'
|
|
|
|
end
|
2010-11-02 06:01:25 +00:00
|
|
|
|
2013-02-10 23:19:13 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--without-python"
|
2012-06-07 03:56:00 +00:00
|
|
|
system "make"
|
|
|
|
ENV.deparallelize
|
|
|
|
system "make install"
|
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
python do
|
|
|
|
# This python do block sets up the site-packages in the Cellar.
|
2012-06-07 03:56:00 +00:00
|
|
|
cd 'python' do
|
2013-01-21 09:33:56 +00:00
|
|
|
# We need to insert our include dir first
|
|
|
|
inreplace 'setup.py', 'includes_dir = [', "includes_dir = ['#{include}', '#{MacOS.sdk_path}/usr/include',"
|
|
|
|
system python, 'setup.py', "install", "--prefix=#{prefix}"
|
|
|
|
end
|
|
|
|
# This is keg_only but it makes sense to have the python bindings:
|
|
|
|
ohai 'Linking python bindings'
|
|
|
|
Dir["#{python.site_packages}/*"].each{ |f|
|
|
|
|
path = python.global_site_packages/(Pathname.new(f).basename)
|
|
|
|
puts path
|
|
|
|
rm path if path.exist?
|
|
|
|
ln_s f, path
|
|
|
|
}
|
2013-07-10 05:17:42 +00:00
|
|
|
end if build.with? 'python'
|
2013-01-21 09:33:56 +00:00
|
|
|
end
|
2012-06-07 03:56:00 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
def caveats
|
2013-06-11 09:37:55 +00:00
|
|
|
if build.with? 'python'
|
|
|
|
<<-EOS.undent
|
|
|
|
Even if this formula is keg_only, the python bindings have been linked
|
2013-06-18 14:45:18 +00:00
|
|
|
into Homebrew's global site-packages for your convenience.
|
2013-06-11 09:37:55 +00:00
|
|
|
#{python.global_site_packages}
|
2012-06-07 03:56:00 +00:00
|
|
|
|
2013-01-21 09:33:56 +00:00
|
|
|
EOS
|
2013-06-11 09:37:55 +00:00
|
|
|
end
|
|
|
|
end
|
2012-08-21 14:08:58 +00:00
|
|
|
|
2013-07-16 09:12:14 +00:00
|
|
|
test do
|
2013-06-13 13:52:23 +00:00
|
|
|
python do
|
2013-01-21 09:33:56 +00:00
|
|
|
system python, '-c', "import libxml2"
|
2010-11-02 06:01:25 +00:00
|
|
|
end
|
2012-06-07 03:56:00 +00:00
|
|
|
end
|
2009-11-02 03:00:35 +00:00
|
|
|
end
|