homebrew-core/Formula/libgdata.rb

85 lines
2.4 KiB
Ruby

class Libgdata < Formula
desc "GLib-based library for accessing online service APIs"
homepage "https://wiki.gnome.org/Projects/libgdata"
url "https://download.gnome.org/sources/libgdata/0.18/libgdata-0.18.1.tar.xz"
sha256 "dd8592eeb6512ad0a8cf5c8be8c72e76f74bfe6b23e4dd93f0756ee0716804c7"
license "LGPL-2.1-or-later"
bottle do
sha256 cellar: :any, arm64_big_sur: "f890b86a1e19fe8c0135094bc869356a6dc6279d84e6267742d2f817994c9708"
sha256 cellar: :any, big_sur: "6afaf2089a648f7c81ceff2e491ab3c059fbe751a521f2756a124f3b64135d18"
sha256 cellar: :any, catalina: "5b6500481c8f15817ecf307b1ab9886fb0caffcd133445ec0cdd06c6bcc605e2"
sha256 cellar: :any, mojave: "0ab77d93d64a4257bd46de5d29543057d050a14aa4bc603ffa79c5e9f99695a4"
end
depends_on "gobject-introspection" => :build
depends_on "intltool" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "vala" => :build
depends_on "gtk+3"
depends_on "json-glib"
depends_on "liboauth"
depends_on "libsoup"
def install
mkdir "build" do
system "meson", *std_meson_args,
"-Dintrospection=true",
"-Doauth1=enabled",
"-Dalways_build_tests=false",
"-Dvapi=true",
"-Dgtk=enabled",
"-Dgoa=disabled",
"-Dgnome=disabled",
".."
system "ninja"
system "ninja", "install"
end
end
test do
(testpath/"test.c").write <<~EOS
#include <gdata/gdata.h>
int main(int argc, char *argv[]) {
GType type = gdata_comment_get_type();
return 0;
}
EOS
ENV.libxml2
gettext = Formula["gettext"]
glib = Formula["glib"]
json_glib = Formula["json-glib"]
liboauth = Formula["liboauth"]
libsoup = Formula["libsoup"]
flags = %W[
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{include}/libgdata
-I#{json_glib.opt_include}/json-glib-1.0
-I#{liboauth.opt_include}
-I#{libsoup.opt_include}/libsoup-2.4
-I#{MacOS.sdk_path}/usr/include/libxml2
-D_REENTRANT
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{json_glib.opt_lib}
-L#{libsoup.opt_lib}
-L#{lib}
-lgdata
-lgio-2.0
-lglib-2.0
-lgobject-2.0
-lintl
-ljson-glib-1.0
-lsoup-2.4
-lxml2
]
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end