homebrew-core/Formula/gegl.rb

89 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.32.tar.xz"
sha256 "668e3c6b9faf75fb00512701c36274ab6f22a8ba05ec62dbf187d34b8d298fa1"
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_big_sur: "1c234b2a7dd7fc511b344ccfb34247fb6860b2be0d2b13bc9bc6f1b3e0d0fe9a"
sha256 monterey: "ad90de6673f674f89602495df968193c4a8e6f4e523658b4d72afc01c90ef9a8"
sha256 big_sur: "ae01c735384d081f6a725143afa961815db81cd262b311731b0caf39e393d21e"
sha256 catalina: "56abd3c5b8d1156efac49f97781cb9f96e16de970c61df4eee4d7f086d2b3ba8"
sha256 mojave: "cf5437b07a943809b93c3420f437ad0a1a4b43320e054e25ac6fc1df1ece9c20"
sha256 x86_64_linux: "0eb285b819e60dc969b2fb8ad8b9ece9c5fbfb3359ddee06ad0ff458fe7053c0"
end
depends_on "glib" => :build
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :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"
on_linux do
depends_on "cairo"
end
conflicts_with "coreutils", because: "both install `gcut` binaries"
def install
args = std_meson_args + %w[
-Ddocs=false
-Dcairo=disabled
-Djasper=disabled
-Dumfpack=disabled
-Dlibspiro=disabled
--force-fallback-for=libnsgif,poly2tri-c
]
### 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 ###
mkdir "build" do
system "meson", *args, ".."
system "ninja", "-v"
system "ninja", "install", "-v"
end
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