2015-10-30 13:39:22 +00:00
class XalanC < Formula
desc " XSLT processor "
homepage " https://xalan.apache.org/xalan-c/ "
url " https://www.apache.org/dyn/closer.cgi?path=xalan/xalan-c/sources/xalan_c-1.11-src.tar.gz "
sha256 " 4f5e7f75733d72e30a2165f9fdb9371831cf6ff0d1997b1fb64cdd5dc2126a28 "
2015-10-31 18:49:22 +00:00
bottle do
cellar :any
sha256 " 8de91a28a9e22941818185380825eacd950d1420b850e82879204c4a3a1d3152 " = > :el_capitan
sha256 " 9af9e5d0c49ca9307ec41f229cb3fb2b53e7f13cc10b0c033750e7512f3dcf1a " = > :yosemite
sha256 " fcfe6027b7d366f6a2bff783e0ab1e9abfc7c38c1a6fd31fa4a2fb9d325a2819 " = > :mavericks
end
2015-11-02 19:34:31 +00:00
option " with-docs " , " Install HTML docs "
2015-10-30 13:39:22 +00:00
option :universal
2015-11-02 19:34:31 +00:00
if build . with? " docs "
depends_on " doxygen " = > :build
depends_on " graphviz " = > :build
end
2015-10-30 13:39:22 +00:00
depends_on " xerces-c "
2015-11-01 04:46:36 +00:00
# Fix segfault. See https://issues.apache.org/jira/browse/XALANC-751
2015-10-30 13:39:22 +00:00
patch :DATA
def install
ENV . deparallelize # See https://issues.apache.org/jira/browse/XALANC-696
ENV . universal_binary if build . universal?
ENV [ " XALANCROOT " ] = " #{ buildpath } /c "
ENV [ " XALAN_LOCALE_SYSTEM " ] = " inmem "
ENV [ " XALAN_LOCALE " ] = " en_US "
2015-11-01 04:46:36 +00:00
cd " c " do
2015-10-30 13:39:22 +00:00
system " ./configure " , " --disable-dependency-tracking " ,
" --disable-silent-rules " ,
" --prefix= #{ prefix } "
system " make " , " install "
2015-11-02 19:34:31 +00:00
if build . with? " docs "
ENV . prepend_path " PATH " , " #{ buildpath } /c/bin "
cd " xdocs " do
# Set the library path in the script which runs Xalan from
# the source tree, or else the libxalan-c.dylib won't be found.
# See https://issues.apache.org/jira/browse/XALANC-766
inreplace " sources/make-xalan.sh " , " \" ${XALANCMD} \" \\ " ,
" export DYLD_FALLBACK_LIBRARY_PATH= #{ buildpath } /c/lib:$DYLD_FALLBACK_LIBRARY_PATH \n \" ${XALANCMD} \" \\ "
system " ./make-apiDocs.sh "
end
( share / " doc " ) . install " build/docs/xalan-c "
end
2015-10-30 13:39:22 +00:00
# Clean up links
rm Dir [ " #{ lib } /*.dylib.* " ]
end
end
test do
( testpath / " input.xml " ) . write <<-EOS.undent
< ? xml version = " 1.0 " ?>
< Article >
< Title > An XSLT test - case < / Title>
< Authors >
< Author > Roger Leigh < / Author>
< Author > Open Microscopy Environment < / Author>
< / Authors>
< Body > This example article is used to verify the functionality
of Xalan - C + + in applying XSLT transforms to XML documents < / Body>
< / Article>
EOS
( testpath / " transform.xsl " ) . write <<-EOS.undent
< ? xml version = " 1.0 " ?>
< xsl : stylesheet version = " 1.0 " xmlns : xsl = " http://www.w3.org/1999/XSL/Transform " >
< xsl : output method = " text " / >
< xsl : template match = " / " > Article : < xsl : value - of select = " /Article/Title " / >
Authors : < xsl : apply - templates select = " /Article/Authors/Author " / >
< / xsl:template>
< xsl : template match = " Author " >
* < xsl : value - of select = " . " / >
< / xsl:template>
< / xsl:stylesheet>
EOS
assert_match " Article: An XSLT test-case \n Authors: \n * Roger Leigh \n * Open Microscopy Environment " , shell_output ( " #{ bin } /Xalan #{ testpath } /input.xml #{ testpath } /transform.xsl " )
end
end
__END__
- - - a / c / src / xalanc / PlatformSupport / XalanLocator . hpp
+ + + b / c / src / xalanc / PlatformSupport / XalanLocator . hpp
@ @ - 91 , 7 + 91 , 7 @ @ public :
const XalanDOMChar * theAlternateId = getEmptyPtr ( ) )
{
return theLocator == 0 ? theAlternateId : ( theLocator - > getSystemId ( ) ?
- theLocator - > getPublicId ( ) : theAlternateId ) ;
+ theLocator - > getSystemId ( ) : theAlternateId ) ;
}
/ **