class Libgee < Formula desc "Collection library providing GObject-based interfaces" homepage "https://wiki.gnome.org/Projects/Libgee" url "https://download.gnome.org/sources/libgee/0.20/libgee-0.20.1.tar.xz" sha256 "bb2802d29a518e8c6d2992884691f06ccfcc25792a5686178575c7111fea4630" bottle do cellar :any sha256 "ccf7c9df7b20315d949fdf91addc28944f0460033938b36e975070461a5bbf67" => :high_sierra sha256 "873c75b548cd0fca3d09019618dd90e402aa86671006d5852931d8906644ce23" => :sierra sha256 "c03c87fb2bd8aafdd2e5f8fd1c3a655ced1730c0d525a4fd369b063e2a29821c" => :el_capitan end depends_on "pkg-config" => :build depends_on "vala" => :build depends_on "gobject-introspection" def install # ensures that the gobject-introspection files remain within the keg inreplace "gee/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", "--prefix=#{prefix}", "--disable-dependency-tracking" system "make", "install" end test do (testpath/"test.c").write <<~EOS #include int main(int argc, char *argv[]) { GType type = gee_traversable_stream_get_type(); return 0; } EOS gettext = Formula["gettext"] glib = Formula["glib"] flags = %W[ -I#{gettext.opt_include} -I#{glib.opt_include}/glib-2.0 -I#{glib.opt_lib}/glib-2.0/include -I#{include}/gee-0.8 -L#{gettext.opt_lib} -L#{glib.opt_lib} -L#{lib} -lgee-0.8 -lglib-2.0 -lgobject-2.0 -lintl ] system ENV.cc, "test.c", "-o", "test", *flags system "./test" end end