aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorSamuel John2013-06-13 18:10:04 +0200
committerSamuel John2013-06-13 18:12:50 +0200
commit6e97ac1b54c0dde3f7c481373c14cac95e1f798c (patch)
tree53cec2f90affab008462fe897cdf26564456a400 /Library/Formula
parent8da47cda97633de5d561d5b7b758ecba330818a6 (diff)
downloadhomebrew-6e97ac1b54c0dde3f7c481373c14cac95e1f798c.tar.bz2
libmagic: Now --with-python
And a test. Use `brew test libmagic --with-python`
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/libmagic.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/Library/Formula/libmagic.rb b/Library/Formula/libmagic.rb
index af7ca9b34..46bbc709e 100644
--- a/Library/Formula/libmagic.rb
+++ b/Library/Formula/libmagic.rb
@@ -8,6 +8,8 @@ class Libmagic < Formula
option :universal
+ depends_on :python => :optional
+
# Fixed upstream, should be in next release
# See http://bugs.gw.com/view.php?id=230
def patches; DATA; end if MacOS.version < :lion
@@ -20,10 +22,22 @@ class Libmagic < Formula
"--enable-fsect-man5"
system "make install"
+ python do
+ cd "python" do
+ system python, "setup.py", "install", "--prefix=#{prefix}"
+ end
+ end
+
# Don't dupe this system utility
rm bin/"file"
rm man1/"file.1"
end
+
+ test do
+ if build.with? 'python'
+ system 'python', '-c', "import magic; magic._init()"
+ end
+ end
end
__END__