Skip to content

Commit

Permalink
gxml 0.6.0 (new formula)
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#43715.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
  • Loading branch information
tschoonj authored and DomT4 committed Sep 14, 2015
1 parent d69ae61 commit 2d7e830
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions Formula/gxml.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
class Gxml < Formula
desc "GObject-based XML DOM API"
homepage "https://wiki.gnome.org/GXml"
url "https://download.gnome.org/sources/gxml/0.6/gxml-0.6.0.tar.xz"
sha256 "50f5e1b691fcc2994264565bcbfa4cfcd386bd01ea98c9fbec3ae4ec66ce7fc8"

depends_on "pkg-config" => :build
depends_on "intltool" => :build
depends_on "vala" => :build
# gnu-sed dependency to be removed when 0.6.1 is released
# usage here circumvents a bug in gxml when using Mac OS X's sed
depends_on "gnu-sed" => :build
depends_on "libxml2"
depends_on "glib"
depends_on "libgee"
depends_on "gobject-introspection"

def install
# ensures that the gobject-introspection files remain within the keg
inreplace "gxml/Makefile.in" do |s|
s.gsub! "@HAVE_INTROSPECTION_TRUE@girdir = $(INTROSPECTION_GIRDIR)",
"@HAVE_INTROSPECTION_TRUE@girdir = $(datadir)/gir-1.0"
s.gsub! "@HAVE_INTROSPECTION_TRUE@typelibdir = $(INTROSPECTION_TYPELIBDIR)",
"@HAVE_INTROSPECTION_TRUE@typelibdir = $(libdir)/girepository-1.0"
end

system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--disable-silent-rules",
"--prefix=#{prefix}",
"--disable-schemas-compile"
system "make", "install"
end

def post_install
system "#{Formula["glib"].opt_bin}/glib-compile-schemas", "#{HOMEBREW_PREFIX}/share/glib-2.0/schemas"
end

test do
(testpath/"test.c").write <<-EOS.undent
#include <gxml/gxml.h>
int main(int argc, char *argv[]) {
GType type = gxml_document_get_type();
return 0;
}
EOS
ENV.libxml2
gettext = Formula["gettext"]
glib = Formula["glib"]
libgee = Formula["libgee"]
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#{include}/gxml-0.6
-I#{libgee.opt_include}/gee-0.8
-D_REENTRANT
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{libgee.opt_lib}
-L#{lib}
-lgee-0.8
-lgio-2.0
-lglib-2.0
-lgobject-2.0
-lgxml-0.6
-lintl
-lxml2
]
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end

0 comments on commit 2d7e830

Please sign in to comment.