80 lines
2.3 KiB
Ruby
80 lines
2.3 KiB
Ruby
class Libxmlxx < Formula
|
|
desc "C++ wrapper for libxml"
|
|
homepage "https://libxmlplusplus.sourceforge.io/"
|
|
url "https://download.gnome.org/sources/libxml++/2.42/libxml++-2.42.0.tar.xz"
|
|
sha256 "3d032aede98a033eb5e815b4bfa9fa7b4e745268e6fd1ce8b1d0f70bcaf4736d"
|
|
|
|
livecheck do
|
|
url :stable
|
|
regex(/libxml\+\+[._-]v?(2\.([0-8]\d*?)?[02468](?:\.\d+)*?)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "b92ab23258790a9bb0115744633a3c372cf59b86bf2042b8d8d5457eba2601d2" => :big_sur
|
|
sha256 "f5b8f697892387b87646ac198dfaeecd9b1d1eefcd51712d684637ebc845a056" => :catalina
|
|
sha256 "2492b194287cbec5e9a0f097decd35d097a8d1bba6779ba82931baef742a4f98" => :mojave
|
|
sha256 "121d5cb75e6fa0bdd5e227d42b2ece3be8f0c28ab8ad9eb11bf1bc7a81fee4ad" => :high_sierra
|
|
end
|
|
|
|
depends_on "meson" => :build
|
|
depends_on "ninja" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "glibmm"
|
|
|
|
uses_from_macos "libxml2"
|
|
|
|
def install
|
|
ENV.cxx11
|
|
mkdir "build" do
|
|
system "meson", *std_meson_args, ".."
|
|
system "ninja"
|
|
system "ninja", "install"
|
|
end
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.cpp").write <<~EOS
|
|
#include <libxml++/libxml++.h>
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
xmlpp::Document document;
|
|
document.set_internal_subset("homebrew", "", "https://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++@2"]
|
|
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
|