class Libsoup < Formula desc "HTTP client/server library for GNOME" homepage "https://live.gnome.org/LibSoup" url "https://download.gnome.org/sources/libsoup/2.54/libsoup-2.54.1.tar.xz" sha256 "47b42c232034734d66e5f093025843a5d8cc4b2357c011085a2fd04ef02dd633" bottle do sha256 "0c66d84be8f6026c0994d7d480ec25e36caf8f9ba281915be949349fb08c5ba3" => :sierra sha256 "2c80bed91542ec201d048111f191d1d587c11a891b535a7e5829f65c58f61fa6" => :el_capitan sha256 "1cf828bf708c7ecad96eaa47c8669aca22995d9587113be10639ef4fda4f8c61" => :yosemite sha256 "d3be03abe735a36ab28fdcf1bbd9a98d5be013ed8ed2b4d52ba566183aab03d4" => :mavericks end depends_on "pkg-config" => :build depends_on "intltool" => :build depends_on "glib-networking" depends_on "gnutls" depends_on "sqlite" depends_on "gobject-introspection" 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.undent #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 -lintl -lsoup-2.4 ] system ENV.cc, "test.c", "-o", "test", *flags system "./test" end end