diff options
| author | Viktor Szakáts | 2015-01-10 14:09:16 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2015-01-10 13:48:11 +0000 |
| commit | 05ddaab9a3566ea72abab3ff05c0c8f0ad510937 (patch) | |
| tree | 1e2b02ee377f4a3893315235d0c39327b3cc66b2 /Library/Formula | |
| parent | 418704c2de985e59079bc3ac79d763be927d2b5c (diff) | |
| download | homebrew-05ddaab9a3566ea72abab3ff05c0c8f0ad510937.tar.bz2 | |
expat: new homepage + head, strict audit with test
Closes #35723.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/expat.rb | 51 |
1 files changed, 45 insertions, 6 deletions
diff --git a/Library/Formula/expat.rb b/Library/Formula/expat.rb index bc348189f..3aebdbc22 100644 --- a/Library/Formula/expat.rb +++ b/Library/Formula/expat.rb @@ -1,11 +1,11 @@ -require 'formula' - class Expat < Formula - homepage 'http://expat.sourceforge.net/' - url 'https://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz' - sha1 'b08197d146930a5543a7b99e871cba3da614f6f0' + homepage "http://www.libexpat.org" + url "https://downloads.sourceforge.net/project/expat/expat/2.1.0/expat-2.1.0.tar.gz" + sha1 "b08197d146930a5543a7b99e871cba3da614f6f0" revision 1 + head ":pserver:anonymous:@expat.cvs.sourceforge.net:/cvsroot/expat", :using => :cvs + bottle do cellar :any sha1 "94e147c1dd1016c67b5b6dad727b36cd64e9d210" => :yosemite @@ -22,6 +22,45 @@ class Expat < Formula system "./configure", "--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}", "--mandir=#{man}" - system "make install" + system "make", "install" + end + + test do + (testpath/"test.c").write <<-EOS.undent + #include <stdio.h> + #include "expat.h" + + static void XMLCALL my_StartElementHandler( + void *userdata, + const XML_Char *name, + const XML_Char **atts) + { + printf("tag:%s|", name); + } + + static void XMLCALL my_CharacterDataHandler( + void *userdata, + const XML_Char *s, + int len) + { + printf("data:%.*s|", len, s); + } + + int main() + { + static const char str[] = "<str>Hello, world!</str>"; + int result; + + XML_Parser parser = XML_ParserCreate("utf-8"); + XML_SetElementHandler(parser, my_StartElementHandler, NULL); + XML_SetCharacterDataHandler(parser, my_CharacterDataHandler); + result = XML_Parse(parser, str, sizeof(str), 1); + XML_ParserFree(parser); + + return result; + } + EOS + system ENV.cc, "test.c", "-lexpat", "-o", "test" + assert_equal "tag:str|data:Hello, world!|", shell_output("./test") end end |
