class Gmime < Formula desc "MIME mail utilities" homepage "https://spruce.sourceforge.io/gmime/" url "https://download.gnome.org/sources/gmime/3.2/gmime-3.2.0.tar.xz" sha256 "75ec6033f9192488ff37745792c107b3d0ab0a36c2d3e4f732901a771755d7e0" revision 1 bottle do sha256 "4cefcf587984cfb905ec956527479f3b081bfb750ebec54a5ca074edc26333cc" => :high_sierra sha256 "910361d5b4bc083a5365a366a3d9f39fe96ca6e9e78bd88bc4a6fdaeac634d14" => :sierra sha256 "a2a9001ff723c5766ae4761c5b0553d7d6d5fb54c09cdb4154d659c3bbb614f8" => :el_capitan end depends_on "gobject-introspection" => :build depends_on "pkg-config" => :build depends_on "glib" depends_on "gpgme" def install args = %W[ --disable-dependency-tracking --prefix=#{prefix} --enable-largefile --disable-vala --disable-glibtest --enable-crypto --enable-introspection ] system "./configure", *args system "make", "install" end test do (testpath/"test.c").write <<~EOS #include #include int main (int argc, char **argv) { g_mime_init(); if (gmime_major_version>=3) { return 0; } else { return 1; } } EOS gettext = Formula["gettext"] glib = Formula["glib"] 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}/gmime-3.0 -I#{pcre.opt_include} -D_REENTRANT -L#{gettext.opt_lib} -L#{glib.opt_lib} -L#{lib} -lgio-2.0 -lglib-2.0 -lgmime-3.0 -lgobject-2.0 -lintl ] system ENV.cc, "-o", "test", "test.c", *flags system "./test" end end