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/"
|
2015-09-22 12:08:49 +00:00
|
|
|
url "https://download.gnome.org/sources/cairomm/1.12/cairomm-1.12.0.tar.xz"
|
|
|
|
sha256 "a54ada8394a86182525c0762e6f50db6b9212a2109280d13ec6a0b29bfd1afe6"
|
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
|
2015-10-02 15:03:53 +00:00
|
|
|
sha256 "b05ec638711634ad01ab1aec44eb9397e7a67278eaa5fefd16403b240a5261b0" => :el_capitan
|
|
|
|
sha256 "98648d8f66c07f55192908271f80233a78dfe65af96c6d8f06af209e30b3d980" => :yosemite
|
|
|
|
sha256 "960d0180b4e5137d56d8d2051e21fdcbcf23ebd18ff94fa03f0d39a20853b70d" => :mavericks
|
2015-06-17 19:04:01 +00:00
|
|
|
end
|
|
|
|
|
2015-09-22 12:08:49 +00:00
|
|
|
needs :cxx11
|
2012-08-12 04:19:06 +00:00
|
|
|
|
2015-04-22 09:47:11 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2015-09-22 12:08:49 +00:00
|
|
|
depends_on "libsigc++"
|
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
|
2015-09-22 12:08:49 +00:00
|
|
|
ENV.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
|
|
|
|
]
|
2015-09-22 12:08:49 +00:00
|
|
|
system ENV.cxx, "-std=c++11", "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
|