2011-03-10 05:11:03 +00:00
|
|
|
class Cairo < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Vector graphics library with cross-device output support"
|
2014-10-30 17:02:34 +00:00
|
|
|
homepage "http://cairographics.org/"
|
2015-12-18 15:54:17 +00:00
|
|
|
url "http://cairographics.org/releases/cairo-1.14.6.tar.xz"
|
|
|
|
mirror "https://www.mirrorservice.org/sites/ftp.netbsd.org/pub/pkgsrc/distfiles/cairo-1.14.6.tar.xz"
|
|
|
|
sha256 "613cb38447b76a93ff7235e17acd55a78b52ea84a9df128c3f2257f8eaa7b252"
|
2016-02-15 09:53:11 +00:00
|
|
|
revision 1
|
2010-04-26 16:29:38 +00:00
|
|
|
|
2015-06-17 15:52:27 +00:00
|
|
|
bottle do
|
2016-02-15 18:08:20 +00:00
|
|
|
sha256 "dd4dc801ee427ca2d2305403cacf747a51b58d80a2cd2ebf20a9623229830278" => :el_capitan
|
|
|
|
sha256 "3ac3b4af558425ff4c3a9799bfb24ab70e41210d63323195db4a5e6feb790497" => :yosemite
|
|
|
|
sha256 "15ec1a777186dc6af988c9d1de94449ce730ec64a1588d63f3a1b95222d75a8d" => :mavericks
|
2015-06-17 15:52:27 +00:00
|
|
|
end
|
|
|
|
|
2016-02-25 16:01:27 +00:00
|
|
|
devel do
|
|
|
|
url "http://cairographics.org/snapshots/cairo-1.15.2.tar.xz"
|
|
|
|
sha256 "268cc265a7f807403582f440643064bf52896556766890c8df7bad02d230f6c9"
|
|
|
|
end
|
|
|
|
|
2012-08-23 16:49:08 +00:00
|
|
|
keg_only :provided_pre_mountain_lion
|
2012-08-04 09:10:55 +00:00
|
|
|
|
2012-08-10 04:47:23 +00:00
|
|
|
option :universal
|
|
|
|
|
2014-10-30 17:02:34 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2015-08-14 16:46:11 +00:00
|
|
|
depends_on :x11 => :optional if MacOS.version > :leopard
|
2014-10-30 17:02:34 +00:00
|
|
|
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?
|
2012-03-31 11:31:23 +00:00
|
|
|
|
2012-02-16 20:41:29 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
2012-08-10 04:47:23 +00:00
|
|
|
--prefix=#{prefix}
|
2013-12-09 21:10:40 +00:00
|
|
|
--enable-gobject=yes
|
2014-11-03 18:43:46 +00:00
|
|
|
--enable-svg=yes
|
2015-01-23 15:26:25 +00:00
|
|
|
--enable-tee=yes
|
2015-05-18 11:10:25 +00:00
|
|
|
--enable-quartz-image
|
2012-08-10 04:47:23 +00:00
|
|
|
]
|
2012-03-31 11:31:23 +00:00
|
|
|
|
2015-08-24 01:52:55 +00:00
|
|
|
if build.with? "x11"
|
|
|
|
args << "--enable-xcb=yes" << "--enable-xlib=yes" << "--enable-xlib-xrender=yes"
|
|
|
|
else
|
|
|
|
args << "--enable-xcb=no" << "--enable-xlib=no" << "--enable-xlib-xrender=no"
|
|
|
|
end
|
2012-02-16 20:41:29 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
2015-05-18 11:10:25 +00:00
|
|
|
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
|