70 lines
1.8 KiB
Ruby
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.2.tar.xz"
|
|
sha256 "613014ffcd327b3f6b06aa45cf4bf3adc25cd831f14537c4132880022dda7209"
|
|
|
|
bottle do
|
|
sha256 "88b7886e681bb4edb54934c770947b330d88dd7d0803b2e3475cc34d37d9fa07" => :mojave
|
|
sha256 "857eecf0b18c2e57665537cb77b962629aa2a65930c0c6080f800d667d269488" => :high_sierra
|
|
sha256 "38d0f41048f6cd93bc1f3b86d1507c504b387f97f5d6ba91d27d90cc9b7a4ca6" => :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
|