class GnomeAutoar < Formula desc "GNOME library for archive handling" homepage "https://github.com/GNOME/gnome-autoar" url "https://download.gnome.org/sources/gnome-autoar/0.2/gnome-autoar-0.2.1.tar.xz" sha256 "f642935e9213663c114988403fba26c02e79a644b33cb0e4da0d4aec570fb1fb" revision 1 bottle do sha256 "94421e49840cb95db58c73a2055c6108f26b5e696354eaff3e788a8251a16ccb" => :sierra sha256 "ac9ea02b0ecc34eb1f044434180cf7e4937a840fce91bd76c91b7e52b9534cd1" => :el_capitan sha256 "03d98d38c9e11e71d9a59aeeecc284025afb9533cb697443c9a2ead67c30b766" => :yosemite end depends_on "pkg-config" => :build depends_on "libarchive" depends_on "gtk+3" def install ENV.delete "SDKROOT" system "./configure", "--disable-debug", "--disable-dependency-tracking", "--disable-silent-rules", "--prefix=#{prefix}", "--disable-glibtest", "--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 int main(int argc, char *argv[]) { GType type = autoar_extractor_get_type(); return 0; } EOS gettext = Formula["gettext"] glib = Formula["glib"] libarchive = Formula["libarchive"] pcre = Formula["pcre"] 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}/gnome-autoar-0 -I#{libarchive.opt_include} -I#{pcre.opt_include} -D_REENTRANT -L#{gettext.opt_lib} -L#{glib.opt_lib} -L#{libarchive.opt_lib} -L#{lib} -larchive -lgio-2.0 -lglib-2.0 -lgnome-autoar-0 -lgobject-2.0 -lintl ] system ENV.cc, "test.c", "-o", "test", *flags system "./test" end end