class Libgsf < Formula desc "I/O abstraction library for dealing with structured file formats" homepage "https://developer.gnome.org/gsf/" url "https://download.gnome.org/sources/libgsf/1.14/libgsf-1.14.43.tar.xz" sha256 "12944e3d6d9a6e4071e89dbf58348e1e93544f5f9266dd1a107a28d8001cee16" bottle do sha256 "31ec48d4eb908d85fda219299f442548997ce4600a5d46dab0889dbbe2a37097" => :high_sierra sha256 "7c7ca0aae4be13b4f7a12fcdf6cfa528ff10de2b67c477246123e88e4aaac78b" => :sierra sha256 "625687aaed0be8749b5bfd39160e760cecd8fe7fe51ecc24b60dcf32d620f91a" => :el_capitan end head do url "https://github.com/GNOME/libgsf.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "gtk-doc" => :build depends_on "libtool" => :build end depends_on "intltool" => :build depends_on "pkg-config" => :build depends_on "gettext" depends_on "glib" depends_on "gdk-pixbuf" => :optional def install args = %W[--disable-dependency-tracking --prefix=#{prefix}] if build.head? system "./autogen.sh", *args else system "./configure", *args end system "make", "install" end test do system bin/"gsf", "--help" (testpath/"test.c").write <<~EOS #include int main() { void gsf_init (void); return 0; } EOS system ENV.cc, "-I#{include}/libgsf-1", "-I#{Formula["glib"].opt_include}/glib-2.0", "-I#{Formula["glib"].opt_lib}/glib-2.0/include", testpath/"test.c", "-o", testpath/"test" system "./test" end end