homebrew-core/Formula/cairo.rb

82 lines
2.3 KiB
Ruby
Raw Normal View History

2011-03-10 05:11:03 +00:00
class Cairo < Formula
desc "Vector graphics library with cross-device output support"
homepage "http://cairographics.org/"
url "http://cairographics.org/releases/cairo-1.14.2.tar.xz"
mirror "http://www.mirrorservice.org/sites/ftp.netbsd.org/pub/pkgsrc/distfiles/cairo-1.14.2.tar.xz"
sha256 "c919d999ddb1bbbecd4bbe65299ca2abd2079c7e13d224577895afa7005ecceb"
revision 1
2010-04-26 16:29:38 +00:00
2015-06-17 15:52:27 +00:00
bottle do
revision 1
sha256 "e2ef211f405af952b5c7e3bed79f3ccc0d24f8e696019e1a8f06df590c557927" => :yosemite
sha256 "448271565335a87d2f153b60d91a9e7289e96c7b20c813539a810c6426643dc4" => :mavericks
sha256 "61e354ed81d9335186a5f8daba4f66f41b9f52c869751ee8a66bb003f23eff9e" => :mountain_lion
end
keg_only :provided_pre_mountain_lion
2012-08-04 09:10:55 +00:00
2012-08-10 04:47:23 +00:00
option :universal
depends_on "pkg-config" => :build
depends_on "freetype"
depends_on "fontconfig"
depends_on "libpng"
depends_on "pixman"
depends_on "glib"
2011-05-10 21:24:49 +00:00
2010-04-26 16:29:38 +00:00
def install
2012-08-10 04:47:23 +00:00
ENV.universal_binary if build.universal?
args = %W[
--disable-dependency-tracking
2012-08-10 04:47:23 +00:00
--prefix=#{prefix}
--enable-gobject=yes
--enable-svg=yes
--enable-tee=yes
--enable-xlib=no
--enable-xlib-xrender=no
--enable-quartz-image
2012-08-10 04:47:23 +00:00
]
args << "--enable-xcb=no" if MacOS.version <= :leopard
system "./configure", *args
system "make", "install"
end
test do
(testpath/"test.c").write <<-EOS.undent
#include <cairo.h>
int main(int argc, char *argv[]) {
cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 600, 400);
cairo_t *context = cairo_create(surface);
return 0;
}
EOS
fontconfig = Formula["fontconfig"]
freetype = Formula["freetype"]
gettext = Formula["gettext"]
glib = Formula["glib"]
libpng = Formula["libpng"]
pixman = Formula["pixman"]
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
flags += %W[
-I#{fontconfig.opt_include}
-I#{freetype.opt_include}/freetype2
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{include}/cairo
-I#{libpng.opt_include}/libpng16
-I#{pixman.opt_include}/pixman-1
-L#{lib}
-lcairo
]
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
2010-04-26 16:29:38 +00:00
end
end