2011-03-10 05:11:03 +00:00
|
|
|
class Cairomm < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Vector graphics library with cross-device output support"
|
2015-04-22 09:47:11 +00:00
|
|
|
homepage "http://cairographics.org/cairomm/"
|
|
|
|
url "http://cairographics.org/releases/cairomm-1.11.2.tar.gz"
|
|
|
|
sha256 "ccf677098c1e08e189add0bd146f78498109f202575491a82f1815b6bc28008d"
|
2015-05-18 13:14:03 +00:00
|
|
|
revision 1
|
2010-05-25 16:29:08 +00:00
|
|
|
|
2015-06-17 19:04:01 +00:00
|
|
|
bottle do
|
|
|
|
revision 1
|
|
|
|
sha256 "8e3d574df6640965c1801f0d70950b1f1b41031bddf82ccb109dcc11276bc78f" => :yosemite
|
|
|
|
sha256 "27339feb44c56a23899bbadea5c085a99129ce6541b0d956909ccba9839fd841" => :mavericks
|
|
|
|
sha256 "f38db939a7ff7b69742caef42ecbe5210dc4063c84dc11048430fc06f1bf186e" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2014-01-07 08:50:25 +00:00
|
|
|
option :cxx11
|
2012-08-12 04:19:06 +00:00
|
|
|
|
2015-04-22 09:47:11 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2014-01-07 08:50:25 +00:00
|
|
|
if build.cxx11?
|
2015-04-22 09:47:11 +00:00
|
|
|
depends_on "libsigc++" => "c++11"
|
2014-01-07 08:50:25 +00:00
|
|
|
else
|
2015-04-22 09:47:11 +00:00
|
|
|
depends_on "libsigc++"
|
2014-01-07 08:50:25 +00:00
|
|
|
end
|
2014-03-23 02:25:54 +00:00
|
|
|
|
2015-04-22 09:47:11 +00:00
|
|
|
depends_on "libpng"
|
2015-04-24 16:48:08 +00:00
|
|
|
depends_on "cairo"
|
2010-05-25 16:29:08 +00:00
|
|
|
|
|
|
|
def install
|
2014-01-07 08:50:25 +00:00
|
|
|
ENV.cxx11 if build.cxx11?
|
2010-05-25 16:29:08 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
2011-10-18 20:41:42 +00:00
|
|
|
"--prefix=#{prefix}"
|
2015-04-22 09:47:11 +00:00
|
|
|
system "make", "install"
|
|
|
|
end
|
2015-05-12 06:34:14 +00:00
|
|
|
|
2015-04-22 09:47:11 +00:00
|
|
|
test do
|
|
|
|
(testpath/"test.cpp").write <<-EOS.undent
|
|
|
|
#include <cairomm/cairomm.h>
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, 600, 400);
|
|
|
|
Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create(surface);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
2015-05-12 06:34:14 +00:00
|
|
|
cairo = Formula["cairo"]
|
|
|
|
fontconfig = Formula["fontconfig"]
|
|
|
|
freetype = Formula["freetype"]
|
|
|
|
gettext = Formula["gettext"]
|
|
|
|
glib = Formula["glib"]
|
|
|
|
libpng = Formula["libpng"]
|
|
|
|
libsigcxx = Formula["libsigc++"]
|
|
|
|
pixman = Formula["pixman"]
|
|
|
|
flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
|
|
|
|
flags += %W[
|
|
|
|
-I#{cairo.opt_include}/cairo
|
|
|
|
-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}/cairomm-1.0
|
|
|
|
-I#{libpng.opt_include}/libpng16
|
|
|
|
-I#{libsigcxx.opt_include}/sigc++-2.0
|
|
|
|
-I#{libsigcxx.opt_lib}/sigc++-2.0/include
|
|
|
|
-I#{lib}/cairomm-1.0/include
|
|
|
|
-I#{pixman.opt_include}/pixman-1
|
|
|
|
-L#{cairo.opt_lib}
|
|
|
|
-L#{libsigcxx.opt_lib}
|
|
|
|
-L#{lib}
|
|
|
|
-lcairo
|
|
|
|
-lcairomm-1.0
|
|
|
|
-lsigc-2.0
|
|
|
|
]
|
|
|
|
system ENV.cxx, "test.cpp", "-o", "test", *flags
|
2015-04-22 09:47:11 +00:00
|
|
|
system "./test"
|
2010-05-25 16:29:08 +00:00
|
|
|
end
|
|
|
|
end
|