libxml++@4 4.0.0 (new formula)
parent
cf8262255b
commit
8f8b0514e6
|
@ -0,0 +1,45 @@
|
||||||
|
class LibxmlxxAT4 < Formula
|
||||||
|
desc "C++ wrapper for libxml"
|
||||||
|
homepage "https://libxmlplusplus.sourceforge.io/"
|
||||||
|
url "https://download.gnome.org/sources/libxml++/4.0/libxml++-4.0.0.tar.xz"
|
||||||
|
sha256 "4f26b5fdb9ebd91e440d60343ac82400f88287facedc7e81b95f23d002f8049f"
|
||||||
|
license "LGPL-2.1-or-later"
|
||||||
|
|
||||||
|
livecheck do
|
||||||
|
url :stable
|
||||||
|
end
|
||||||
|
|
||||||
|
depends_on "meson" => :build
|
||||||
|
depends_on "ninja" => :build
|
||||||
|
depends_on "pkg-config" => [:build, :test]
|
||||||
|
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
|
||||||
|
command = "#{Formula["pkg-config"].opt_bin}/pkg-config --cflags --libs libxml++-4.0"
|
||||||
|
flags = shell_output(command).strip.split
|
||||||
|
system ENV.cxx, "-std=c++17", "test.cpp", "-o", "test", *flags
|
||||||
|
system "./test"
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue