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.2.tar.bz2" mirror "https://mirrors.kernel.org/debian/pool/main/g/gegl/gegl_0.3.2.orig.tar.bz2" sha256 "b82f6e07e977dd7c2b6e671e9e029614840a66f0ca58defb22c0b05ed3ea485c" bottle do sha256 "e6157482182136921a74d91cf0c1cd20a175f770673734622abade0a7d271841" => :el_capitan sha256 "093c3c55e4bddd0ff6ad5cb9add9dd8329ca785570da41e147b08288a05fcdad" => :yosemite sha256 "2badf07d3e4f8d992c93ad2924e2d1c26bab1329c49678488b197dcb31f93016" => :mavericks 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 option :universal depends_on "intltool" => :build depends_on "pkg-config" => :build depends_on "babl" depends_on "gettext" depends_on "glib" depends_on "json-glib" depends_on "libpng" depends_on "jpeg" depends_on "cairo" => :optional depends_on "librsvg" => :optional depends_on "lua" => :optional depends_on "pango" => :optional depends_on "sdl" => :optional def install # ./configure breaks when optimization is enabled with llvm ENV.no_optimization if ENV.compiler == :llvm argv = %W[ --disable-debug --disable-dependency-tracking --prefix=#{prefix} --disable-docs ] if build.universal? ENV.universal_binary # ffmpeg's formula is currently not universal-enabled argv << "--without-libavformat" opoo "Compilation may fail at gegl-cpuaccel.c using gcc for a universal build" if ENV.compiler == :gcc end system "./autogen.sh" if build.head? system "./configure", *argv system "make", "install" end test do (testpath/"test.c").write <<-EOS.undent #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