homebrew-core/Formula/gmime.rb
2018-11-27 09:42:35 +01:00

70 lines
1.8 KiB
Ruby

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.3.tar.xz"
sha256 "6a0875eeb552ab447dd54853a68ced62217d863631048737dd97eaa2713e7311"
bottle do
sha256 "26dc02bb2c06eff3a4295cec5877568c6094e11f40cf38aff16c25a1b2ddfcd3" => :mojave
sha256 "056637f08f6bad4727245daf1edb7d8a87bc2c2ca46950b3d3881b39e850056b" => :high_sierra
sha256 "1dfa791ca0aeeb1b32f1315d84ea2e68f5a65a2c686acc1d1d6a3b97663f57d4" => :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 <stdio.h>
#include <gmime/gmime.h>
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