aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-06-06 22:56:00 -0500
committerJack Nagel2012-06-06 23:13:41 -0500
commit8b168dd141cf70250c86818de7d5152f894ce07b (patch)
tree110102c3c8297aeaecbc59d79aa0c8c2ad0f1439 /Library
parent5bcd1f328b6584d518d6439bd35b7959cb6a9122 (diff)
downloadhomebrew-8b168dd141cf70250c86818de7d5152f894ce07b.tar.bz2
libxml2 2.8.0
- Build Python bindings manually so we can exert some semblance of control over where they are installed. Tentatively fixes #12078. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/libxml2.rb36
1 files changed, 26 insertions, 10 deletions
diff --git a/Library/Formula/libxml2.rb b/Library/Formula/libxml2.rb
index 285eafcce..31053a0dd 100644
--- a/Library/Formula/libxml2.rb
+++ b/Library/Formula/libxml2.rb
@@ -1,9 +1,9 @@
require 'formula'
class Libxml2 < Formula
- url 'ftp://xmlsoft.org/libxml2/libxml2-2.7.8.tar.gz'
homepage 'http://xmlsoft.org'
- md5 '8127a65e8c3b08856093099b52599c86'
+ url 'ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz'
+ sha256 'f2e2d0e322685193d1affec83b21dc05d599e17a7306d7b90de95bb5b9ac622a'
keg_only :provided_by_osx
@@ -22,16 +22,32 @@ class Libxml2 < Formula
def install
ENV.universal_binary if ARGV.build_universal?
- args = ["--disable-dependency-tracking", "--prefix=#{prefix}"]
+ system "./configure", "--prefix=#{prefix}", "--without-python"
+ system "make"
+ ENV.deparallelize
+ system "make install"
+
if ARGV.include? '--with-python'
- python_prefix=`python-config --prefix`
- ohai "Installing Python module to #{python_prefix}"
- args << "--with-python=#{python_prefix}"
+ # Build Python bindings manually
+ cd 'python' do
+ python_lib = lib/which_python/'site-packages'
+ ENV.append 'PYTHONPATH', python_lib
+ python_lib.mkpath
+
+ archs = archs_for_command("python")
+ archs.remove_ppc!
+ arch_flags = archs.as_arch_flags
+
+ ENV.append 'CFLAGS', arch_flags
+ ENV.append 'LDFLAGS', arch_flags
+
+ system "python", "setup.py", "install_lib",
+ "--install-dir=#{python_lib}"
+ end
end
+ end
- system "./configure", *args
- system "make"
- ENV.j1
- system "make install"
+ def which_python
+ "python" + `python -c 'import sys;print(sys.version[:3])'`.strip
end
end