class Gegl < Formula desc "Graph based image processing framework" homepage "http://www.gegl.org/" url "https://download.gimp.org/pub/gegl/0.3/gegl-0.3.34.tar.bz2" sha256 "5ca2227655ebf1ab2e252cee3eede219c758336394288ef301b93264b9411304" bottle do sha256 "09f29798f78a11c4e6b5813e955879e3af62bfad0904c982cc7f7f01519f816a" => :high_sierra sha256 "f09063b27a891d9eaa8620fae6796109ce6c5a119e25887af781d2fad0604e02" => :sierra sha256 "4592f2a5042fba0873e36dd54fa3f152b1df15df86fa1f308c01ea4184c2773c" => :el_capitan end head do # Use the Github mirror because official git unreliable. url "https://github.com/GNOME/gegl.git" depends_on "automake" => :build depends_on "autoconf" => :build depends_on "libtool" => :build end depends_on "intltool" => :build depends_on "pkg-config" => :build depends_on "babl" depends_on "gettext" depends_on "glib" depends_on "jpeg" depends_on "json-glib" depends_on "libpng" depends_on "cairo" => :optional depends_on "librsvg" => :optional depends_on "lua" => :optional depends_on "pango" => :optional depends_on "sdl" => :optional conflicts_with "coreutils", :because => "both install `gcut` binaries" def install args = %W[ --disable-debug --disable-dependency-tracking --prefix=#{prefix} --disable-docs --without-jasper --without-umfpack ] args << "--without-cairo" if build.without? "cairo" system "./autogen.sh" if build.head? system "./configure", *args system "make", "install" end test do (testpath/"test.c").write <<~EOS #include gint main(gint argc, gchar **argv) { gegl_init(&argc, &argv); GeglNode *gegl = gegl_node_new (); gegl_exit(); return 0; } EOS system ENV.cc, "-I#{include}/gegl-0.3", "-L#{lib}", "-lgegl-0.3", "-I#{Formula["babl"].opt_include}/babl-0.1", "-I#{Formula["glib"].opt_include}/glib-2.0", "-I#{Formula["glib"].opt_lib}/glib-2.0/include", "-L#{Formula["glib"].opt_lib}", "-lgobject-2.0", "-lglib-2.0", testpath/"test.c", "-o", testpath/"test" system "./test" end end