class Gegl < Formula desc "Graph based image processing framework" homepage "https://www.gegl.org/" url "https://download.gimp.org/pub/gegl/0.4/gegl-0.4.38.tar.xz" sha256 "e4a33c8430a5042fba8439b595348e71870f0d95fbf885ff553f9020c1bed750" license all_of: ["LGPL-3.0-or-later", "GPL-3.0-or-later", "BSD-3-Clause", "MIT"] revision 1 head "https://gitlab.gnome.org/GNOME/gegl.git", branch: "master" livecheck do url "https://download.gimp.org/pub/gegl/0.4/" regex(/href=.*?gegl[._-]v?(\d+(?:\.\d+)+)\.t/i) end bottle do sha256 arm64_monterey: "7fae228b7235df79ae243066dce988aa02e28a4d5c3db84aa6686343cdef4c32" sha256 arm64_big_sur: "7840f644358bc9699b1f3e74b419b6de9668aad1c97cc7a4b6e86ea996f2b835" sha256 monterey: "0eeb4fe4db2b41db4dedd32abdeb0003dbce3215798f72be16e78962b14ad11f" sha256 big_sur: "c97d5001f52ab54f4e98e18db02e3e795420f1c16ef753a7ef8f209201ef5af0" sha256 catalina: "f3d7aecfadaf13afb9d14760b3f259b6b8b914a37a315f1d4d2689eba2089e21" sha256 x86_64_linux: "e23c8d7d4fe6608c4020dfac1323994d7d3c352950b8d507e0315f9e9db6e675" end depends_on "glib-utils" => :build depends_on "gobject-introspection" => :build depends_on "meson" => :build depends_on "ninja" => :build depends_on "pkg-config" => :build depends_on "python@3.10" => :build depends_on "babl" depends_on "gettext" depends_on "glib" depends_on "jpeg-turbo" depends_on "json-glib" depends_on "libpng" on_linux do depends_on "cairo" end conflicts_with "coreutils", because: "both install `gcut` binaries" def install ### Temporary Fix ### # Temporary fix for a meson bug # Upstream appears to still be deciding on a permanent fix # See: https://gitlab.gnome.org/GNOME/gegl/-/issues/214 inreplace "subprojects/poly2tri-c/meson.build", "libpoly2tri_c = static_library('poly2tri-c',", "libpoly2tri_c = static_library('poly2tri-c', 'EMPTYFILE.c'," touch "subprojects/poly2tri-c/EMPTYFILE.c" ### END Temporary Fix ### system "meson", *std_meson_args, "build", "-Ddocs=false", "-Dcairo=disabled", "-Djasper=disabled", "-Dumfpack=disabled", "-Dlibspiro=disabled", "--force-fallback-for=libnsgif,poly2tri-c" system "meson", "compile", "-C", "build", "-v" system "meson", "install", "-C", "build" 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#{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", "-I#{include}/gegl-0.4", "-L#{lib}", "-lgegl-0.4", "-o", testpath/"test" system "./test" end end