homebrew-core/Formula/gegl.rb
2018-01-23 23:47:44 -08:00

65 lines
2.1 KiB
Ruby

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.28.tar.bz2"
sha256 "152f87604a5a191775329dfb63764efa1d5c32403d1438da68e242f96b7d23ff"
bottle do
sha256 "7580d3d2bbe103eaf350960b8a22ce5f63c8c029bab9dd861ca0fbf89376dd6d" => :high_sierra
sha256 "135f49765e4f34b06f8dbac9a84a7d35f53846fe009a8389564f0b33ce0d5d4e" => :sierra
sha256 "9e5f682bba155c4e95dd04cf42af1a4d7d59081e05007e4fc58ae465bdbab4ee" => :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 "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
conflicts_with "coreutils", :because => "both install `gcut` binaries"
def install
system "./autogen.sh" if build.head?
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--disable-docs"
system "make", "install"
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#{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