2009-12-20 22:42:33 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Libmagic < Formula
|
|
|
|
homepage 'http://www.darwinsys.com/file/'
|
2014-02-16 12:01:02 +00:00
|
|
|
url 'ftp://ftp.astron.com/pub/file/file-5.17.tar.gz'
|
|
|
|
mirror 'http://fossies.org/unix/misc/file-5.17.tar.gz'
|
|
|
|
sha1 'f7e837a0d3e4f40a02ffe7da5e146b967448e0d8'
|
2009-12-20 22:42:33 +00:00
|
|
|
|
2014-02-24 15:11:24 +00:00
|
|
|
bottle do
|
2014-02-25 16:57:43 +00:00
|
|
|
revision 1
|
|
|
|
sha1 "e39a611cc0351b0f633b96ca7fc8834b8575c4e9" => :mavericks
|
|
|
|
sha1 "049bf4c884b40b53a0e2db2dd3a7c6a4fba2e46d" => :mountain_lion
|
|
|
|
sha1 "6cb0d8979255f0d7b53665e547e4941b79b7dd81" => :lion
|
2014-02-24 15:11:24 +00:00
|
|
|
end
|
|
|
|
|
2013-05-20 17:50:44 +00:00
|
|
|
option :universal
|
|
|
|
|
2013-06-13 16:10:04 +00:00
|
|
|
depends_on :python => :optional
|
|
|
|
|
2013-01-29 15:56:56 +00:00
|
|
|
# Fixed upstream, should be in next release
|
|
|
|
# See http://bugs.gw.com/view.php?id=230
|
2013-07-30 03:32:07 +00:00
|
|
|
def patches
|
|
|
|
p = []
|
|
|
|
p << DATA if MacOS.version < :lion
|
|
|
|
end
|
2013-01-29 15:56:56 +00:00
|
|
|
|
2009-12-20 22:42:33 +00:00
|
|
|
def install
|
2013-05-20 17:50:44 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
|
|
|
|
2014-02-25 15:39:33 +00:00
|
|
|
# Clean up "src/magic.h" as per http://bugs.gw.com/view.php?id=330
|
|
|
|
rm "src/magic.h"
|
|
|
|
|
2012-02-15 07:21:57 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--enable-fsect-man5"
|
2009-12-20 22:42:33 +00:00
|
|
|
system "make install"
|
2011-09-02 11:31:58 +00:00
|
|
|
|
2014-01-04 13:08:42 +00:00
|
|
|
cd "python" do
|
|
|
|
system "python", "setup.py", "install", "--prefix=#{prefix}"
|
2013-06-13 16:10:04 +00:00
|
|
|
end
|
|
|
|
|
2012-05-20 20:27:39 +00:00
|
|
|
# Don't dupe this system utility
|
2011-09-02 11:31:58 +00:00
|
|
|
rm bin/"file"
|
|
|
|
rm man1/"file.1"
|
2009-12-20 22:42:33 +00:00
|
|
|
end
|
|
|
|
end
|
2013-01-29 15:56:56 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/src/getline.c b/src/getline.c
|
|
|
|
index e3c41c4..74c314e 100644
|
|
|
|
--- a/src/getline.c
|
|
|
|
+++ b/src/getline.c
|
|
|
|
@@ -76,7 +76,7 @@ getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp)
|
|
|
|
}
|
|
|
|
}
|
2014-02-24 15:11:24 +00:00
|
|
|
|
2013-01-29 15:56:56 +00:00
|
|
|
-ssize_t
|
|
|
|
+public ssize_t
|
|
|
|
getline(char **buf, size_t *bufsiz, FILE *fp)
|
|
|
|
{
|
|
|
|
return getdelim(buf, bufsiz, '\n', fp);
|