59 lines
1.7 KiB
Ruby
59 lines
1.7 KiB
Ruby
class XercesC < Formula
|
|
desc "Validating XML parser"
|
|
homepage "https://xerces.apache.org/xerces-c/"
|
|
url "https://www.apache.org/dyn/closer.lua?path=xerces/c/3/sources/xerces-c-3.2.3.tar.gz"
|
|
mirror "https://archive.apache.org/dist/xerces/c/3/sources/xerces-c-3.2.3.tar.gz"
|
|
sha256 "fb96fc49b1fb892d1e64e53a6ada8accf6f0e6d30ce0937956ec68d39bd72c7e"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url :stable
|
|
end
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "24e3607a7d969dcf55b9184bb481e7b1fd78bcd9f16239ef8a35c4acb8638a3b" => :big_sur
|
|
sha256 "8bcfddab9276b6f09c9af5bd8be60d500cd5107795c25495b53ef5e0734ae617" => :catalina
|
|
sha256 "502d34b51931ead6b1db27ca1a71eed465ecd4da5dbdeaa51c0ae77e77dc25ea" => :mojave
|
|
sha256 "8b30ad6819fc3628b706a18193d45b96c13749e7d1e27f5392cf91e48fe7d63b" => :high_sierra
|
|
end
|
|
|
|
depends_on "cmake" => :build
|
|
|
|
uses_from_macos "curl"
|
|
|
|
def install
|
|
ENV.cxx11
|
|
|
|
mkdir "build" do
|
|
system "cmake", "..", *std_cmake_args
|
|
system "make"
|
|
system "ctest", "-V"
|
|
system "make", "install"
|
|
system "make", "clean"
|
|
system "cmake", "..", "-DBUILD_SHARED_LIBS=OFF", *std_cmake_args
|
|
system "make"
|
|
lib.install Dir["src/*.a"]
|
|
end
|
|
# Remove a sample program that conflicts with libmemcached
|
|
# on case-insensitive file systems
|
|
(bin/"MemParse").unlink
|
|
end
|
|
|
|
test do
|
|
(testpath/"ducks.xml").write <<~EOS
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
|
|
<ducks>
|
|
<person id="Red.Duck" >
|
|
<name><family>Duck</family> <given>One</given></name>
|
|
<email>duck@foo.com</email>
|
|
</person>
|
|
</ducks>
|
|
EOS
|
|
|
|
output = shell_output("#{bin}/SAXCount #{testpath}/ducks.xml")
|
|
assert_match "(6 elems, 1 attrs, 0 spaces, 37 chars)", output
|
|
end
|
|
end
|