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
|
2015-09-22 13:49:26 +00:00
|
|
|
cellar :any
|
|
|
|
revision 2
|
|
|
|
sha256 "f8e2abb4ac5f045da5f0b95bb548a4b68ad6eeca301fcc46c0a8260e60d47404" => :el_capitan
|
|
|
|
sha256 "18ca6f729538f884fade67fee027e54265fe2bee60ccffaf6f5d19603ec87580" => :yosemite
|
|
|
|
sha256 "7ecc1bc6775f3286561b178012109d249935ad8d56fb5996d43071ac897ffb2b" => :mavericks
|
2015-06-17 19:04:01 +00:00
|
|
|
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
|