73 lines
1.9 KiB
Ruby
73 lines
1.9 KiB
Ruby
class Gmime < Formula
|
|
desc "MIME mail utilities"
|
|
homepage "https://spruce.sourceforge.io/gmime/"
|
|
url "https://download.gnome.org/sources/gmime/3.0/gmime-3.0.4.tar.xz"
|
|
sha256 "b67f9b76925644afed4ad2347402b748fc279fcfe87d73f3fd816b3f991942c8"
|
|
|
|
bottle do
|
|
sha256 "9723c2df92b57a0e845570e2872f9188c9225105c3b90eacc5408b52cd3976ea" => :high_sierra
|
|
sha256 "e19f6e111f0de0ad28f05c546a3f5a0f04f866a3e8ffd45f4de3801e6158ca08" => :sierra
|
|
sha256 "ce5bed69232616abf9dae1eae54d6d80fdd0f398af396f10678948640d6c2881" => :el_capitan
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "gobject-introspection" => :recommended
|
|
depends_on "glib"
|
|
|
|
def install
|
|
args = %W[
|
|
--disable-dependency-tracking
|
|
--prefix=#{prefix}
|
|
--enable-largefile
|
|
--disable-vala
|
|
--disable-glibtest
|
|
]
|
|
|
|
if build.with? "gobject-introspection"
|
|
args << "--enable-introspection"
|
|
else
|
|
args << "--disable-introspection"
|
|
end
|
|
|
|
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
|