82 lines
2.9 KiB
Ruby
82 lines
2.9 KiB
Ruby
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.40.tar.xz"
|
|
sha256 "cdde80d15a49dab9a614ef98f804c8ce6e4cfe1339a3c240c34f3fb45436b85d"
|
|
license all_of: ["LGPL-3.0-or-later", "GPL-3.0-or-later", "BSD-3-Clause", "MIT"]
|
|
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: "6baf08d6460d2afd684a862abbf94085f1b36472e7bcd0b01019af119520e0d3"
|
|
sha256 arm64_big_sur: "8531f1b68c977713321eac2a0d21cd904fe6652656be7b2bc019d655f31c97f6"
|
|
sha256 monterey: "31616246ea13a143b9e77fcb280b9d26bea1987b00ed8e9e04f41bd4efb40e47"
|
|
sha256 big_sur: "4f6f9d4a5c6cc11cc65a3bb56f135e8029e20ed46fea8ea33e89c622df261f49"
|
|
sha256 catalina: "c712e1d83e2174a9cd33b64997fa25d2ddaf38bd98e504a9a662709443bbcf7f"
|
|
sha256 x86_64_linux: "e6ce196bd236b3d492aefa75c05045188a533404eee902a116b7d355fda3c6f9"
|
|
end
|
|
|
|
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
|
|
|
|
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 <gegl.h>
|
|
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
|