71 lines
2.2 KiB
Ruby
71 lines
2.2 KiB
Ruby
class Libxmlxx < Formula
|
|
desc "C++ wrapper for libxml"
|
|
homepage "http://libxmlplusplus.sourceforge.net"
|
|
url "https://download.gnome.org/sources/libxml++/2.40/libxml++-2.40.0.tar.xz"
|
|
sha256 "a7b9703203696972cae50436e150979ef187d9b03c95519bdd89623b4068162a"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "d571c8ca1855776bf6225caadf3934c13a71b3e127391182a23eff2f2b9d445b" => :el_capitan
|
|
sha256 "c9593a976101711fe8d6f73b8ebfa67533efec340b5623b1561b960c950a50a8" => :yosemite
|
|
sha256 "a79e800605c8f7d1b929ad3f525a3715c1b9f83154166bff59dfb026f654dee0" => :mavericks
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "glibmm"
|
|
# LibXML++ can't compile agains the version of LibXML shipped with Leopard
|
|
depends_on "libxml2" if MacOS.version <= :leopard
|
|
|
|
needs :cxx11
|
|
|
|
def install
|
|
ENV.cxx11
|
|
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
#include <libxml++/libxml++.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
xmlpp::Document document;
|
|
document.set_internal_subset("homebrew", "", "http://www.brew.sh/xml/test.dtd");
|
|
xmlpp::Element *rootnode = document.create_root_node("homebrew");
|
|
return 0;
|
|
}
|
|
EOS
|
|
ENV.libxml2
|
|
gettext = Formula["gettext"]
|
|
glib = Formula["glib"]
|
|
glibmm = Formula["glibmm"]
|
|
libsigcxx = Formula["libsigc++"]
|
|
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
|
|
flags += %W[
|
|
-I#{gettext.opt_include}
|
|
-I#{glib.opt_include}/glib-2.0
|
|
-I#{glib.opt_lib}/glib-2.0/include
|
|
-I#{glibmm.opt_include}/glibmm-2.4
|
|
-I#{glibmm.opt_lib}/glibmm-2.4/include
|
|
-I#{include}/libxml++-2.6
|
|
-I#{libsigcxx.opt_include}/sigc++-2.0
|
|
-I#{libsigcxx.opt_lib}/sigc++-2.0/include
|
|
-I#{lib}/libxml++-2.6/include
|
|
-L#{gettext.opt_lib}
|
|
-L#{glib.opt_lib}
|
|
-L#{glibmm.opt_lib}
|
|
-L#{libsigcxx.opt_lib}
|
|
-L#{lib}
|
|
-lglib-2.0
|
|
-lglibmm-2.4
|
|
-lgobject-2.0
|
|
-lintl
|
|
-lsigc-2.0
|
|
-lxml++-2.6
|
|
-lxml2
|
|
]
|
|
system ENV.cxx, "-std=c++11", "test.cpp", "-o", "test", *flags
|
|
system "./test"
|
|
end
|
|
end
|