Skip to content

Commit

Permalink
libxml2: always build python bindings
Browse files Browse the repository at this point in the history
Fixes chunks of #13133
and seems a pretty harmless change.
  • Loading branch information
DomT4 authored and ilovezfs committed May 29, 2017
1 parent bc5d3eb commit 2ccc955
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Formula/libxml2.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Libxml2 < Formula
desc "GNOME XML library"
homepage "http://xmlsoft.org"
revision 2
revision 3

stable do
url "http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz"
Expand Down Expand Up @@ -41,7 +41,7 @@ class Libxml2 < Formula

keg_only :provided_by_osx

depends_on :python => :optional
depends_on :python if MacOS.version <= :snow_leopard

def install
if build.head?
Expand All @@ -57,12 +57,10 @@ def install
ENV.deparallelize
system "make", "install"

if build.with? "python"
cd "python" do
# 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
cd "python" do
# 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
end

Expand All @@ -83,5 +81,8 @@ def install
args += %w[test.c -o test]
system ENV.cc, *args
system "./test"

ENV.prepend_path "PYTHONPATH", lib/"python2.7/site-packages"
system "python", "-c", "import libxml2"
end
end

0 comments on commit 2ccc955

Please sign in to comment.