70 lines
2.4 KiB
Ruby
70 lines
2.4 KiB
Ruby
class GlibNetworking < Formula
|
|
desc "Network related modules for glib"
|
|
homepage "https://launchpad.net/glib-networking"
|
|
url "https://download.gnome.org/sources/glib-networking/2.54/glib-networking-2.54.1.tar.xz"
|
|
sha256 "eaa787b653015a0de31c928e9a17eb57b4ce23c8cf6f277afaec0d685335012f"
|
|
|
|
bottle do
|
|
sha256 "656488bcc70e2347d705dfc32ef38952088c8d7a2279766e139c19485c5d87aa" => :high_sierra
|
|
sha256 "7afca55538868826fd196e670de31a16740efb44490f1633c57d49ac1ac3c7c3" => :sierra
|
|
sha256 "4ef4b72f13a2f5c83e63c7594b2a643ca93f5f141b90554a70bc7f8532af5070" => :el_capitan
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "intltool" => :build
|
|
depends_on "gettext"
|
|
depends_on "glib"
|
|
depends_on "gnutls"
|
|
depends_on "gsettings-desktop-schemas"
|
|
|
|
link_overwrite "lib/gio/modules"
|
|
|
|
def install
|
|
# Install files to `lib` instead of `HOMEBREW_PREFIX/lib`.
|
|
inreplace "configure", "$($PKG_CONFIG --variable giomoduledir gio-2.0)", lib/"gio/modules"
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--prefix=#{prefix}",
|
|
"--with-ca-certificates=#{etc}/openssl/cert.pem",
|
|
# Remove when p11-kit >= 0.20.7 builds on OSX
|
|
# see https://github.com/Homebrew/homebrew/issues/36323
|
|
# and https://bugs.freedesktop.org/show_bug.cgi?id=91602
|
|
"--without-pkcs11"
|
|
system "make", "install"
|
|
|
|
# Delete the cache, will regenerate it in post_install
|
|
rm lib/"gio/modules/giomodule.cache"
|
|
end
|
|
|
|
def post_install
|
|
system Formula["glib"].opt_bin/"gio-querymodules", HOMEBREW_PREFIX/"lib/gio/modules"
|
|
end
|
|
|
|
test do
|
|
(testpath/"gtls-test.c").write <<~EOS
|
|
#include <gio/gio.h>
|
|
int main (int argc, char *argv[])
|
|
{
|
|
if (g_tls_backend_supports_tls (g_tls_backend_get_default()))
|
|
return 0;
|
|
else
|
|
return 1;
|
|
}
|
|
EOS
|
|
|
|
# From `pkg-config --cflags --libs gio-2.0`
|
|
flags = [
|
|
"-D_REENTRANT",
|
|
"-I#{HOMEBREW_PREFIX}/include/glib-2.0",
|
|
"-I#{HOMEBREW_PREFIX}/lib/glib-2.0/include",
|
|
"-I#{HOMEBREW_PREFIX}/opt/gettext/include",
|
|
"-L#{HOMEBREW_PREFIX}/lib",
|
|
"-L#{HOMEBREW_PREFIX}/opt/gettext/lib",
|
|
"-lgio-2.0", "-lgobject-2.0", "-lglib-2.0"
|
|
]
|
|
|
|
system ENV.cc, "gtls-test.c", "-o", "gtls-test", *flags
|
|
system "./gtls-test"
|
|
end
|
|
end
|