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.4.tar.xz" sha256 "249ea7c0e080b067aa9669162c36b181b402f6cf6cebc4999d838c6f1e81d024" bottle do sha256 "9ab757062960471c3655f5c80ddb3e40eb506cbef863365b752b8f06a97fb784" => :catalina sha256 "1749b1131157fe9313f53e37bb4f5ce72733ea4cb284ddab6a166249eee18bfe" => :mojave sha256 "6e9e0475bb7f3cf27d0b18d90bccfc008fd74f9a06ff78a9bf1435a1eda027f2" => :high_sierra 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