d837df22f3
Add patch that removes extra bitwise OR in MAGIC_NO_CHECK_BUILTIN macro definition. This corrects quite incorrect code and will make some more stricter versions of cpp (C preprocessor) reporting an error during parsing. I will also address possible problem with Go's cgo breaking on OS X (Darwin). Signed-off-by: Krzysztof Wilczynski <krzysztof.wilczynski@linux.com> Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
62 lines
1.5 KiB
Ruby
62 lines
1.5 KiB
Ruby
require 'formula'
|
|
|
|
class Libmagic < Formula
|
|
homepage 'http://www.darwinsys.com/file/'
|
|
url 'ftp://ftp.astron.com/pub/file/file-5.14.tar.gz'
|
|
mirror 'http://fossies.org/unix/misc/file-5.14.tar.gz'
|
|
sha1 '064c8f17a5f7ae1e336a9285131e046d3b2d04d7'
|
|
|
|
option :universal
|
|
|
|
depends_on :python => :optional
|
|
|
|
# Fixed upstream, should be in next release
|
|
# See http://bugs.gw.com/view.php?id=230
|
|
def patches
|
|
p = []
|
|
p << DATA if MacOS.version < :lion
|
|
# Fixes generaly incorrect code, plus issues with certain
|
|
# versions of cpp.
|
|
p << 'https://gist.github.com/kwilczynski/6108866/raw/15d1f0a2dba5da23e820b503e8551346a4d235eb/file-5.14.diff'
|
|
end
|
|
|
|
def install
|
|
ENV.universal_binary if build.universal?
|
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--prefix=#{prefix}",
|
|
"--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__
|
|
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)
|
|
}
|
|
}
|
|
|
|
-ssize_t
|
|
+public ssize_t
|
|
getline(char **buf, size_t *bufsiz, FILE *fp)
|
|
{
|
|
return getdelim(buf, bufsiz, '\n', fp);
|