class Libsoup < Formula desc "HTTP client/server library for GNOME" homepage "https://wiki.gnome.org/Projects/libsoup" url "https://download.gnome.org/sources/libsoup/2.64/libsoup-2.64.0.tar.xz" sha256 "d95bc9602c97ec805d80e5ddf75605665c4c4d6b2c56893c416e707ef578e727" bottle do sha256 "69352931117cbf3fb98df53d69a6a60aeb9c08fae92536980c178136a1918935" => :mojave sha256 "37a32b97001f01a4d1e8542c74dd031fe92addceb959e65900fcbe8379c999a1" => :high_sierra sha256 "1702a60563bdbbe14a3c6d933db84f378fd5ea8d3abd3d104ada158fa5be9e32" => :sierra sha256 "5ba5cd11f1ece1a3c8bf66edf1e02e985fa48e0c602e5222756717d1a12f6eb4" => :el_capitan end depends_on "gobject-introspection" => :build depends_on "intltool" => :build depends_on "pkg-config" => :build depends_on "python" => :build depends_on "glib-networking" depends_on "gnutls" depends_on "libpsl" depends_on "vala" def install args = %W[ --disable-debug --disable-dependency-tracking --disable-silent-rules --prefix=#{prefix} --disable-tls-check --enable-introspection=yes ] # ensures that the vala files remain within the keg inreplace "libsoup/Makefile.in", "VAPIDIR = @VAPIDIR@", "VAPIDIR = @datadir@/vala/vapi" system "./configure", *args system "make", "install" end test do (testpath/"test.c").write <<~EOS #include int main(int argc, char *argv[]) { guint version = soup_get_major_version(); return 0; } EOS ENV.libxml2 gettext = Formula["gettext"] glib = Formula["glib"] flags = %W[ -I#{gettext.opt_include} -I#{glib.opt_include}/glib-2.0 -I#{glib.opt_lib}/glib-2.0/include -I#{include}/libsoup-2.4 -D_REENTRANT -L#{gettext.opt_lib} -L#{glib.opt_lib} -L#{lib} -lgio-2.0 -lglib-2.0 -lgobject-2.0 -lsoup-2.4 ] system ENV.cc, "test.c", "-o", "test", *flags system "./test" end end